Codebase list dvisvgm / f117196
Update upstream source from tag 'upstream/2.8' Update to upstream version '2.8' with Debian dir e5fd1fa158cb82bf5ef0068c939786fca475ea57 Norbert Preining 4 years ago
156 changed file(s) with 28151 addition(s) and 16166 deletion(s). Raw diff Collapse all Expand all
0 2019-07-12 Martin Gieseking <martin.gieseking@uos.de>
1
2 * .appveyor.yml, .travis.yml, configure.ac, src/Doxyfile, src/version.hpp:
3 set version to 2.7.3
4
5 2019-07-09 Martin Gieseking <martin.gieseking@uos.de>
6
7 * src/XMLString.cpp, src/utility.cpp, src/utility.hpp,
8 tests/UtilityTest.cpp:
9 added util::to_string(double) that strips trailing zeros
10 (in contrast to
11 std::to_string)
12
13 * src/CMapManager.cpp, src/CMapReader.cpp, src/DVIReader.cpp,
14 src/GFReader.cpp, src/JFM.cpp, src/Length.cpp, src/MapLine.cpp,
15 src/Matrix.cpp, src/PDFParser.cpp, src/SVGOutput.cpp, src/VFReader.cpp:
16 replaced some string streams with plain strings
17
18 2019-07-08 Martin Gieseking <martin.gieseking@uos.de>
19
20 * README.md:
21 updated badges in README
22
23 * src/Font.cpp, src/Font.hpp, src/dvisvgm.cpp:
24 changed type of CACHE_PATH to std::string
25
26 2019-07-07 Martin Gieseking <martin.gieseking@uos.de>
27
28 * .github/FUNDING.yml:
29 added funding.yml
30
31 2019-07-06 Martin Gieseking <martin.gieseking@uos.de>
32
33 * src/DVIToSVG.cpp:
34 properly assign collected chars to unique fonts (fixes #110)
35
36 2019-06-18 Martin Gieseking <martin.gieseking@uos.de>
37
38 * doc/dvisvgm.txt.in:
39 manpage: updated \special example
40
41 2019-06-17 Martin Gieseking <martin.gieseking@uos.de>
42
43 * src/BasicDVIReader.cpp:
44 replaced string streams with plain strings
45
46 2019-06-11 Martin Gieseking <martin.gieseking@uos.de>
47
48 * tests/genhashcheck.py:
49 use range-based loop to iterate over C array
50
51 2019-06-07 Martin Gieseking <martin.gieseking@uos.de>
52
53 * .appveyor.yml, .travis.yml, configure.ac, src/Doxyfile, src/version.hpp:
54 set version to 2.7.2
55
56 * NEWS:
57 updated NEWS
58
59 2019-05-29 Martin Gieseking <martin.gieseking@uos.de>
60
61 * src/psdefs.cpp:
62 'GS_PDF_ProcSet' and 'pdfdict' are private as of GS 9.27
63 As a workaround
64 'runpdfbegin' and 'runpdfend' can be used to enter/leave the
65 dictionaries.
66
67 2019-05-20 Martin Gieseking <martin.gieseking@uos.de>
68
69 * .appveyor.yml, .travis.yml, configure.ac, src/Doxyfile, src/version.hpp:
70 set version to 2.7.1
71
72 * NEWS:
73 updated NEWS
74
75 2019-05-10 Martin Gieseking <martin.gieseking@uos.de>
76
77 * .appveyor.yml, .gitignore, src/MiKTeXCom.hpp:
78 added files required to access the MiKTeX session object
79
80 2019-05-06 Martin Gieseking <martin.gieseking@uos.de>
81
82 * src/psdefs.cpp:
83 pop unused operand in PS operator 'setmatrix' (closes #106)
84
85 2019-04-18 Martin Gieseking <martin.gieseking@uos.de>
86
87 * src/optimizer/AttributeExtractor.cpp, src/optimizer/GroupCollapser.cpp,
88 src/utility.hpp:
89 removed util::make_array() due to compatibility
90 issues
91 https://trac.macports.org/ticket/58347
92
93 2019-04-17 Martin Gieseking <martin.gieseking@uos.de>
94
95 * README, README.md:
96 updated URL of FontForge website
97
98 2019-04-15 Martin Gieseking <martin.gieseking@uos.de>
99
100 * README.md:
101 removed Coverity badge as the service seems to be dead
102
103 2019-04-14 Martin Gieseking <martin.gieseking@uos.de>
104
105 * src/Makefile.am:
106 add file windows.hpp to source tarball
107
108 2019-04-13 Martin Gieseking <martin.gieseking@uos.de>
109
110 * .appveyor.yml, .travis.yml, configure.ac, src/Doxyfile, src/version.hpp:
111 set version to 2.7
112
113 * NEWS:
114 updated NEWS
115
116 2019-04-12 Martin Gieseking <martin.gieseking@uos.de>
117
118 * doc/dvisvgm.txt.in, src/DvisvgmSpecialHandler.cpp:
119 added specials "bbox lock" and "bbox unlock" to lock/unlock the page
120 bbox
121 (closes #105)
122
123 * doc/dvisvgm.txt.in, src/DvisvgmSpecialHandler.cpp:
124 added optional modifier 'transform' to the dvisvgm:bbox specials
125
126 * doc/dvisvgm.txt.in, src/DvisvgmSpecialHandler.cpp:
127 added macro {?matrix} to raw specials
128
129 2019-04-11 Martin Gieseking <martin.gieseking@uos.de>
130
131 * src/Bezier.cpp, src/BoundingBox.hpp, src/CMap.hpp, src/CMapReader.hpp,
132 src/Character.hpp, src/Color.hpp, src/DLLoader.hpp, src/Directory.cpp,
133 src/Directory.hpp, src/DvisvgmSpecialHandler.cpp, src/EPSFile.hpp,
134 src/EncFile.hpp, src/FilePath.hpp, src/Font.hpp, src/FontEncoding.hpp,
135 src/FontMap.hpp, src/FontWriter.cpp, src/FontWriter.hpp,
136 src/GFTracer.hpp, src/GlyphTracerMessages.hpp, src/GraphicsPath.hpp,
137 src/InputBuffer.hpp, src/InputReader.hpp, src/JFM.hpp, src/Length.hpp,
138 src/MD5HashFunction.hpp, src/MapLine.hpp, src/Matrix.cpp, src/Matrix.hpp,
139 src/Message.hpp, src/PDFParser.cpp, src/PDFParser.hpp, src/PSPattern.hpp,
140 src/PSPreviewFilter.hpp, src/PageSize.hpp, src/Pair.hpp,
141 src/PsSpecialHandler.cpp, src/PsSpecialHandler.hpp,
142 src/SVGCharHandler.hpp, src/SVGCharTspanTextHandler.hpp,
143 src/SVGOutput.hpp, src/SVGSingleCharTextHandler.hpp,
144 src/ShadingPatch.hpp, src/SourceInput.hpp, src/StreamReader.hpp,
145 src/StreamWriter.hpp, src/TFM.hpp, src/TensorProductPatch.hpp,
146 src/TriangularPatch.hpp, src/TrueTypeFont.hpp, src/VFReader.cpp,
147 src/VFReader.hpp, src/VectorIterator.hpp, src/VectorStream.hpp,
148 src/XMLDocument.hpp, src/XMLString.hpp, src/XXHashFunction.hpp,
149 src/optimizer/DependencyGraph.hpp:
150 marked most constructors 'explicit' if they may be called with a single
151 parameter
152
153 * src/DVIReader.cpp, src/DVIToSVG.cpp, src/DVIToSVGActions.cpp,
154 src/Font.cpp, src/FontEngine.cpp, src/FontManager.cpp,
155 src/HyperlinkManager.cpp, src/ImageToSVG.cpp, src/PDFParser.hpp,
156 src/PSInterpreter.cpp, src/PdfSpecialHandler.cpp,
157 src/PsSpecialHandler.cpp, src/SVGCharHandler.cpp,
158 src/SVGCharPathHandler.cpp, src/SVGCharTspanTextHandler.cpp,
159 src/SVGTree.cpp, src/TensorProductPatch.cpp, src/TriangularPatch.cpp,
160 src/TrueTypeFont.cpp:
161 use automatic type deduction in conjunction with casts
162
163 * src/EPSFile.cpp, src/EmSpecialHandler.cpp, src/EncFile.cpp,
164 src/InputReader.cpp, src/PSInterpreter.cpp, src/PsSpecialHandler.cpp,
165 src/SpecialManager.cpp, src/StreamReader.cpp, src/Subfont.cpp,
166 src/Unicode.cpp, src/dvisvgm.cpp:
167 explicitly cast integers representing characeters to char
168
169 * src/CLCommandLine.hpp, src/DvisvgmSpecialHandler.cpp,
170 src/DvisvgmSpecialHandler.hpp, src/EncFile.cpp, src/Font.cpp,
171 src/Font.hpp, src/MetafontWrapper.cpp, src/MetafontWrapper.hpp,
172 src/Process.cpp, src/Process.hpp, src/SVGOutput.cpp, src/SVGOutput.hpp,
173 src/Subfont.cpp, src/Subfont.hpp:
174 if possible, move string parameters instead of copying them
175
176 * src/Color.cpp, src/FontEngine.cpp, src/PathClipper.cpp:
177 use std::lround() rather than truncation
178
179 * src/DVIActions.hpp, src/DVIToSVGActions.hpp, src/Font.hpp,
180 src/PSInterpreter.cpp, src/SignalHandler.cpp, src/System.cpp:
181 replaced 0 and NULL with nullptr
182
183 * src/Message.cpp, src/Message.hpp:
184 drop 'const' from char parameter
185
186 * src/EPSFile.cpp:
187 replaced C array with std::array
188
189 * src/SpecialManager.hpp, src/ZLibOutputStream.hpp:
190 made deleted constructor public; use 'default' with default constructor
191
192 * src/PageSize.cpp:
193 removed redundant semicolons
194
195 2019-04-10 Martin Gieseking <martin.gieseking@uos.de>
196
197 * src/RangeMap.cpp, tests/RangeMapTest.cpp:
198 use std::accumulate() to compute the number of values mapped by a
199 RangeMap
200
201 2019-04-09 Martin Gieseking <martin.gieseking@uos.de>
202
203 * doc/dvisvgm.txt.in:
204 reworded some paragraphs on the manpage
205
206 2019-04-05 Martin Gieseking <martin.gieseking@uos.de>
207
208 * src/DvisvgmSpecialHandler.cpp, src/HtmlSpecialHandler.cpp,
209 src/InputReader.cpp, src/InputReader.hpp, src/PsSpecialHandler.cpp,
210 tests/StreamInputBufferTest.cpp:
211 optionally allow 'flags' (attributes w/o values) in attribute lists
212
213 * src/PsSpecialHandler.cpp:
214 psfile/pdffile: evaluate boolean attribute 'clip'
215 If given, the drawing
216 region is clipped to the bounding box of the
217 EPS/PDF page being
218 processed.
219 (closes #104)
220
221 * .appveyor.yml:
222 AppVeyor: switched build image to VS 2019 Preview
223
224 2019-04-04 Martin Gieseking <martin.gieseking@uos.de>
225
226 * .appveyor.yml:
227 AppVeyor: updated release number of ttfautohint-dll
228
229 * m4/ax_cxx_compile_stdcxx.m4:
230 updated ax_cxx_compile_stdcxx.m4 to version 11
231
232 2019-04-03 Martin Gieseking <martin.gieseking@uos.de>
233
234 * .appveyor.yml:
235 AppVeyor: set freetype version to 2.10.0; use current image of VS 2017
236 again
237
238 * src/SVGTree.cpp:
239 fixed gcc 5 failure regarding initializer lists
240
241 * src/FileFinder.cpp:
242 pdffile special: look for pdf files in texmf tree too (closes #103)
243
244 2019-04-01 Martin Gieseking <martin.gieseking@uos.de>
245
246 * src/optimizer/GroupCollapser.cpp:
247 group collapser: unwrap groups without attributes
248
249 * src/DVIToSVGActions.hpp, src/DvisvgmSpecialHandler.cpp,
250 src/DvisvgmSpecialHandler.hpp, src/EmSpecialHandler.cpp,
251 src/HyperlinkManager.cpp, src/ImageToSVG.hpp, src/PSPattern.cpp,
252 src/PsSpecialHandler.cpp, src/SpecialActions.hpp,
253 src/TpicSpecialHandler.cpp, tests/DvisvgmSpecialTest.cpp,
254 tests/EmSpecialTest.cpp, tests/TpicSpecialTest.cpp:
255 reduced interface of SpecialActions
256 - removed append/prepend and context
257 functions
258 - added direct access to the SVGTree object
259
260 2019-03-31 Martin Gieseking <martin.gieseking@uos.de>
261
262 * src/XMLNode.cpp, src/XMLNode.hpp, src/optimizer/AttributeExtractor.cpp,
263 src/optimizer/AttributeExtractor.hpp, src/optimizer/GroupCollapser.cpp,
264 src/optimizer/RedundantElementRemover.cpp,
265 src/optimizer/TransformSimplifier.cpp, src/optimizer/WSNodeRemover.cpp,
266 tests/BoundingBoxTest.cpp, tests/TpicSpecialTest.cpp,
267 tests/XMLNodeTest.cpp:
268 refactored the implementation of the XML node classes
269 for easier
270 modifications of the XML tree
271
272 2019-03-30 Martin Gieseking <martin.gieseking@uos.de>
273
274 * libs/ff-woff/Makefile.am:
275 added missing zlib include path to ff-woff
276
277 * src/CMapReader.cpp:
278 properly release memory if CMap throws an exception
279
280 2019-03-28 Martin Gieseking <martin.gieseking@uos.de>
281
282 * src/GraphicsPath.hpp:
283 skip redundant line drawing commands in path elements
284
285 2019-03-27 Martin Gieseking <martin.gieseking@uos.de>
286
287 * src/XMLString.cpp, tests/DVIReaderTest.cpp, tests/GFGlyphTracerTest.cpp,
288 tests/MatrixTest.cpp:
289 replace "0." by "." in floating point numbers |x| < 1
290
291 * src/GraphicsPath.hpp, tests/GFGlyphTracerTest.cpp:
292 avoid redundant space characters in SVG paths
293
294 * src/GraphicsPath.hpp, tests/TpicSpecialTest.cpp:
295 take precision into account when checking for reflection points
296
297 2019-03-25 Martin Gieseking <martin.gieseking@uos.de>
298
299 * src/Matrix.cpp, src/Matrix.hpp, tests/MatrixTest.cpp:
300 made Matrix::parse() a static member
301
302 * configure.ac, doc/dvisvgm.txt.in, src/CommandLine.hpp, src/DVIToSVG.cpp,
303 src/DependencyGraph.hpp, src/ImageToSVG.cpp, src/Makefile.am,
304 src/SVGOptimizer.cpp, src/SVGOptimizer.hpp, src/SVGTree.cpp,
305 src/XMLNode.cpp, src/dvisvgm.cpp, src/optimizer/AttributeExtractor.cpp,
306 src/optimizer/AttributeExtractor.hpp, src/optimizer/CMakeLists.txt,
307 src/optimizer/DependencyGraph.hpp, src/optimizer/GroupCollapser.cpp,
308 src/optimizer/GroupCollapser.hpp, src/optimizer/Makefile.am,
309 src/optimizer/OptimizerModule.hpp,
310 src/optimizer/RedundantElementRemover.cpp,
311 src/optimizer/RedundantElementRemover.hpp,
312 src/optimizer/SVGOptimizer.cpp, src/optimizer/SVGOptimizer.hpp,
313 src/optimizer/TransformSimplifier.cpp,
314 src/optimizer/TransformSimplifier.hpp, src/optimizer/WSNodeRemover.cpp,
315 src/optimizer/WSNodeRemover.hpp, src/options.xml,
316 tests/DependencyGraphTest.cpp, tests/Makefile.am, tests/create-makefile:
317 moved optimizer classes to subdirectory
318
319 2019-03-24 Martin Gieseking <martin.gieseking@uos.de>
320
321 * src/Matrix.cpp, src/Matrix.hpp, src/PsSpecialHandler.cpp,
322 tests/MatrixTest.cpp:
323 swapped Matrix::lmultiply and Matrix::rmultiply
324
325 * src/Matrix.cpp, src/Matrix.hpp, src/SVGOptimizer.cpp,
326 src/SVGOptimizer.hpp, src/utility.hpp, tests/MatrixTest.cpp:
327 added optimizer to simplify 'transform' attributes
328
329 2019-03-23 Martin Gieseking <martin.gieseking@uos.de>
330
331 * src/SVGOptimizer.cpp, src/SVGOptimizer.hpp, src/XMLNode.cpp,
332 src/XMLNode.hpp:
333 remove whitespace nodes before collapsing group elements
334
335 2019-03-22 Martin Gieseking <martin.gieseking@uos.de>
336
337 * src/InputBuffer.hpp:
338 added StringInputBuffer::assign() to assign a different string
339
340 * src/InputReader.cpp, tests/StreamInputBufferTest.cpp:
341 replaced constraints for attribute names
342 - must start with a letter
343 -
344 may contain selected non-alphanumeric characters, like '-', '_', and '.'
345
346 * doc/dvisvgm.txt.in, src/DvisvgmSpecialHandler.cpp,
347 src/DvisvgmSpecialHandler.hpp, src/SVGTree.cpp, src/XMLNode.cpp,
348 tests/DvisvgmSpecialTest.cpp:
349 allow split tags distributed over several dvisvgm:raw specials
350
351 2019-03-21 Martin Gieseking <martin.gieseking@uos.de>
352
353 * src/BgColorSpecialHandler.cpp, src/PSPattern.cpp, src/PageRanges.cpp,
354 src/PathClipper.cpp, src/RangeMap.cpp:
355 use type 'auto' for local iterator variables
356
357 * src/FilePath.hpp, src/Font.hpp, src/ImageToSVG.hpp, src/PDFParser.hpp,
358 src/SVGOutput.hpp, src/Subfont.hpp, src/XMLNode.cpp, src/XMLNode.hpp:
359 use move semantics to initialize string members
360
361 2019-03-20 Martin Gieseking <martin.gieseking@uos.de>
362
363 * src/BasicDVIReader.hpp, src/DVIToSVG.hpp, src/Subfont.hpp:
364 deleted constructors should be public
365
366 * src/Bezier.cpp, src/Bezier.hpp, src/CMap.hpp, src/CMapReader.cpp,
367 src/Color.cpp, src/DVIToSVG.hpp, src/DVIToSVGActions.cpp,
368 src/EmSpecialHandler.cpp, src/EncFile.cpp, src/FileFinder.cpp,
369 src/FileFinder.hpp, src/FileSystem.cpp, src/Font.cpp, src/FontCache.cpp,
370 src/FontEncoding.cpp, src/FontEncoding.hpp, src/FontEngine.cpp,
371 src/FontEngine.hpp, src/FontManager.cpp, src/FontManager.hpp,
372 src/FontWriter.hpp, src/GFGlyphTracer.cpp, src/GFGlyphTracer.hpp,
373 src/Ghostscript.cpp, src/Ghostscript.hpp, src/ImageToSVG.cpp,
374 src/MapLine.cpp, src/MapLine.hpp, src/Message.cpp, src/Message.hpp,
375 src/NoPsSpecialHandler.hpp, src/PDFParser.cpp, src/PSInterpreter.cpp,
376 src/PSInterpreter.hpp, src/PathClipper.cpp, src/Process.hpp,
377 src/SVGCharHandler.hpp, src/SVGCharPathHandler.cpp,
378 src/SVGCharPathHandler.hpp, src/SVGCharTspanTextHandler.cpp,
379 src/SVGTree.hpp, src/VFReader.cpp, src/VFReader.hpp, src/XMLNode.cpp,
380 src/dvisvgm.cpp:
381 use nullptr instead of 0
382
383 * src/BoundingBox.hpp, src/CLCommandLine.hpp, src/CMapReader.hpp,
384 src/Calculator.hpp, src/Font.hpp, src/FontMetrics.hpp,
385 src/FontWriter.hpp, src/GFReader.hpp, src/Length.hpp, src/MapLine.hpp,
386 src/Matrix.hpp, src/MessageException.hpp, src/PDFParser.hpp,
387 src/PSInterpreter.hpp, src/PageSize.hpp, src/ShadingPatch.hpp,
388 src/SpecialHandler.hpp, src/StreamReader.hpp, src/TrueTypeFont.hpp,
389 src/VFReader.hpp, src/VectorIterator.hpp, src/ZLibOutputStream.hpp:
390 made constructors of exception classes explicit
391
392 * src/ZLibOutputStream.hpp:
393 few modifications of class ZLibOutputStream
394
395 * src/CharMapID.hpp, src/Color.hpp, src/FontCache.hpp, src/Message.cpp,
396 src/Message.hpp:
397 ensure initializations of static members don't throw exceptions
398
399 * src/BoundingBox.cpp, src/CMapManager.cpp, src/ColorSpecialHandler.cpp,
400 src/DvisvgmSpecialHandler.cpp, src/PathClipper.cpp, src/RangeMap.cpp:
401 replaced some index-based loops with range-based ones
402
403 * src/FilePath.cpp, src/FilePath.hpp:
404 fixed type used to store directories in class FilePath
405
406 * src/CLCommandLine.cpp:
407 use emplace_back() instead of push_back()
408
409 * src/FileFinder.cpp, src/Font.hpp, src/TensorProductPatch.hpp,
410 src/dvisvgm.cpp:
411 removed redundant 'virtual' modifiers and calls of c_str()
412
413 * src/FontManager.cpp, src/HyperlinkManager.cpp, src/PageSize.cpp:
414 use spezialized string::find() to look for single characters
415
416 * doc/dvisvgm.txt.in, src/CommandLine.hpp, src/dvisvgm.cpp,
417 src/options.xml, tests/CommandLineTest.cpp:
418 renamed option --exact to --exact-bbox
419 This change is downward
420 compatible due to partial matching of long options.
421
422 * src/DVIToSVGActions.cpp, src/DvisvgmSpecialHandler.cpp, src/Matrix.cpp,
423 src/Matrix.hpp, src/PSPattern.cpp, src/PsSpecialHandler.cpp,
424 src/SVGCharHandler.cpp, src/SVGCharPathHandler.cpp, src/SVGTree.cpp,
425 tests/MatrixTest.cpp:
426 renamed and slightly refactored Matrix::getSVG()
427
428 2019-03-19 Martin Gieseking <martin.gieseking@uos.de>
429
430 * doc/dvisvgm.txt.in, src/DVIToSVGActions.hpp,
431 src/DvisvgmSpecialHandler.cpp, src/DvisvgmSpecialHandler.hpp,
432 src/HyperlinkManager.cpp, src/ImageToSVG.hpp, src/SVGTree.cpp,
433 src/SVGTree.hpp, src/SpecialActions.hpp, tests/DvisvgmSpecialTest.cpp:
434 added context stack for SVG defs section
435
436 * src/DVIToSVG.cpp, src/ImageToSVG.cpp, src/SVGOptimizer.cpp,
437 src/SVGOptimizer.hpp, src/SVGTree.cpp, src/SVGTree.hpp:
438 moved removal of redundant clipPath elements to SVGOptimizer
439
440 * doc/dvisvgm.txt.in, src/CommandLine.hpp, src/SVGOptimizer.cpp,
441 src/SVGOptimizer.hpp, src/dvisvgm.cpp, src/options.xml:
442 added command-line option --group-attributes
443
444 2019-03-18 Martin Gieseking <martin.gieseking@uos.de>
445
446 * src/Makefile.am:
447 reformatted file list in Makefile
448
449 2019-03-16 Martin Gieseking <martin.gieseking@uos.de>
450
451 * src/psdefs.cpp:
452 added processing of PS operators xshow, yshow, and xyshow
453
454 2019-03-15 Martin Gieseking <martin.gieseking@uos.de>
455
456 * libs/xxHash/xxhash.c, libs/xxHash/xxhash.h:
457 updated xxhash to version 0.7.0
458
459 2019-03-14 Martin Gieseking <martin.gieseking@uos.de>
460
461 * src/Makefile.am, src/SVGOptimizer.cpp, src/SVGOptimizer.hpp,
462 src/SVGTree.cpp, src/XMLNode.cpp, src/XMLNode.hpp, src/utility.hpp:
463 added algorithms to move common attributes to group elements
464
465 2019-03-13 Martin Gieseking <martin.gieseking@uos.de>
466
467 * src/DVIToSVGActions.hpp, src/ImageToSVG.hpp, src/PSPattern.cpp,
468 src/PSPattern.hpp, src/SVGCharHandler.cpp, src/SVGCharHandler.hpp,
469 src/SVGTree.cpp, src/SVGTree.hpp, src/SpecialActions.hpp,
470 src/SpecialManager.cpp, src/SpecialManager.hpp, src/XMLDocument.cpp,
471 src/XMLDocument.hpp, src/XMLNode.cpp, src/XMLNode.hpp,
472 tests/DvisvgmSpecialTest.cpp, tests/EmSpecialTest.cpp,
473 tests/TpicSpecialTest.cpp:
474 take unique_ptrs by value instead of rvalue reference
475
476 2019-03-12 Martin Gieseking <martin.gieseking@uos.de>
477
478 * src/BoundingBox.cpp, src/BoundingBox.hpp, src/DVIToSVG.cpp,
479 src/DVIToSVG.hpp, src/DVIToSVGActions.cpp, src/DVIToSVGActions.hpp,
480 src/DvisvgmSpecialHandler.cpp, src/EmSpecialHandler.cpp,
481 src/HyperlinkManager.cpp, src/ImageToSVG.cpp, src/ImageToSVG.hpp,
482 src/PSPattern.cpp, src/PSPattern.hpp, src/PsSpecialHandler.cpp,
483 src/PsSpecialHandler.hpp, src/SVGCharHandler.cpp, src/SVGCharHandler.hpp,
484 src/SVGCharPathHandler.cpp, src/SVGCharPathHandler.hpp,
485 src/SVGCharTspanTextHandler.cpp, src/SVGCharTspanTextHandler.hpp,
486 src/SVGTree.cpp, src/SVGTree.hpp, src/SpecialActions.hpp,
487 src/TpicSpecialHandler.cpp, src/XMLDocument.cpp, src/XMLDocument.hpp,
488 src/XMLNode.cpp, src/XMLNode.hpp, tests/DvisvgmSpecialTest.cpp,
489 tests/EmSpecialTest.cpp, tests/TpicSpecialTest.cpp,
490 tests/XMLNodeTest.cpp:
491 renamed XML node classes
492
493 * src/XMLDocument.cpp, src/XMLNode.cpp, src/XMLNode.hpp,
494 tests/XMLNodeTest.cpp:
495 replaced dynamic casts of XML nodes with dedicated cast methods
496
497 2019-03-11 Martin Gieseking <martin.gieseking@uos.de>
498
499 * doc/Makefile.am:
500 rebuild manpage if configure.ac was updated
501 A potential change of the
502 version number should be propagated to the manpage.
503
504 * doc/dvisvgm.txt.in:
505 manpage: added link to SVG color names
506
507 2019-03-09 Martin Gieseking <martin.gieseking@uos.de>
508
509 * src/PsSpecialHandler.cpp:
510 imgfile: improved and simplifed code
511 - compute transformation matrix
512 only once (for image and bbox)
513 - compute and update bbox only if
514 necessary
515
516 * .appveyor.yml, .travis.yml, configure.ac, src/Doxyfile, src/version.hpp:
517 set version to 2.6.3
518
519 * NEWS:
520 updated NEWS
521
522 2019-03-07 Martin Gieseking <martin.gieseking@uos.de>
523
524 * src/dvisvgm.cpp:
525 option --bbox: check validity of paper format arguments corretcly
526
527 * src/PsSpecialHandler.cpp:
528 ensure forward slashes in file paths passed to PS oparator 'run'
529
530 * src/PsSpecialHandler.cpp, src/psdefs.cpp:
531 psfile/pdffile: adapt opposite orientation of y-coordinates properly
532
533 2019-02-28 Martin Gieseking <martin.gieseking@uos.de>
534
535 * src/InputReader.cpp, src/InputReader.hpp,
536 tests/StreamInputBufferTest.cpp, tests/StringMatcherTest.cpp:
537 added StringMatcher::read()
538
539 * src/DvisvgmSpecialHandler.cpp, src/DvisvgmSpecialHandler.hpp,
540 src/InputReader.cpp, tests/DvisvgmSpecialTest.cpp:
541 parse raw specials and create proper XML nodes
542
543 2019-02-26 Martin Gieseking <martin.gieseking@uos.de>
544
545 * src/DvisvgmSpecialHandler.cpp, src/FontWriter.cpp:
546 replaced lookup loops with std::find_if
547
548 2019-02-25 Martin Gieseking <martin.gieseking@uos.de>
549
550 * m4/Makefile.am:
551 add ax_check_compile_flag.m4 to distributed source archives
552
553 2019-02-24 Martin Gieseking <martin.gieseking@uos.de>
554
555 * configure.ac, m4/ax_check_compile_flag.m4, src/Makefile.am:
556 add -Wno-mismatched-tags only if compiler supports
557 -Wmismatched-tags
558 (closes #101)
559
560 2019-02-17 Martin Gieseking <martin.gieseking@uos.de>
561
562 * src/Calculator.hpp, src/HtmlSpecialHandler.cpp,
563 src/HtmlSpecialHandler.hpp, src/InputReader.cpp, src/InputReader.hpp,
564 src/PsSpecialHandler.cpp, src/PsSpecialHandler.hpp,
565 tests/StreamInputBufferTest.cpp:
566 replaced some unordered maps with ordered ones
567
568 * src/HtmlSpecialHandler.cpp, src/InputReader.cpp, src/InputReader.hpp,
569 src/MapLine.cpp, src/PsSpecialHandler.cpp,
570 tests/StreamInputBufferTest.cpp:
571 accept alternative bounding chars in getQuotedString()
572
573 2019-02-16 Martin Gieseking <martin.gieseking@uos.de>
574
575 * src/XMLNode.cpp, src/XMLNode.hpp, tests/DvisvgmSpecialTest.cpp,
576 tests/EmSpecialTest.cpp, tests/TpicSpecialTest.cpp:
577 store attributes in vectors instead of maps
578
579 2019-02-15 Martin Gieseking <martin.gieseking@uos.de>
580
581 * doc/dvisvgm.txt.in, src/Color.cpp, tests/ColorSpecialTest.cpp,
582 tests/ColorTest.cpp, tests/EmSpecialTest.cpp, tests/ShadingPatchTest.cpp,
583 tests/TensorProductPatchTest.cpp, tests/TpicSpecialTest.cpp,
584 tests/TriangularPatchTest.cpp:
585 use short RGB hex values if possible
586
587 2019-02-12 Martin Gieseking <martin.gieseking@uos.de>
588
589 * src/FontEngine.cpp, src/Ghostscript.cpp:
590 replaced C casts with const_cast
591
592 2019-02-07 Martin Gieseking <martin.gieseking@uos.de>
593
594 * README.md:
595 added some links to README
596
597 2019-01-31 Martin Gieseking <martin.gieseking@uos.de>
598
599 * tests/gtest/include/gtest/gtest-death-test.h,
600 tests/gtest/include/gtest/gtest-message.h,
601 tests/gtest/include/gtest/gtest-param-test.h,
602 tests/gtest/include/gtest/gtest-printers.h,
603 tests/gtest/include/gtest/gtest-spi.h,
604 tests/gtest/include/gtest/gtest-test-part.h,
605 tests/gtest/include/gtest/gtest-typed-test.h,
606 tests/gtest/include/gtest/gtest.h,
607 tests/gtest/include/gtest/gtest_pred_impl.h,
608 tests/gtest/include/gtest/gtest_prod.h,
609 tests/gtest/include/gtest/internal/custom/gtest-port.h,
610 tests/gtest/include/gtest/internal/custom/gtest-printers.h,
611 tests/gtest/include/gtest/internal/custom/gtest.h,
612 tests/gtest/include/gtest/internal/gtest-death-test-internal.h,
613 tests/gtest/include/gtest/internal/gtest-filepath.h,
614 tests/gtest/include/gtest/internal/gtest-internal.h,
615 tests/gtest/include/gtest/internal/gtest-linked_ptr.h,
616 tests/gtest/include/gtest/internal/gtest-param-util-generated.h,
617 tests/gtest/include/gtest/internal/gtest-param-util.h,
618 tests/gtest/include/gtest/internal/gtest-port-arch.h,
619 tests/gtest/include/gtest/internal/gtest-port.h,
620 tests/gtest/include/gtest/internal/gtest-string.h,
621 tests/gtest/include/gtest/internal/gtest-tuple.h,
622 tests/gtest/include/gtest/internal/gtest-type-util.h,
623 tests/gtest/src/gtest-all.cc, tests/gtest/src/gtest-death-test.cc,
624 tests/gtest/src/gtest-filepath.cc, tests/gtest/src/gtest-internal-inl.h,
625 tests/gtest/src/gtest-port.cc, tests/gtest/src/gtest-printers.cc,
626 tests/gtest/src/gtest-test-part.cc, tests/gtest/src/gtest-typed-test.cc,
627 tests/gtest/src/gtest.cc, tests/gtest/src/gtest_main.cc:
628 updated gtest to version 1.8.1
629
630 2019-01-28 Martin Gieseking <martin.gieseking@uos.de>
631
632 * src/PsSpecialHandler.cpp:
633 put struct PatchVertex in corresponding method
634
635 2019-01-24 Martin Gieseking <martin.gieseking@uos.de>
636
637 * Makefile.am, configure.ac, m4/Makefile.am:
638 add m4 files to source tarball
639
640 2019-01-22 Martin Gieseking <martin.gieseking@uos.de>
641
642 * NEWS, README, README.md:
643 updated NEWS and README
644
645 * .travis.yml:
646 Travis: switched to xenial environment
647
648 2019-01-19 Martin Gieseking <martin.gieseking@uos.de>
649
650 * src/PsSpecialHandler.cpp, src/PsSpecialHandler.hpp, src/psdefs.cpp:
651 ensure a path loaded by 'clippath' is considered by clip/eoclip
652
653 * src/PsSpecialHandler.cpp, src/psdefs.cpp, tests/PSInterpreterTest.cpp:
654 changed semantics of operand of 'newpath'
655 It now denotes whether method
656 'newpath' was triggered by PS operator 'newpath'
657 or one of the
658 drawing/clipping operators.
659
660 * src/GraphicsPath.hpp, src/PsSpecialHandler.cpp,
661 src/PsSpecialHandler.hpp, tests/FontCacheTest.cpp,
662 tests/GraphicsPathTest.cpp:
663 only create new clipPath element if the new clip path differs
664
665 2019-01-18 Martin Gieseking <martin.gieseking@uos.de>
666
667 * src/Ghostscript.cpp:
668 fixed formatting of GS version number
669
670 * src/PsSpecialHandler.cpp:
671 use nullptr instead of 0
672
673 2019-01-15 Martin Gieseking <martin.gieseking@uos.de>
674
675 * src/psdefs.cpp:
676 execute 'show' if called internally by another PS operator (e.g.
677 charpath)
678
679 * src/psdefs.cpp:
680 don't propagate local transformations to the PS handler
681 PS operators
682 like 'charpath' may perform local transformations, e.g. by
683 calling
684 'scale'. These must not be forwarded to the PS handler.
685
686 * libs/variant/Makefile.am, libs/variant/include/mpark/config.hpp,
687 libs/variant/include/mpark/in_place.hpp,
688 libs/variant/include/mpark/lib.hpp,
689 libs/variant/include/mpark/variant.hpp:
690 updated mpark::variant to version 1.4.0
691
692 * src/psdefs.cpp:
693 PS handler: draw glyph paths with 'fill' rather than 'eofill'
694
695 * .appveyor.yml:
696 AppVeyor: updated ttfautohint revision to 1.8.2-2
697
698 2019-01-14 Martin Gieseking <martin.gieseking@uos.de>
699
700 * .appveyor.yml, .travis.yml, configure.ac, src/Doxyfile, src/version.hpp:
701 set version to 2.6.2
702
703 2019-01-11 Martin Gieseking <martin.gieseking@uos.de>
704
705 * src/psdefs.cpp, tests/PSInterpreterTest.cpp:
706 properly apply current scale values to line properties
707
708 * src/psdefs.cpp:
709 prevent visible side-effects of PS operator 'stringwidth'
710 According to
711 the PS manual, p. 699, stringwidth may execute the path operators
712 of the
713 glyph descriptions. This led to visible fragments in the SVG graphics.
714
715 2019-01-08 Martin Gieseking <martin.gieseking@uos.de>
716
717 * doc/db2html.xsl:
718 manpage: fixed wrongly nested list elements
719
720 * Makefile.am, README, README.md, configure.ac, doc/Makefile.am,
721 doc/conf-dblatex-man.xsl, doc/conf-dblatex-pdf.xsl, doc/db2html.xsl,
722 doc/dvisvgm.txt.in, doc/tweak-db-article.xsl, doc/tweak-db-refentry.xsl,
723 doc/tweak-dblatex-pdf.xsl, libs/Makefile.am,
724 libs/ff-woff/fontforge/tmpfile2.cpp, src/AGLTable.hpp,
725 src/BasicDVIReader.cpp, src/BasicDVIReader.hpp, src/Bezier.cpp,
726 src/Bezier.hpp, src/BgColorSpecialHandler.cpp,
727 src/BgColorSpecialHandler.hpp, src/Bitmap.cpp, src/Bitmap.hpp,
728 src/BoundingBox.cpp, src/BoundingBox.hpp, src/CLCommandLine.cpp,
729 src/CLCommandLine.hpp, src/CLOption.hpp, src/CMap.cpp, src/CMap.hpp,
730 src/CMapManager.cpp, src/CMapManager.hpp, src/CMapReader.cpp,
731 src/CMapReader.hpp, src/CRC32.cpp, src/CRC32.hpp, src/Calculator.cpp,
732 src/Calculator.hpp, src/CharMapID.cpp, src/CharMapID.hpp,
733 src/Character.hpp, src/Color.cpp, src/Color.hpp,
734 src/ColorSpecialHandler.cpp, src/ColorSpecialHandler.hpp,
735 src/CommandLine.hpp, src/DLLoader.cpp, src/DLLoader.hpp,
736 src/DVIActions.hpp, src/DVIReader.cpp, src/DVIReader.hpp,
737 src/DVIToSVG.cpp, src/DVIToSVG.hpp, src/DVIToSVGActions.cpp,
738 src/DVIToSVGActions.hpp, src/DependencyGraph.hpp, src/Directory.cpp,
739 src/Directory.hpp, src/DvisvgmSpecialHandler.cpp,
740 src/DvisvgmSpecialHandler.hpp, src/EPSFile.cpp, src/EPSFile.hpp,
741 src/EPSToSVG.hpp, src/EmSpecialHandler.cpp, src/EmSpecialHandler.hpp,
742 src/EncFile.cpp, src/EncFile.hpp, src/FileFinder.cpp, src/FileFinder.hpp,
743 src/FilePath.cpp, src/FilePath.hpp, src/FileSystem.cpp,
744 src/FileSystem.hpp, src/FixWord.hpp, src/Font.cpp, src/Font.hpp,
745 src/FontCache.cpp, src/FontCache.hpp, src/FontEncoding.cpp,
746 src/FontEncoding.hpp, src/FontEngine.cpp, src/FontEngine.hpp,
747 src/FontManager.cpp, src/FontManager.hpp, src/FontMap.cpp,
748 src/FontMap.hpp, src/FontMetrics.cpp, src/FontMetrics.hpp,
749 src/FontStyle.hpp, src/FontWriter.cpp, src/FontWriter.hpp,
750 src/GFGlyphTracer.cpp, src/GFGlyphTracer.hpp, src/GFReader.cpp,
751 src/GFReader.hpp, src/GFTracer.cpp, src/GFTracer.hpp,
752 src/Ghostscript.cpp, src/Ghostscript.hpp, src/Glyph.hpp,
753 src/GlyphTracerMessages.hpp, src/GraphicsPath.hpp, src/HashFunction.cpp,
754 src/HashFunction.hpp, src/HtmlSpecialHandler.cpp,
755 src/HtmlSpecialHandler.hpp, src/HyperlinkManager.cpp,
756 src/HyperlinkManager.hpp, src/ImageToSVG.cpp, src/ImageToSVG.hpp,
757 src/InputBuffer.cpp, src/InputBuffer.hpp, src/InputReader.cpp,
758 src/InputReader.hpp, src/JFM.cpp, src/JFM.hpp, src/Length.cpp,
759 src/Length.hpp, src/MD5HashFunction.hpp, src/Makefile.am,
760 src/MapLine.cpp, src/MapLine.hpp, src/Matrix.cpp, src/Matrix.hpp,
761 src/Message.cpp, src/Message.hpp, src/MessageException.hpp,
762 src/MetafontWrapper.cpp, src/MetafontWrapper.hpp, src/MiKTeXCom.cpp,
763 src/MiKTeXCom.hpp, src/NoPsSpecialHandler.cpp,
764 src/NoPsSpecialHandler.hpp, src/NumericRanges.hpp, src/PDFParser.cpp,
765 src/PDFParser.hpp, src/PDFToSVG.hpp, src/PSFilter.hpp,
766 src/PSInterpreter.cpp, src/PSInterpreter.hpp, src/PSPattern.cpp,
767 src/PSPattern.hpp, src/PSPreviewFilter.cpp, src/PSPreviewFilter.hpp,
768 src/PageRanges.cpp, src/PageRanges.hpp, src/PageSize.cpp,
769 src/PageSize.hpp, src/Pair.hpp, src/PapersizeSpecialHandler.cpp,
770 src/PapersizeSpecialHandler.hpp, src/PathClipper.cpp,
771 src/PathClipper.hpp, src/PdfSpecialHandler.cpp,
772 src/PdfSpecialHandler.hpp, src/PreScanDVIReader.cpp,
773 src/PreScanDVIReader.hpp, src/Process.cpp, src/Process.hpp,
774 src/PsSpecialHandler.cpp, src/PsSpecialHandler.hpp, src/RangeMap.cpp,
775 src/RangeMap.hpp, src/SVGCharHandler.cpp, src/SVGCharHandler.hpp,
776 src/SVGCharHandlerFactory.cpp, src/SVGCharHandlerFactory.hpp,
777 src/SVGCharPathHandler.cpp, src/SVGCharPathHandler.hpp,
778 src/SVGCharTspanTextHandler.cpp, src/SVGCharTspanTextHandler.hpp,
779 src/SVGOutput.cpp, src/SVGOutput.hpp, src/SVGSingleCharTextHandler.cpp,
780 src/SVGSingleCharTextHandler.hpp, src/SVGTree.cpp, src/SVGTree.hpp,
781 src/ShadingPatch.cpp, src/ShadingPatch.hpp, src/SignalHandler.cpp,
782 src/SignalHandler.hpp, src/SourceInput.cpp, src/SourceInput.hpp,
783 src/SpecialActions.hpp, src/SpecialHandler.hpp, src/SpecialManager.cpp,
784 src/SpecialManager.hpp, src/StreamReader.cpp, src/StreamReader.hpp,
785 src/StreamWriter.cpp, src/StreamWriter.hpp, src/Subfont.cpp,
786 src/Subfont.hpp, src/System.cpp, src/System.hpp, src/TFM.cpp,
787 src/TFM.hpp, src/TTFAutohint.cpp, src/TTFAutohint.hpp,
788 src/TensorProductPatch.cpp, src/TensorProductPatch.hpp, src/Terminal.cpp,
789 src/Terminal.hpp, src/ToUnicodeMap.cpp, src/ToUnicodeMap.hpp,
790 src/TpicSpecialHandler.cpp, src/TpicSpecialHandler.hpp,
791 src/TriangularPatch.cpp, src/TriangularPatch.hpp, src/TrueTypeFont.cpp,
792 src/TrueTypeFont.hpp, src/Unicode.cpp, src/Unicode.hpp,
793 src/VFActions.hpp, src/VFReader.cpp, src/VFReader.hpp,
794 src/VectorIterator.hpp, src/VectorStream.hpp, src/XMLDocument.cpp,
795 src/XMLDocument.hpp, src/XMLNode.cpp, src/XMLNode.hpp, src/XMLString.cpp,
796 src/XMLString.hpp, src/XXHashFunction.hpp, src/ZLibOutputStream.hpp,
797 src/dvisvgm.cpp, src/ffwrapper.c, src/ffwrapper.h, src/macros.hpp,
798 src/options.dtd, src/options.xml, src/psdefs.cpp, src/utility.cpp,
799 src/utility.hpp, src/version.hpp, src/version.hpp.in, src/windows.hpp,
800 tests/BezierTest.cpp, tests/BitmapTest.cpp, tests/BoundingBoxTest.cpp,
801 tests/CMapManagerTest.cpp, tests/CMapReaderTest.cpp, tests/CMapTest.cpp,
802 tests/CRC32Test.cpp, tests/CalculatorTest.cpp,
803 tests/ColorSpecialTest.cpp, tests/ColorTest.cpp,
804 tests/CommandLineTest.cpp, tests/DVIReaderTest.cpp,
805 tests/DependencyGraphTest.cpp, tests/DirectoryTest.cpp,
806 tests/DvisvgmSpecialTest.cpp, tests/EmSpecialTest.cpp,
807 tests/FileFinderTest.cpp, tests/FilePathTest.cpp,
808 tests/FileSystemTest.cpp, tests/FontCacheTest.cpp,
809 tests/FontManagerTest.cpp, tests/FontMapTest.cpp,
810 tests/GFGlyphTracerTest.cpp, tests/GFReaderTest.cpp,
811 tests/GhostscriptTest.cpp, tests/GraphicsPathTest.cpp,
812 tests/HashFunctionTest.cpp, tests/JFMReaderTest.cpp,
813 tests/LengthTest.cpp, tests/Makefile.am, tests/MapLineTest.cpp,
814 tests/MatrixTest.cpp, tests/MessageExceptionTest.cpp,
815 tests/PDFParserTest.cpp, tests/PSInterpreterTest.cpp,
816 tests/PageRagesTest.cpp, tests/PageSizeTest.cpp, tests/PairTest.cpp,
817 tests/PapersizeSpecialTest.cpp, tests/RangeMapTest.cpp,
818 tests/SVGOutputTest.cpp, tests/ShadingPatchTest.cpp,
819 tests/SpecialManagerTest.cpp, tests/SplittedCharInputBufferTest.cpp,
820 tests/StreamInputBufferTest.cpp, tests/StreamReaderTest.cpp,
821 tests/StreamWriterTest.cpp, tests/StringMatcherTest.cpp,
822 tests/SubfontTest.cpp, tests/TFMReaderTest.cpp,
823 tests/TensorProductPatchTest.cpp, tests/ToUnicodeMapTest.cpp,
824 tests/TpicSpecialTest.cpp, tests/TriangularPatchTest.cpp,
825 tests/UnicodeTest.cpp, tests/UtilityTest.cpp,
826 tests/VectorIteratorTest.cpp, tests/VectorStreamTest.cpp,
827 tests/XMLNodeTest.cpp, tests/XMLStringTest.cpp, tests/check-conv,
828 tests/create-makefile, tests/data/Makefile.am, tests/genhashcheck.py,
829 tests/normalize.xsl, tests/testmain.cpp:
830 updated year in copyright statements to 2019
831
832 2018-12-13 Martin Gieseking <martin.gieseking@uos.de>
833
834 * libs/potrace/CMakeLists.txt, libs/variant/CMakeLists.txt:
835 removed redundant files
836
837 2018-11-27 Martin Gieseking <martin.gieseking@uos.de>
838
839 * src/CommandLine.hpp, src/options.xml:
840 updated description in --help output
841
842 2018-11-06 Martin Gieseking <martin.gieseking@uos.de>
843
844 * configure.ac, doc/Makefile.am, libs/defs.am, src/Makefile.am,
845 tests/Makefile.am, tests/create-makefile:
846 Makefiles: replaced $(top_srcdir) with $(dvisvgm_srcdir)
847 to simplify
848 maintenance of dvisvgm in TeX Live
849
850 2018-11-03 Martin Gieseking <martin.gieseking@uos.de>
851
852 * m4/ax_cxx_compile_stdcxx.m4:
853 updated ax_cxx_compile_stdcxx.m4 to version 10
854
855 2018-10-30 Martin Gieseking <martin.gieseking@uos.de>
856
857 * libs/brotli/Makefile.am, libs/defs.am, libs/potrace/Makefile.am,
858 libs/woff2/Makefile.am, libs/xxHash/Makefile.am:
859 use negation in Makefile conditionals
860
861 2018-10-23 Martin Gieseking <martin.gieseking@uos.de>
862
863 * libs/brotli/common/platform.h, libs/brotli/common/transform.c,
864 libs/brotli/common/version.h, libs/brotli/enc/backward_references_hq.c,
865 libs/brotli/enc/backward_references_hq.h,
866 libs/brotli/enc/backward_references_inc.h, libs/brotli/enc/encode.c,
867 libs/brotli/enc/hash.h, libs/brotli/enc/hash_composite_inc.h,
868 libs/brotli/enc/hash_longest_match64_inc.h,
869 libs/brotli/enc/hash_longest_match_inc.h,
870 libs/brotli/enc/hash_rolling_inc.h,
871 libs/brotli/enc/hash_to_binary_tree_inc.h:
872 updated brotli to version 1.0.7
873
874 2018-10-11 Martin Gieseking <martin.gieseking@uos.de>
875
876 * NEWS:
877 updated NEWS
878
879 2018-10-10 Martin Gieseking <martin.gieseking@uos.de>
880
881 * doc/Makefile.am:
882 only create intermediate XML files if dvisvgm.txt.1 has changed
883
884 * .appveyor.yml, .travis.yml, configure.ac, src/Doxyfile, src/version.hpp:
885 set version to 2.6.1
886
887 2018-10-09 Martin Gieseking <martin.gieseking@uos.de>
888
889 * doc/Makefile.am:
890 ensure dvisvgm.txt.in is distributed with the tarball
891
892 * configure.ac, libs/brotli/Makefile.am, libs/defs.am,
893 libs/potrace/Makefile.am, libs/woff2/Makefile.am,
894 libs/xxHash/Makefile.am, src/Makefile.am, tests/Makefile.am,
895 tests/create-makefile:
896 relaxed semantics of config option --disable-bundled-libs
897 If some of the
898 system libraries brotli, potrace, woff2, and xxhash can't be
899 found, the
900 bundled libraries are used as a fallback, even if
901 option
902 --disable-bundled-libs is given. (closes #94)
903
904 2018-10-04 Martin Gieseking <martin.gieseking@uos.de>
905
906 * configure.ac:
907 added configuration option --disable-manpage (closes #93)
908
909 2018-10-02 Martin Gieseking <martin.gieseking@uos.de>
910
911 * configure.ac, doc/Makefile.am:
912 don't update man page if asciidoc file hasn't changed
913
914 2018-09-20 Martin Gieseking <martin.gieseking@uos.de>
915
916 * libs/brotli/common/platform.h, libs/brotli/common/version.h,
917 libs/brotli/enc/metablock.c:
918 updated brotli to version 1.0.6
919
920 2018-09-13 Martin Gieseking <martin.gieseking@uos.de>
921
922 * src/XXHashFunction.hpp:
923 fixed constexpr issue occured with gcc 4.8
924
925 2018-09-09 Martin Gieseking <martin.gieseking@uos.de>
926
927 * doc/Makefile.am:
928 add dvisvgm.sty to distributed files
929
930 2018-09-07 Martin Gieseking <martin.gieseking@uos.de>
931
932 * src/Ghostscript.cpp:
933 call RegGetValueA() with correct buffer size
934
935 * .appveyor.yml, .travis.yml, configure.ac, src/Doxyfile, src/version.hpp:
936 set version to 2.6
937
938 * NEWS:
939 updated NEWS
940
941 2018-09-05 Martin Gieseking <martin.gieseking@uos.de>
942
943 * src/DVIToSVG.cpp, src/DVIToSVG.hpp, src/dvisvgm.cpp:
944 use enums for hash parameters rather than strings
945
946 * doc/dvisvgm.txt.in, src/DVIToSVG.cpp, src/DVIToSVG.hpp:
947 added optional parameter 'replace' to --page-hashes
948
949 2018-09-04 Martin Gieseking <martin.gieseking@uos.de>
950
951 * src/DVIReader.cpp, src/DVIToSVG.cpp:
952 reset hash function before computing a page hash
953
954 2018-09-03 Martin Gieseking <martin.gieseking@uos.de>
955
956 * libs/clipper/clipper.cpp:
957 clipper: initialize TEdge by constructor instead of memset()
958
959 2018-09-01 Martin Gieseking <martin.gieseking@uos.de>
960
961 * configure.ac:
962 removed redundant check for potrace from configure
963
964 2018-08-31 Martin Gieseking <martin.gieseking@uos.de>
965
966 * libs/variant/include/mpark/config.hpp:
967 VC: fixed failing compilation of
968 mpark::variant
969 https://github.com/mpark/variant/commit/4e3e7f88f03f513622daa973
970
971 2018-08-30 Martin Gieseking <martin.gieseking@uos.de>
972
973 * .appveyor.yml:
974 AppVeyor: use VS 2017 version 15.7 instead of 15.8
975 Version 15.8 of
976 Visual Studio 2017 introduced a compiler bug that prevents
977 compiling
978 mpark::variant (https://github.com/mpark/variant/issues/48).
979
980 2018-08-28 Martin Gieseking <martin.gieseking@uos.de>
981
982 * src/XXHashFunction.hpp, src/dvisvgm.cpp:
983 use wrapper class to get the xxhash version number
984
985 * src/HashFunction.cpp, src/HashFunction.hpp, src/MD5HashFunction.hpp,
986 src/XXHashFunction.hpp, tests/HashFunctionTest.cpp:
987 added extended create functions to hash classes
988
989 * doc/dvisvgm.txt.in, src/CommandLine.hpp, src/DVIToSVG.cpp,
990 src/DVIToSVG.hpp, src/SVGOutput.cpp, src/SVGOutput.hpp, src/dvisvgm.cpp,
991 src/options.xml, tests/SVGOutputTest.cpp:
992 replaced pattern variable %h with %hd; added %ho and %hc
993 In order to
994 recognize changes in the command-line options that may affect the
995 SVG
996 output, %ho and %hc have been introduced. The former expands to a
997 32-bit
998 hash reflecting the command-line options, the latter combines this
999 information
1000 with the hash computed from the DVI page data.
1001
1002 2018-08-27 Martin Gieseking <martin.gieseking@uos.de>
1003
1004 * src/DVIToSVG.cpp, src/DVIToSVG.hpp, src/dvisvgm.cpp:
1005 option --page-hashes accepts multiple modifiers now
1006
1007 2018-08-24 Martin Gieseking <martin.gieseking@uos.de>
1008
1009 * doc/dvisvgm.txt.in, src/DVIToSVG.cpp, src/DVIToSVG.hpp,
1010 src/HashFunction.cpp, src/HashFunction.hpp, src/SVGOutput.hpp,
1011 src/dvisvgm.cpp, tests/CommandLineTest.cpp:
1012 added optional parameter 'list' to option --page-hashes
1013
1014 * src/dvisvgm.cpp:
1015 fixed wrong directory separators shown in output of --cache
1016
1017 2018-08-22 Martin Gieseking <martin.gieseking@uos.de>
1018
1019 * doc/dvisvgm.txt.in, src/CommandLine.hpp, src/DVIToSVG.hpp,
1020 src/dvisvgm.cpp, src/options.xml:
1021 added command-line option --page-hashes to enable hashing functionality
1022
1023 2018-08-21 Martin Gieseking <martin.gieseking@uos.de>
1024
1025 * AUTHORS, README, README.md, configure.ac, libs/Makefile.am,
1026 libs/md5/Makefile.am, libs/md5/md5.c, libs/md5/md5.h,
1027 src/HashFunction.cpp, src/HashFunction.hpp, src/MD5HashFunction.hpp,
1028 src/Makefile.am, src/XXHashFunction.hpp, tests/HashFunctionTest.cpp,
1029 tests/Makefile.am, tests/create-makefile:
1030 added classes to compute MD5, XXH32, and XXH64 hash values
1031
1032 * src/BasicDVIReader.hpp, src/DVIReader.cpp:
1033 added validity checks for bop offsets
1034
1035 * src/DVIReader.cpp, src/DVIReader.hpp, src/DVIToSVG.cpp,
1036 src/DVIToSVG.hpp, src/HashFunction.cpp, src/HashFunction.hpp,
1037 src/SVGOutput.cpp, src/SVGOutput.hpp:
1038 added optional computation and evaluation of page hashes
1039 If this
1040 functionality is enabled, a hash value based on the contents of
1041 the
1042 corresponding DVI page is added to the SVG file names. Furthermore,
1043 dvisvgm
1044 skips the conversion of these pages in subsequent calls if the
1045 resulting SVG
1046 files already exist.
1047
1048 2018-08-18 Martin Gieseking <martin.gieseking@uos.de>
1049
1050 * src/DVIReader.cpp:
1051 DVI postamble: relaxed plausibility check of the total page count
1052
1053 2018-08-08 Martin Gieseking <martin.gieseking@uos.de>
1054
1055 * configure.ac:
1056 correctly evaluate config option --disable-bundled-libs (closes #91)
1057
1058 2018-08-07 Martin Gieseking <martin.gieseking@uos.de>
1059
1060 * src/BasicDVIReader.hpp, src/DVIToSVG.cpp, src/DVIToSVG.hpp,
1061 src/DVIToSVGActions.cpp, src/DVIToSVGActions.hpp,
1062 src/PsSpecialHandler.cpp:
1063 getPageTransformation: replaced reference parameter with return value
1064
1065 * src/DVIToSVGActions.hpp, src/ImageToSVG.hpp, src/PsSpecialHandler.cpp,
1066 src/SpecialActions.hpp:
1067 renamed getPageTransform; return unity matrix by default
1068
1069 * .appveyor.yml, .travis.yml, configure.ac, src/Doxyfile, src/version.hpp:
1070 set version to 2.5
1071
1072 * NEWS:
1073 updated NEWS
1074
1075 2018-08-02 Martin Gieseking <martin.gieseking@uos.de>
1076
1077 * src/FileFinder.cpp, src/FilePath.cpp, src/FilePath.hpp,
1078 src/Ghostscript.cpp:
1079 TL32: also look for gsdll32.dll in the corresponding TL bin folder
1080 The
1081 changes are based on a patch sent by Akira Kakuto.
1082
1083 2018-08-01 Martin Gieseking <martin.gieseking@uos.de>
1084
1085 * README:
1086 updated README
1087
1088 * .appveyor.yml, .travis.yml:
1089 updated CI configurations; dropped potrace as an external dependency
1090
1091 * configure.ac, src/SourceInput.cpp:
1092 set umask before calling mkstemp()
1093 Coverity complains about calling
1094 mkstemp() without securely setting umask first.
1095 If umask() is available,
1096 it's now called so that the permissions of temporary
1097 files result to
1098 0600.
1099
1100 * src/BoundingBox.cpp:
1101 show lock state when printing a bounding box object
1102
1103 * src/DVIToSVG.cpp:
1104 apply user transformations even if the bounding box is locked
1105
1106 2018-07-30 Martin Gieseking <martin.gieseking@uos.de>
1107
1108 * src/ImageToSVG.cpp, src/ImageToSVG.hpp, src/dvisvgm.cpp:
1109 apply --transform commands in --eps and --pdf mode too
1110
1111 * src/DVIToSVG.cpp, src/Length.cpp, src/Length.hpp, tests/LengthTest.cpp:
1112 added function to retrieve all units supported by the Length class
1113
1114 * doc/dvisvgm.txt.in, src/DVIToSVG.cpp, src/ImageToSVG.cpp,
1115 tests/CalculatorTest.cpp:
1116 allow to use all supported units in --transform commands
1117
1118 * Makefile.am:
1119 propagate --enable-bundled-libs to "distcheck"
1120
1121 * AUTHORS, README.md, configure.ac, libs/Makefile.am,
1122 libs/potrace/CMakeLists.txt, libs/potrace/Makefile.am,
1123 libs/potrace/auxiliary.h, libs/potrace/bitmap.h, libs/potrace/config.h,
1124 libs/potrace/curve.c, libs/potrace/curve.h, libs/potrace/decompose.c,
1125 libs/potrace/decompose.h, libs/potrace/lists.h,
1126 libs/potrace/potracelib.c, libs/potrace/potracelib.h,
1127 libs/potrace/progress.h, libs/potrace/trace.c, libs/potrace/trace.h,
1128 src/Makefile.am:
1129 added potrace to the bundled libraries again
1130
1131 * tests/Makefile.am, tests/create-makefile:
1132 link tests only against bundled libs if configured with
1133 --enable-bundled-libs
1134
1135 * src/ImageToSVG.cpp:
1136 changed type of exception thrown in case of invalid EPS/PDF files
1137
1138 2018-07-29 Martin Gieseking <martin.gieseking@uos.de>
1139
1140 * src/PSInterpreter.cpp, src/PSInterpreter.hpp, src/PsSpecialHandler.cpp,
1141 src/PsSpecialHandler.hpp, src/psdefs.cpp, tests/PSInterpreterTest.cpp:
1142 replaced internal PS operator @getpdfpagebox with PSInterpreter method
1143
1144 2018-07-28 Martin Gieseking <martin.gieseking@uos.de>
1145
1146 * src/dvisvgm.cpp:
1147 removed redundant code from main()
1148
1149 * README.md, doc/dvisvgm.txt.in, src/EPSToSVG.hpp, src/ImageToSVG.cpp,
1150 src/ImageToSVG.hpp, src/PDFToSVG.hpp, src/PSInterpreter.cpp,
1151 src/PSInterpreter.hpp, src/PsSpecialHandler.cpp,
1152 src/PsSpecialHandler.hpp, src/dvisvgm.cpp, src/psdefs.cpp:
1153 PDF conversion: allow to specify the pages to process
1154
1155 2018-07-25 Martin Gieseking <martin.gieseking@uos.de>
1156
1157 * .travis.yml, README.md, configure.ac, libs/brotli/Makefile.am,
1158 libs/woff2/Makefile.am, libs/xxHash/Makefile.am, src/Makefile.am,
1159 src/dvisvgm.cpp:
1160 added config option --enable-bundled-libs
1161 If this option is given, the
1162 bundled libraries brotli, woff2, and xxhash are
1163 built and statically
1164 linked. Otherwise, the configure script looks for the
1165 corresponing system
1166 libraries and links dvisvgm against those. (closes #90)
1167
1168 2018-07-19 Martin Gieseking <martin.gieseking@uos.de>
1169
1170 * NEWS:
1171 fixed date in NEWS
1172
1173 2018-07-18 Martin Gieseking <martin.gieseking@uos.de>
1174
1175 * configure.ac, doc/Makefile.am:
1176 don't try to build manpage if required tools are missing
1177
1178 * .appveyor.yml, .travis.yml, configure.ac, src/Doxyfile, src/version.hpp:
1179 set version to 2.4.2
1180
1181 * NEWS:
1182 updated NEWS
1183
1184 2018-07-17 Martin Gieseking <martin.gieseking@uos.de>
1185
1186 * src/HyperlinkManager.cpp:
1187 reduced extent of hyperlinked areas to get a tight bbox
1188
1189 2018-07-15 Martin Gieseking <martin.gieseking@uos.de>
1190
1191 * src/PsSpecialHandler.cpp:
1192 use unique_ptr in bbox debug code
1193
1194 * src/PSPreviewFilter.cpp, src/PSPreviewFilter.hpp:
1195 removed redundant method PSPreviewFilter::getBorders()
1196
1197 * src/PSPreviewFilter.cpp, src/PsSpecialHandler.cpp:
1198 fixed computation of preview extents (closes #89)
1199
1200 * src/PsSpecialHandler.cpp:
1201 prevent warning about missing psfile "/dev/null"
1202
1203 2018-07-07 Martin Gieseking <martin.gieseking@uos.de>
1204
1205 * NEWS:
1206 updated NEWS
1207
1208 * .gitattributes:
1209 added linguist settings to
1210 .gitattributes
1211
1212 https://github.com/github/linguist
1213
1214 2018-07-06 Martin Gieseking <martin.gieseking@uos.de>
1215
1216 * libs/brotli/Makefile.am, libs/brotli/common/dictionary.c,
1217 libs/brotli/common/platform.h, libs/brotli/common/transform.c,
1218 libs/brotli/common/version.h, libs/brotli/enc/backward_references.c,
1219 libs/brotli/enc/brotli_bit_stream.h, libs/brotli/enc/command.h,
1220 libs/brotli/enc/compress_fragment.c,
1221 libs/brotli/enc/compress_fragment_two_pass.c, libs/brotli/enc/encode.c,
1222 libs/brotli/enc/encoder_dict.h, libs/brotli/enc/fast_log.h,
1223 libs/brotli/enc/hash.h, libs/brotli/enc/hash_composite_inc.h,
1224 libs/brotli/enc/hash_rolling_inc.h, libs/brotli/enc/quality.h,
1225 libs/brotli/enc/static_dict.c, libs/brotli/enc/write_bits.h,
1226 libs/brotli/include/brotli/port.h, libs/brotli/include/brotli/types.h:
1227 updated brotli to version 1.0.5
1228
1229 * README, README.md, doc/dvisvgm.txt.in, libs/ff-woff/README.md:
1230 updated links to new project website dvisvgm.de
1231
1232 * .appveyor.yml, .travis.yml, configure.ac, src/Doxyfile, src/version.hpp:
1233 set version to 2.4.1
1234
1235 2018-07-04 Martin Gieseking <martin.gieseking@uos.de>
1236
1237 * doc/dvisvgm.txt.in:
1238 manpage: updated external links
1239
1240 2018-06-23 Martin Gieseking <martin.gieseking@uos.de>
1241
1242 * libs/woff2/include/woff2/version.h, libs/woff2/src/font.cc,
1243 libs/woff2/src/normalize.cc, libs/woff2/src/woff2_enc.cc:
1244 updated woff2 to 1.0.2
1245
1246 2018-06-08 Martin Gieseking <martin.gieseking@uos.de>
1247
1248 * src/SourceInput.cpp, src/SourceInput.hpp:
1249 moved handling of temporary files to separate class
1250
1251 2018-05-30 Martin Gieseking <martin.gieseking@uos.de>
1252
1253 * src/DVIToSVGActions.cpp, src/ImageToSVG.cpp:
1254 fixed evaluation of progress delay
1255
1256 2018-05-09 Martin Gieseking <martin.gieseking@uos.de>
1257
1258 * doc/dvisvgm.txt.in:
1259 minor fixes in manpage
1260
1261 2018-05-04 Martin Gieseking <martin.gieseking@uos.de>
1262
1263 * doc/conf-dblatex-pdf.xsl:
1264 list options and specials in PDF bookmarks of manpage
1265
1266 * doc/dvisvgm.txt.in:
1267 manpage: ordered options alphabetically according to long name
1268
1269 2018-05-03 Martin Gieseking <martin.gieseking@uos.de>
1270
1271 * NEWS, README, README.md:
1272 updated NEWS and README
1273
1274 2018-05-02 Martin Gieseking <martin.gieseking@uos.de>
1275
1276 * src/Calculator.cpp:
1277 catch exception by reference rather than by value
1278
1279 2018-04-30 Martin Gieseking <martin.gieseking@uos.de>
1280
1281 * src/EPSFile.cpp, src/EPSFile.hpp, src/EPSToSVG.cpp:
1282 changed signature of EPSFile::bbox()
1283
1284 * src/CLCommandLine.cpp:
1285 cmdline: fixed handling of 'usage' section
1286
1287 * src/EPSToSVG.cpp, src/EPSToSVG.hpp, src/ImageToSVG.cpp,
1288 src/ImageToSVG.hpp, src/Makefile.am:
1289 derive EPSToSVG from abstract class ImageToSVG
1290
1291 * doc/dvisvgm.txt.in, src/CommandLine.hpp, src/Makefile.am,
1292 src/PDFToSVG.hpp, src/PSInterpreter.cpp, src/PSInterpreter.hpp,
1293 src/PsSpecialHandler.cpp, src/PsSpecialHandler.hpp, src/dvisvgm.cpp,
1294 src/options.xml, src/psdefs.cpp, tests/CommandLineTest.cpp,
1295 tests/PSInterpreterTest.cpp:
1296 added option --pdf to convert PDF files to SVG
1297
1298 * .appveyor.yml, .travis.yml, configure.ac, src/Doxyfile, src/version.hpp:
1299 set version to 2.4
1300
1301 2018-04-28 Martin Gieseking <martin.gieseking@uos.de>
1302
1303 * src/BoundingBox.cpp:
1304 swap wrongly assigned variables (doesn't affect behavior)
1305
1306 2018-04-26 Martin Gieseking <martin.gieseking@uos.de>
1307
1308 * src/PsSpecialHandler.cpp:
1309 psfile: use operator 'run' to simplify execution of (E)PS files
1310
1311 * src/PSInterpreter.cpp, src/PsSpecialHandler.cpp,
1312 src/PsSpecialHandler.hpp, src/psdefs.cpp, tests/PSInterpreterTest.cpp:
1313 added special pdffile to embed PDF graphics
1314
1315 * src/PsSpecialHandler.cpp:
1316 apply outer transformations to psfile/pdffile graphics
1317
1318 2018-04-20 Martin Gieseking <martin.gieseking@uos.de>
1319
1320 * src/Ghostscript.cpp, src/Ghostscript.hpp, src/dvisvgm.cpp,
1321 tests/GhostscriptTest.cpp:
1322 added function to get numeric GS revision
1323
1324 * src/PSInterpreter.cpp, src/PSInterpreter.hpp:
1325 moved GS init options to init method
1326
1327 * src/PsSpecialHandler.cpp:
1328 replaced str2double() with stod(); added check for zero bbox
1329
1330 * src/BgColorSpecialHandler.cpp, src/BgColorSpecialHandler.hpp,
1331 src/ColorSpecialHandler.cpp, src/ColorSpecialHandler.hpp,
1332 src/DvisvgmSpecialHandler.cpp, src/DvisvgmSpecialHandler.hpp,
1333 src/EmSpecialHandler.cpp, src/EmSpecialHandler.hpp,
1334 src/HtmlSpecialHandler.cpp, src/HtmlSpecialHandler.hpp,
1335 src/NoPsSpecialHandler.cpp, src/NoPsSpecialHandler.hpp,
1336 src/PapersizeSpecialHandler.cpp, src/PapersizeSpecialHandler.hpp,
1337 src/PdfSpecialHandler.cpp, src/PdfSpecialHandler.hpp,
1338 src/PsSpecialHandler.cpp, src/PsSpecialHandler.hpp,
1339 src/SpecialHandler.hpp, src/SpecialManager.cpp,
1340 src/TpicSpecialHandler.cpp, src/TpicSpecialHandler.hpp,
1341 tests/ColorSpecialTest.cpp, tests/DvisvgmSpecialTest.cpp,
1342 tests/PapersizeSpecialTest.cpp, tests/TpicSpecialTest.cpp:
1343 changed type of \special prefix from const char* to string
1344
1345 * src/BgColorSpecialHandler.cpp, src/BgColorSpecialHandler.hpp,
1346 src/ColorSpecialHandler.cpp, src/ColorSpecialHandler.hpp,
1347 src/DvisvgmSpecialHandler.cpp, src/DvisvgmSpecialHandler.hpp,
1348 src/EmSpecialHandler.cpp, src/EmSpecialHandler.hpp,
1349 src/HtmlSpecialHandler.cpp, src/HtmlSpecialHandler.hpp,
1350 src/NoPsSpecialHandler.cpp, src/NoPsSpecialHandler.hpp,
1351 src/PapersizeSpecialHandler.cpp, src/PapersizeSpecialHandler.hpp,
1352 src/PdfSpecialHandler.cpp, src/PdfSpecialHandler.hpp,
1353 src/PsSpecialHandler.cpp, src/PsSpecialHandler.hpp,
1354 src/SpecialHandler.hpp, src/TpicSpecialHandler.cpp,
1355 src/TpicSpecialHandler.hpp:
1356 removed const from result vector of SpecialHandler::prefixes()
1357
1358 2018-04-19 Martin Gieseking <martin.gieseking@uos.de>
1359
1360 * libs/xxHash/xxhash.c, libs/xxHash/xxhash.h:
1361 updated xxHash to version 0.6.5
1362
1363 * src/psdefs.cpp:
1364 fixed handling of PS operator 'setgstate'
1365
1366 2018-04-16 Martin Gieseking <martin.gieseking@uos.de>
1367
1368 * m4/ax_cxx_compile_stdcxx.m4:
1369 updated ax_cxx_compile_stdcxx.m4 to version 8
1370
1371 2018-04-13 Martin Gieseking <martin.gieseking@uos.de>
1372
1373 * src/BgColorSpecialHandler.hpp, src/DvisvgmSpecialHandler.hpp,
1374 src/EmSpecialHandler.hpp, src/HtmlSpecialHandler.hpp,
1375 src/NoPsSpecialHandler.hpp, src/PapersizeSpecialHandler.hpp,
1376 src/PdfSpecialHandler.hpp, src/PsSpecialHandler.hpp,
1377 src/SpecialHandler.hpp, src/SpecialManager.cpp, src/SpecialManager.hpp,
1378 src/TpicSpecialHandler.hpp:
1379 merged listener methods into SpecialHandler class
1380
1381 * src/CommandLine.hpp:
1382 made opt2cpp compatible with Python 3
1383
1384 2018-04-11 Martin Gieseking <martin.gieseking@uos.de>
1385
1386 * libs/brotli/Makefile.am, libs/brotli/common/constants.h,
1387 libs/brotli/common/platform.h, libs/brotli/common/version.h,
1388 libs/brotli/enc/backward_references.c,
1389 libs/brotli/enc/backward_references_hq.c, libs/brotli/enc/command.h,
1390 libs/brotli/enc/context.h, libs/brotli/enc/encode.c,
1391 libs/brotli/enc/memory.h, libs/brotli/enc/metablock.c,
1392 libs/brotli/enc/metablock.h, libs/brotli/enc/params.h,
1393 libs/brotli/enc/port.h, libs/brotli/enc/quality.h,
1394 libs/brotli/enc/write_bits.h, libs/brotli/include/brotli/decode.h,
1395 libs/brotli/include/brotli/encode.h:
1396 updated brotli to version 1.0.4
1397
1398 2018-03-29 Martin Gieseking <martin.gieseking@uos.de>
1399
1400 * doc/dvisvgm.txt.in, src/SVGOutput.cpp, src/ZLibOutputStream.hpp,
1401 src/dvisvgm.cpp:
1402 enabled to output compressed SVG data to stdout
1403
1404 * src/dvisvgm.cpp:
1405 renamed SourceInput variable
1406
1407 2018-03-28 Martin Gieseking <martin.gieseking@uos.de>
1408
1409 * src/dvisvgm.cpp:
1410 simplified main() function
1411
1412 2018-03-27 Martin Gieseking <martin.gieseking@uos.de>
1413
1414 * doc/dvisvgm.txt.in, src/CLCommandLine.cpp, src/CLCommandLine.hpp,
1415 src/CommandLine.hpp, src/EPSFile.cpp, src/EPSFile.hpp, src/EPSToSVG.cpp,
1416 src/EPSToSVG.hpp, src/FileSystem.cpp, src/Makefile.am,
1417 src/PsSpecialHandler.cpp, src/SVGOutput.cpp, src/SVGOutput.hpp,
1418 src/SourceInput.cpp, src/SourceInput.hpp, src/dvisvgm.cpp,
1419 src/options.xml, tests/CommandLineTest.cpp, tests/SVGOutputTest.cpp:
1420 added option to read DVI/EPS input from stdin (closes #86)
1421
1422 2018-03-26 Martin Gieseking <martin.gieseking@uos.de>
1423
1424 * src/PSInterpreter.cpp, src/PSInterpreter.hpp, src/PsSpecialHandler.cpp,
1425 src/PsSpecialHandler.hpp, src/psdefs.cpp, tests/PSInterpreterTest.cpp:
1426 PS handler: added processing of .setshapealpha and .setblendmode
1427
1428 2018-03-23 Martin Gieseking <martin.gieseking@uos.de>
1429
1430 * src/Matrix.cpp, src/Matrix.hpp, tests/MatrixTest.cpp:
1431 added initlist constructor to class Matrix
1432
1433 * src/PSInterpreter.cpp, src/PSInterpreter.hpp, src/PsSpecialHandler.cpp,
1434 src/PsSpecialHandler.hpp, src/psdefs.cpp, tests/PSInterpreterTest.cpp:
1435 psfile special: added evaluation of operator 'setpagedevice'
1436
1437 * .appveyor.yml, .travis.yml, configure.ac, src/Doxyfile, src/version.hpp:
1438 set version to 2.3.5
1439
1440 * NEWS:
1441 updated NEWS
1442
1443 2018-03-21 Martin Gieseking <martin.gieseking@uos.de>
1444
1445 * src/PsSpecialHandler.cpp:
1446 added missing PS header required to evaluate color names
1447
1448 * src/PSInterpreter.cpp, src/psdefs.cpp:
1449 drop GS option -dSAFER to stay compatible with GS 9.23
1450
1451 2018-03-13 Martin Gieseking <martin.gieseking@uos.de>
1452
1453 * .appveyor.yml, .travis.yml, configure.ac, src/Doxyfile, src/version.hpp:
1454 set version to 2.3.4
1455
1456 * NEWS:
1457 updated NEWS
1458
1459 2018-03-12 Martin Gieseking <martin.gieseking@uos.de>
1460
1461 * tests/data/Makefile.am:
1462 add required test file cmr10.pfb to source tarballs (closes #87)
1463
1464 2018-03-07 Martin Gieseking <martin.gieseking@uos.de>
1465
1466 * src/EmSpecialHandler.hpp, src/XMLDocument.hpp, src/dvisvgm.cpp:
1467 replaced memory-inefficient lists with vectors
1468
1469 * src/XMLNode.cpp, src/XMLNode.hpp:
1470 replaced lists of XML element pointers with deques
1471
1472 * src/CLCommandLine.cpp:
1473 fixed message printed if command-line contains an isolated '-'
1474
1475 2018-03-03 Martin Gieseking <martin.gieseking@uos.de>
1476
1477 * libs/brotli/Makefile.am, libs/brotli/common/constants.h,
1478 libs/brotli/common/context.h, libs/brotli/common/dictionary.h,
1479 libs/brotli/common/platform.h, libs/brotli/common/transform.h,
1480 libs/brotli/common/version.h, libs/brotli/enc/backward_references.c,
1481 libs/brotli/enc/backward_references.h,
1482 libs/brotli/enc/backward_references_hq.c,
1483 libs/brotli/enc/backward_references_hq.h,
1484 libs/brotli/enc/backward_references_inc.h, libs/brotli/enc/bit_cost.c,
1485 libs/brotli/enc/bit_cost.h, libs/brotli/enc/block_encoder_inc.h,
1486 libs/brotli/enc/block_splitter.c, libs/brotli/enc/block_splitter.h,
1487 libs/brotli/enc/block_splitter_inc.h,
1488 libs/brotli/enc/brotli_bit_stream.c, libs/brotli/enc/brotli_bit_stream.h,
1489 libs/brotli/enc/cluster.c, libs/brotli/enc/cluster.h,
1490 libs/brotli/enc/command.h, libs/brotli/enc/compress_fragment.c,
1491 libs/brotli/enc/compress_fragment.h,
1492 libs/brotli/enc/compress_fragment_two_pass.c,
1493 libs/brotli/enc/compress_fragment_two_pass.h,
1494 libs/brotli/enc/dictionary_hash.c, libs/brotli/enc/encode.c,
1495 libs/brotli/enc/encoder_dict.c, libs/brotli/enc/encoder_dict.h,
1496 libs/brotli/enc/entropy_encode.c, libs/brotli/enc/entropy_encode.h,
1497 libs/brotli/enc/entropy_encode_static.h, libs/brotli/enc/fast_log.h,
1498 libs/brotli/enc/find_match_length.h, libs/brotli/enc/hash.h,
1499 libs/brotli/enc/hash_forgetful_chain_inc.h,
1500 libs/brotli/enc/hash_longest_match64_inc.h,
1501 libs/brotli/enc/hash_longest_match_inc.h,
1502 libs/brotli/enc/hash_longest_match_quickly_inc.h,
1503 libs/brotli/enc/hash_to_binary_tree_inc.h, libs/brotli/enc/histogram.c,
1504 libs/brotli/enc/histogram.h, libs/brotli/enc/histogram_inc.h,
1505 libs/brotli/enc/literal_cost.c, libs/brotli/enc/literal_cost.h,
1506 libs/brotli/enc/memory.c, libs/brotli/enc/memory.h,
1507 libs/brotli/enc/metablock.c, libs/brotli/enc/metablock.h,
1508 libs/brotli/enc/metablock_inc.h, libs/brotli/enc/params.h,
1509 libs/brotli/enc/prefix.h, libs/brotli/enc/quality.h,
1510 libs/brotli/enc/ringbuffer.h, libs/brotli/enc/static_dict.c,
1511 libs/brotli/enc/static_dict.h, libs/brotli/enc/static_dict_lut.h,
1512 libs/brotli/enc/utf8_util.c, libs/brotli/enc/utf8_util.h,
1513 libs/brotli/enc/write_bits.h, libs/brotli/include/brotli/decode.h,
1514 libs/brotli/include/brotli/encode.h, libs/brotli/include/brotli/port.h:
1515 updated brotli to version 1.0.3
1516
1517 2018-02-20 Martin Gieseking <martin.gieseking@uos.de>
1518
1519 * doc/dvisvgm.txt.in:
1520 minor changes of the manpage
1521
1522 * .appveyor.yml, .travis.yml, configure.ac, src/Doxyfile, src/version.hpp:
1523 set version to 2.3.3
1524
1525 * NEWS:
1526 updated NEWS
1527
1528 2018-02-19 Martin Gieseking <martin.gieseking@uos.de>
1529
1530 * src/PdfSpecialHandler.cpp, src/PdfSpecialHandler.hpp:
1531 don't remove fontmap definitions before processing pdf:mapXXX specials
1532
1533 * src/FontEngine.cpp:
1534 prevent creating string from nullptr
1535
1536 2018-02-09 Martin Gieseking <martin.gieseking@uos.de>
1537
1538 * src/FileSystem.cpp, src/FontCache.cpp, src/FontMap.cpp,
1539 src/GFGlyphTracer.cpp, src/MetafontWrapper.cpp, src/PsSpecialHandler.cpp,
1540 src/utility.cpp, tests/DVIReaderTest.cpp, tests/GFReaderTest.cpp,
1541 tests/JFMReaderTest.cpp, tests/TFMReaderTest.cpp:
1542 removed calls of c_str() redundant since C++11
1543
1544 * src/StreamReader.cpp:
1545 replaced c_str() with data() in StreamReader
1546
1547 2018-02-08 Martin Gieseking <martin.gieseking@uos.de>
1548
1549 * .appveyor.yml, .travis.yml, configure.ac, src/Doxyfile, src/version.hpp:
1550 set version to 2.3.2
1551
1552 * src/TpicSpecialHandler.cpp:
1553 prevent potential division by 0
1554
1555 * src/dvisvgm.cpp:
1556 prevent dereferencing nullptr (CACHE_PATH)
1557
1558 * NEWS:
1559 updated NEWS
1560
1561 2018-02-05 Martin Gieseking <martin.gieseking@uos.de>
1562
1563 * src/DVIActions.hpp, src/DVIReader.cpp, src/DVIReader.hpp,
1564 src/DVIToSVG.cpp, src/DVIToSVG.hpp, src/DVIToSVGActions.cpp,
1565 src/DVIToSVGActions.hpp:
1566 don't update the SVG position after DVIActions::setChar()
1567 Otherwise, all
1568 characters get an explicit x position assigned even if it's
1569 already
1570 reached by applying the character's advance width.
1571
1572 2018-01-27 Hironobu Yamashita <h.y.acetaminophen@gmail.com>
1573
1574 * src/JFM.cpp:
1575 JFM.cpp: support new JFM spec introduced in TeX Live r46452
1576
1577 * src/JFM.cpp, src/JFM.hpp, tests/JFMReaderTest.cpp:
1578 adapted types to conform new JFM format
1579
1580 * src/options.xml:
1581 updated year in options.xml
1582
1583 * src/FileFinder.cpp, src/Process.cpp:
1584 relaxed reading from process pipe; fixed getting output of kpsewhich
1585 (Win only)
1586
1587 2018-01-16 Martin Gieseking <martin.gieseking@uos.de>
1588
1589 * src/CMap.hpp, src/RangeMap.hpp, src/ToUnicodeMap.cpp,
1590 tests/RangeMapTest.cpp, tests/ToUnicodeMapTest.cpp:
1591 renamed RangeMap::size() to RangeMap::numRanges()
1592
1593 2018-01-14 Martin Gieseking <martin.gieseking@uos.de>
1594
1595 * src/RangeMap.cpp, src/RangeMap.hpp:
1596 added iterator and some getters to RangeMap
1597
1598 2018-01-12 Martin Gieseking <martin.gieseking@uos.de>
1599
1600 * .appveyor.yml:
1601 AppVeyor: updated to FreeType 2.9 and ttfautohint 1.8.1
1602
1603 * .appveyor.yml:
1604 AppVeyor: fixed download link of ttfautohint-dll
1605
1606 * NEWS:
1607 updated NEWS
1608
1609 2018-01-11 Martin Gieseking <martin.gieseking@uos.de>
1610
1611 * doc/dvisvgm.txt.in:
1612 manpage: reworded info about option --bbox=preview (closes #83)
1613
1614 2018-01-09 Martin Gieseking <martin.gieseking@uos.de>
1615
1616 * .appveyor.yml, .travis.yml, configure.ac, src/Doxyfile, src/version.hpp:
1617 set version to 2.3.1
1618
1619 2018-01-03 Martin Gieseking <martin.gieseking@uos.de>
1620
1621 * src/CMapReader.cpp, src/Directory.cpp, src/Directory.hpp,
1622 src/DvisvgmSpecialHandler.cpp, src/FileFinder.cpp, src/FileFinder.hpp,
1623 src/FilePath.cpp, src/FilePath.hpp, src/FileSystem.cpp,
1624 src/FileSystem.hpp, src/Font.cpp, src/FontCache.cpp, src/FontCache.hpp,
1625 src/FontMap.cpp, src/FontMetrics.cpp, src/FontMetrics.hpp,
1626 src/MetafontWrapper.cpp:
1627 replaced some C string parameters with C++ strings
1628
1629 2018-01-02 Martin Gieseking <martin.gieseking@uos.de>
1630
1631 * Makefile.am, README, README.md, configure.ac, doc/Makefile.am,
1632 doc/conf-dblatex-man.xsl, doc/conf-dblatex-pdf.xsl, doc/db2html.xsl,
1633 doc/dvisvgm.txt.in, doc/tweak-db-article.xsl, doc/tweak-db-refentry.xsl,
1634 doc/tweak-dblatex-pdf.xsl, libs/Makefile.am,
1635 libs/ff-woff/fontforge/tmpfile2.cpp, src/AGLTable.hpp,
1636 src/BasicDVIReader.cpp, src/BasicDVIReader.hpp, src/Bezier.cpp,
1637 src/Bezier.hpp, src/BgColorSpecialHandler.cpp,
1638 src/BgColorSpecialHandler.hpp, src/Bitmap.cpp, src/Bitmap.hpp,
1639 src/BoundingBox.cpp, src/BoundingBox.hpp, src/CLCommandLine.cpp,
1640 src/CLCommandLine.hpp, src/CLOption.hpp, src/CMap.cpp, src/CMap.hpp,
1641 src/CMapManager.cpp, src/CMapManager.hpp, src/CMapReader.cpp,
1642 src/CMapReader.hpp, src/CRC32.cpp, src/CRC32.hpp, src/Calculator.cpp,
1643 src/Calculator.hpp, src/CharMapID.cpp, src/CharMapID.hpp,
1644 src/Character.hpp, src/Color.cpp, src/Color.hpp,
1645 src/ColorSpecialHandler.cpp, src/ColorSpecialHandler.hpp,
1646 src/CommandLine.hpp, src/DLLoader.cpp, src/DLLoader.hpp,
1647 src/DVIActions.hpp, src/DVIReader.cpp, src/DVIReader.hpp,
1648 src/DVIToSVG.cpp, src/DVIToSVG.hpp, src/DVIToSVGActions.cpp,
1649 src/DVIToSVGActions.hpp, src/DependencyGraph.hpp, src/Directory.cpp,
1650 src/Directory.hpp, src/DvisvgmSpecialHandler.cpp,
1651 src/DvisvgmSpecialHandler.hpp, src/EPSFile.cpp, src/EPSFile.hpp,
1652 src/EPSToSVG.cpp, src/EPSToSVG.hpp, src/EmSpecialHandler.cpp,
1653 src/EmSpecialHandler.hpp, src/EncFile.cpp, src/EncFile.hpp,
1654 src/FileFinder.cpp, src/FileFinder.hpp, src/FilePath.cpp,
1655 src/FilePath.hpp, src/FileSystem.cpp, src/FileSystem.hpp,
1656 src/FixWord.hpp, src/Font.cpp, src/Font.hpp, src/FontCache.cpp,
1657 src/FontCache.hpp, src/FontEncoding.cpp, src/FontEncoding.hpp,
1658 src/FontEngine.cpp, src/FontEngine.hpp, src/FontManager.cpp,
1659 src/FontManager.hpp, src/FontMap.cpp, src/FontMap.hpp,
1660 src/FontMetrics.cpp, src/FontMetrics.hpp, src/FontStyle.hpp,
1661 src/FontWriter.cpp, src/FontWriter.hpp, src/GFGlyphTracer.cpp,
1662 src/GFGlyphTracer.hpp, src/GFReader.cpp, src/GFReader.hpp,
1663 src/GFTracer.cpp, src/GFTracer.hpp, src/Ghostscript.cpp,
1664 src/Ghostscript.hpp, src/Glyph.hpp, src/GlyphTracerMessages.hpp,
1665 src/GraphicsPath.hpp, src/HtmlSpecialHandler.cpp,
1666 src/HtmlSpecialHandler.hpp, src/HyperlinkManager.cpp,
1667 src/HyperlinkManager.hpp, src/InputBuffer.cpp, src/InputBuffer.hpp,
1668 src/InputReader.cpp, src/InputReader.hpp, src/JFM.cpp, src/JFM.hpp,
1669 src/Length.cpp, src/Length.hpp, src/Makefile.am, src/MapLine.cpp,
1670 src/MapLine.hpp, src/Matrix.cpp, src/Matrix.hpp, src/Message.cpp,
1671 src/Message.hpp, src/MessageException.hpp, src/MetafontWrapper.cpp,
1672 src/MetafontWrapper.hpp, src/MiKTeXCom.cpp, src/MiKTeXCom.hpp,
1673 src/NoPsSpecialHandler.cpp, src/NoPsSpecialHandler.hpp,
1674 src/NumericRanges.hpp, src/PDFParser.cpp, src/PDFParser.hpp,
1675 src/PSFilter.hpp, src/PSInterpreter.cpp, src/PSInterpreter.hpp,
1676 src/PSPattern.cpp, src/PSPattern.hpp, src/PSPreviewFilter.cpp,
1677 src/PSPreviewFilter.hpp, src/PageRanges.cpp, src/PageRanges.hpp,
1678 src/PageSize.cpp, src/PageSize.hpp, src/Pair.hpp,
1679 src/PapersizeSpecialHandler.cpp, src/PapersizeSpecialHandler.hpp,
1680 src/PathClipper.cpp, src/PathClipper.hpp, src/PdfSpecialHandler.cpp,
1681 src/PdfSpecialHandler.hpp, src/PreScanDVIReader.cpp,
1682 src/PreScanDVIReader.hpp, src/Process.cpp, src/Process.hpp,
1683 src/PsSpecialHandler.cpp, src/PsSpecialHandler.hpp, src/RangeMap.cpp,
1684 src/RangeMap.hpp, src/SVGCharHandler.cpp, src/SVGCharHandler.hpp,
1685 src/SVGCharHandlerFactory.cpp, src/SVGCharHandlerFactory.hpp,
1686 src/SVGCharPathHandler.cpp, src/SVGCharPathHandler.hpp,
1687 src/SVGCharTspanTextHandler.cpp, src/SVGCharTspanTextHandler.hpp,
1688 src/SVGOutput.cpp, src/SVGOutput.hpp, src/SVGSingleCharTextHandler.cpp,
1689 src/SVGSingleCharTextHandler.hpp, src/SVGTree.cpp, src/SVGTree.hpp,
1690 src/ShadingPatch.cpp, src/ShadingPatch.hpp, src/SignalHandler.cpp,
1691 src/SignalHandler.hpp, src/SpecialActions.hpp, src/SpecialHandler.hpp,
1692 src/SpecialManager.cpp, src/SpecialManager.hpp, src/StreamReader.cpp,
1693 src/StreamReader.hpp, src/StreamWriter.cpp, src/StreamWriter.hpp,
1694 src/Subfont.cpp, src/Subfont.hpp, src/System.cpp, src/System.hpp,
1695 src/TFM.cpp, src/TFM.hpp, src/TTFAutohint.cpp, src/TTFAutohint.hpp,
1696 src/TensorProductPatch.cpp, src/TensorProductPatch.hpp, src/Terminal.cpp,
1697 src/Terminal.hpp, src/ToUnicodeMap.cpp, src/ToUnicodeMap.hpp,
1698 src/TpicSpecialHandler.cpp, src/TpicSpecialHandler.hpp,
1699 src/TriangularPatch.cpp, src/TriangularPatch.hpp, src/TrueTypeFont.cpp,
1700 src/TrueTypeFont.hpp, src/Unicode.cpp, src/Unicode.hpp,
1701 src/VFActions.hpp, src/VFReader.cpp, src/VFReader.hpp,
1702 src/VectorIterator.hpp, src/VectorStream.hpp, src/XMLDocument.cpp,
1703 src/XMLDocument.hpp, src/XMLNode.cpp, src/XMLNode.hpp, src/XMLString.cpp,
1704 src/XMLString.hpp, src/ZLibOutputStream.hpp, src/dvisvgm.cpp,
1705 src/ffwrapper.c, src/ffwrapper.h, src/macros.hpp, src/options.dtd,
1706 src/options.xml, src/psdefs.cpp, src/utility.cpp, src/utility.hpp,
1707 src/version.hpp, src/version.hpp.in, src/windows.hpp,
1708 tests/BezierTest.cpp, tests/BitmapTest.cpp, tests/BoundingBoxTest.cpp,
1709 tests/CMapManagerTest.cpp, tests/CMapReaderTest.cpp, tests/CMapTest.cpp,
1710 tests/CRC32Test.cpp, tests/CalculatorTest.cpp,
1711 tests/ColorSpecialTest.cpp, tests/ColorTest.cpp,
1712 tests/CommandLineTest.cpp, tests/DVIReaderTest.cpp,
1713 tests/DependencyGraphTest.cpp, tests/DirectoryTest.cpp,
1714 tests/DvisvgmSpecialTest.cpp, tests/EmSpecialTest.cpp,
1715 tests/FileFinderTest.cpp, tests/FilePathTest.cpp,
1716 tests/FileSystemTest.cpp, tests/FontCacheTest.cpp,
1717 tests/FontManagerTest.cpp, tests/FontMapTest.cpp,
1718 tests/GFGlyphTracerTest.cpp, tests/GFReaderTest.cpp,
1719 tests/GhostscriptTest.cpp, tests/GraphicsPathTest.cpp,
1720 tests/JFMReaderTest.cpp, tests/LengthTest.cpp, tests/Makefile.am,
1721 tests/MapLineTest.cpp, tests/MatrixTest.cpp,
1722 tests/MessageExceptionTest.cpp, tests/PDFParserTest.cpp,
1723 tests/PSInterpreterTest.cpp, tests/PageRagesTest.cpp,
1724 tests/PageSizeTest.cpp, tests/PairTest.cpp,
1725 tests/PapersizeSpecialTest.cpp, tests/RangeMapTest.cpp,
1726 tests/SVGOutputTest.cpp, tests/ShadingPatchTest.cpp,
1727 tests/SpecialManagerTest.cpp, tests/SplittedCharInputBufferTest.cpp,
1728 tests/StreamInputBufferTest.cpp, tests/StreamReaderTest.cpp,
1729 tests/StreamWriterTest.cpp, tests/StringMatcherTest.cpp,
1730 tests/SubfontTest.cpp, tests/TFMReaderTest.cpp,
1731 tests/TensorProductPatchTest.cpp, tests/ToUnicodeMapTest.cpp,
1732 tests/TpicSpecialTest.cpp, tests/TriangularPatchTest.cpp,
1733 tests/UnicodeTest.cpp, tests/UtilityTest.cpp,
1734 tests/VectorIteratorTest.cpp, tests/VectorStreamTest.cpp,
1735 tests/XMLNodeTest.cpp, tests/XMLStringTest.cpp, tests/check-conv,
1736 tests/create-makefile, tests/data/Makefile.am, tests/genhashcheck.py,
1737 tests/normalize.xsl, tests/testmain.cpp:
1738 updated year in copyright statements to 2018
1739
1740 * src/dvisvgm.cpp:
1741 avoid potential dangling string pointer to --fontmap argument
1742
1743 * src/Font.cpp:
1744 fixed char width of fonts slanted by style option (closes #82)
1745
1746 2017-12-31 Martin Gieseking <martin.gieseking@uos.de>
1747
1748 * src/TTFAutohint.hpp:
1749 don't declare member variables of TTFAutohint if ttfautohint is not
1750 available
1751
1752 * src/FontWriter.cpp:
1753 keep unhinted TTF if autohinting failed
1754
1755 2017-12-28 Martin Gieseking <martin.gieseking@uos.de>
1756
1757 * .appveyor.yml:
1758 AppVeyor: download and install ttfautohint headers
1759
1760 * .appveyor.yml, .travis.yml, configure.ac, src/Doxyfile, src/version.hpp:
1761 set version to 2.3
1762
1763 * NEWS, README, README.md:
1764 updated README and NEWS
1765
1766 2017-12-27 Martin Gieseking <martin.gieseking@uos.de>
1767
1768 * src/DLLoader.cpp, src/DLLoader.hpp, src/Ghostscript.cpp,
1769 src/TTFAutohint.cpp:
1770 simplify function to load a symbol from a dynamic library
1771
1772 2017-12-23 Martin Gieseking <martin.gieseking@uos.de>
1773
1774 * configure.ac, src/DLLoader.cpp, src/DLLoader.hpp, src/FontWriter.cpp,
1775 src/Makefile.am, src/TTFAutohint.cpp, src/TTFAutohint.hpp,
1776 src/dvisvgm.cpp:
1777 added code to load libttfautohint dynamically at runtime
1778
1779 2017-12-22 Martin Gieseking <martin.gieseking@uos.de>
1780
1781 * libs/xxHash/xxhash.c, libs/xxHash/xxhash.h:
1782 updated xxHash to version 0.6.4
1783
1784 2017-12-21 Martin Gieseking <martin.gieseking@uos.de>
1785
1786 * tests/gtest/include/gtest/gtest-param-test.h,
1787 tests/gtest/include/gtest/gtest-printers.h,
1788 tests/gtest/include/gtest/gtest-spi.h,
1789 tests/gtest/include/gtest/gtest-typed-test.h,
1790 tests/gtest/include/gtest/gtest.h,
1791 tests/gtest/include/gtest/internal/custom/gtest-port.h,
1792 tests/gtest/include/gtest/internal/custom/gtest.h,
1793 tests/gtest/include/gtest/internal/gtest-internal.h,
1794 tests/gtest/include/gtest/internal/gtest-param-util-generated.h,
1795 tests/gtest/include/gtest/internal/gtest-param-util.h,
1796 tests/gtest/include/gtest/internal/gtest-port-arch.h,
1797 tests/gtest/include/gtest/internal/gtest-port.h,
1798 tests/gtest/src/gtest-death-test.cc,
1799 tests/gtest/src/gtest-internal-inl.h, tests/gtest/src/gtest-port.cc,
1800 tests/gtest/src/gtest-printers.cc, tests/gtest/src/gtest.cc:
1801 updated gtest
1802
1803 2017-12-19 Martin Gieseking <martin.gieseking@uos.de>
1804
1805 * configure.ac:
1806 configure: dropped check of outdated Ghostscript version
1807
1808 * configure.ac, src/Makefile.am:
1809 configure: added --with-kpathsea to set the path of the kpathsea devel
1810 files
1811 closes #71
1812
1813 2017-12-18 Martin Gieseking <martin.gieseking@uos.de>
1814
1815 * src/psdefs.cpp:
1816 psdefs: replaced '6 array' with 'matrix'
1817
1818 2017-12-17 Martin Gieseking <martin.gieseking@uos.de>
1819
1820 * libs/woff2/Makefile.am, libs/woff2/include/woff2/file.h,
1821 src/FontWriter.cpp, src/FontWriter.hpp, src/Makefile.am,
1822 src/StreamReader.hpp, src/StreamWriter.cpp, src/StreamWriter.hpp,
1823 src/TrueTypeFont.cpp, src/TrueTypeFont.hpp, src/ffwrapper.c,
1824 src/ffwrapper.h, src/utility.cpp, src/utility.hpp:
1825 replaced ff_sfd_to_woff() with TrueTypeFont::writeWOFF()
1826
1827 * configure.ac, src/FontWriter.cpp, src/Makefile.am, src/dvisvgm.cpp:
1828 added optional support for ttfautohint
1829
1830 2017-12-14 Martin Gieseking <martin.gieseking@uos.de>
1831
1832 * configure.ac, libs/Makefile.am, libs/brotli/LICENSE,
1833 libs/brotli/Makefile.am, libs/brotli/common/constants.h,
1834 libs/brotli/common/dictionary.c, libs/brotli/common/dictionary.h,
1835 libs/brotli/common/version.h, libs/brotli/enc/backward_references.c,
1836 libs/brotli/enc/backward_references.h,
1837 libs/brotli/enc/backward_references_hq.c,
1838 libs/brotli/enc/backward_references_hq.h,
1839 libs/brotli/enc/backward_references_inc.h, libs/brotli/enc/bit_cost.c,
1840 libs/brotli/enc/bit_cost.h, libs/brotli/enc/bit_cost_inc.h,
1841 libs/brotli/enc/block_encoder_inc.h, libs/brotli/enc/block_splitter.c,
1842 libs/brotli/enc/block_splitter.h, libs/brotli/enc/block_splitter_inc.h,
1843 libs/brotli/enc/brotli_bit_stream.c, libs/brotli/enc/brotli_bit_stream.h,
1844 libs/brotli/enc/cluster.c, libs/brotli/enc/cluster.h,
1845 libs/brotli/enc/cluster_inc.h, libs/brotli/enc/command.h,
1846 libs/brotli/enc/compress_fragment.c, libs/brotli/enc/compress_fragment.h,
1847 libs/brotli/enc/compress_fragment_two_pass.c,
1848 libs/brotli/enc/compress_fragment_two_pass.h, libs/brotli/enc/context.h,
1849 libs/brotli/enc/dictionary_hash.c, libs/brotli/enc/dictionary_hash.h,
1850 libs/brotli/enc/encode.c, libs/brotli/enc/entropy_encode.c,
1851 libs/brotli/enc/entropy_encode.h,
1852 libs/brotli/enc/entropy_encode_static.h, libs/brotli/enc/fast_log.h,
1853 libs/brotli/enc/find_match_length.h, libs/brotli/enc/hash.h,
1854 libs/brotli/enc/hash_forgetful_chain_inc.h,
1855 libs/brotli/enc/hash_longest_match64_inc.h,
1856 libs/brotli/enc/hash_longest_match_inc.h,
1857 libs/brotli/enc/hash_longest_match_quickly_inc.h,
1858 libs/brotli/enc/hash_to_binary_tree_inc.h, libs/brotli/enc/histogram.c,
1859 libs/brotli/enc/histogram.h, libs/brotli/enc/histogram_inc.h,
1860 libs/brotli/enc/literal_cost.c, libs/brotli/enc/literal_cost.h,
1861 libs/brotli/enc/memory.c, libs/brotli/enc/memory.h,
1862 libs/brotli/enc/metablock.c, libs/brotli/enc/metablock.h,
1863 libs/brotli/enc/metablock_inc.h, libs/brotli/enc/port.h,
1864 libs/brotli/enc/prefix.h, libs/brotli/enc/quality.h,
1865 libs/brotli/enc/ringbuffer.h, libs/brotli/enc/static_dict.c,
1866 libs/brotli/enc/static_dict.h, libs/brotli/enc/static_dict_lut.h,
1867 libs/brotli/enc/utf8_util.c, libs/brotli/enc/utf8_util.h,
1868 libs/brotli/enc/write_bits.h, libs/brotli/include/brotli/decode.h,
1869 libs/brotli/include/brotli/encode.h, libs/brotli/include/brotli/port.h,
1870 libs/brotli/include/brotli/types.h, libs/woff2/Makefile.am,
1871 libs/woff2/brotli/LICENSE, libs/woff2/brotli/Makefile.am,
1872 libs/woff2/brotli/common/constants.h,
1873 libs/woff2/brotli/common/dictionary.c,
1874 libs/woff2/brotli/common/dictionary.h,
1875 libs/woff2/brotli/common/version.h,
1876 libs/woff2/brotli/enc/backward_references.c,
1877 libs/woff2/brotli/enc/backward_references.h,
1878 libs/woff2/brotli/enc/backward_references_hq.c,
1879 libs/woff2/brotli/enc/backward_references_hq.h,
1880 libs/woff2/brotli/enc/backward_references_inc.h,
1881 libs/woff2/brotli/enc/bit_cost.c, libs/woff2/brotli/enc/bit_cost.h,
1882 libs/woff2/brotli/enc/bit_cost_inc.h,
1883 libs/woff2/brotli/enc/block_encoder_inc.h,
1884 libs/woff2/brotli/enc/block_splitter.c,
1885 libs/woff2/brotli/enc/block_splitter.h,
1886 libs/woff2/brotli/enc/block_splitter_inc.h,
1887 libs/woff2/brotli/enc/brotli_bit_stream.c,
1888 libs/woff2/brotli/enc/brotli_bit_stream.h,
1889 libs/woff2/brotli/enc/cluster.c, libs/woff2/brotli/enc/cluster.h,
1890 libs/woff2/brotli/enc/cluster_inc.h, libs/woff2/brotli/enc/command.h,
1891 libs/woff2/brotli/enc/compress_fragment.c,
1892 libs/woff2/brotli/enc/compress_fragment.h,
1893 libs/woff2/brotli/enc/compress_fragment_two_pass.c,
1894 libs/woff2/brotli/enc/compress_fragment_two_pass.h,
1895 libs/woff2/brotli/enc/context.h, libs/woff2/brotli/enc/dictionary_hash.c,
1896 libs/woff2/brotli/enc/dictionary_hash.h, libs/woff2/brotli/enc/encode.c,
1897 libs/woff2/brotli/enc/entropy_encode.c,
1898 libs/woff2/brotli/enc/entropy_encode.h,
1899 libs/woff2/brotli/enc/entropy_encode_static.h,
1900 libs/woff2/brotli/enc/fast_log.h,
1901 libs/woff2/brotli/enc/find_match_length.h, libs/woff2/brotli/enc/hash.h,
1902 libs/woff2/brotli/enc/hash_forgetful_chain_inc.h,
1903 libs/woff2/brotli/enc/hash_longest_match64_inc.h,
1904 libs/woff2/brotli/enc/hash_longest_match_inc.h,
1905 libs/woff2/brotli/enc/hash_longest_match_quickly_inc.h,
1906 libs/woff2/brotli/enc/hash_to_binary_tree_inc.h,
1907 libs/woff2/brotli/enc/histogram.c, libs/woff2/brotli/enc/histogram.h,
1908 libs/woff2/brotli/enc/histogram_inc.h,
1909 libs/woff2/brotli/enc/literal_cost.c,
1910 libs/woff2/brotli/enc/literal_cost.h, libs/woff2/brotli/enc/memory.c,
1911 libs/woff2/brotli/enc/memory.h, libs/woff2/brotli/enc/metablock.c,
1912 libs/woff2/brotli/enc/metablock.h, libs/woff2/brotli/enc/metablock_inc.h,
1913 libs/woff2/brotli/enc/port.h, libs/woff2/brotli/enc/prefix.h,
1914 libs/woff2/brotli/enc/quality.h, libs/woff2/brotli/enc/ringbuffer.h,
1915 libs/woff2/brotli/enc/static_dict.c, libs/woff2/brotli/enc/static_dict.h,
1916 libs/woff2/brotli/enc/static_dict_lut.h,
1917 libs/woff2/brotli/enc/utf8_util.c, libs/woff2/brotli/enc/utf8_util.h,
1918 libs/woff2/brotli/enc/write_bits.h,
1919 libs/woff2/brotli/include/brotli/decode.h,
1920 libs/woff2/brotli/include/brotli/encode.h,
1921 libs/woff2/brotli/include/brotli/port.h,
1922 libs/woff2/brotli/include/brotli/types.h, src/Makefile.am,
1923 tests/Makefile.am, tests/create-makefile:
1924 moved brotli from woff2 to libs folder
1925
1926 2017-12-12 Martin Gieseking <martin.gieseking@uos.de>
1927
1928 * libs/variant/include/mpark/config.hpp,
1929 libs/variant/include/mpark/lib.hpp,
1930 libs/variant/include/mpark/variant.hpp:
1931 updated mpark::variant to
1932 https://github.com/mpark/variant/commit/382014b
1933 fixes a build error
1934 introduced with MSVC 19.12
1935
1936 2017-12-11 Martin Gieseking <martin.gieseking@uos.de>
1937
1938 * .appveyor.yml, .travis.yml, configure.ac, src/Doxyfile, src/version.hpp:
1939 set version to 2.2.3
1940
1941 * NEWS:
1942 updated NEWS
1943
1944 2017-11-29 Martin Gieseking <martin.gieseking@uos.de>
1945
1946 * libs/woff2/brotli/common/dictionary.h,
1947 libs/woff2/brotli/common/version.h,
1948 libs/woff2/brotli/enc/backward_references_hq.c,
1949 libs/woff2/brotli/enc/backward_references_hq.h,
1950 libs/woff2/brotli/enc/port.h, libs/woff2/brotli/enc/quality.h,
1951 libs/woff2/brotli/include/brotli/decode.h,
1952 libs/woff2/brotli/include/brotli/encode.h:
1953 updated brotli to version 1.0.2
1954
1955 2017-11-24 Martin Gieseking <martin.gieseking@uos.de>
1956
1957 * src/BgColorSpecialHandler.cpp, src/BoundingBox.cpp, src/BoundingBox.hpp,
1958 src/Color.cpp, src/PathClipper.cpp, src/SVGTree.cpp,
1959 tests/BoundingBoxTest.cpp:
1960 minor code cleanup and improvements
1961
1962 * src/DependencyGraph.hpp:
1963 simplified DependencyGraph::GraphNode
1964
1965 2017-11-23 Martin Gieseking <martin.gieseking@uos.de>
1966
1967 * tests/TpicSpecialTest.cpp:
1968 added missing initializers in TpicSpecialTest
1969
1970 * tests/EmSpecialTest.cpp:
1971 added missing initializers in EmSpecialTest
1972
1973 * src/DependencyGraph.hpp:
1974 fixed dangling pointer issue in DependencyGraph
1975
1976 * src/Makefile.am, tests/Makefile.am, tests/create-makefile:
1977 suppress warnings regarding 'mismatched tags'
1978 (class/struct)
1979 https://gcc.gnu.org/wiki/FAQ#Why_GCC_does_not_warn_for_mismatch_between_struct_and_class_.28-Wmismatched-tags.29_.3F
1980
1981 2017-11-22 Martin Gieseking <martin.gieseking@uos.de>
1982
1983 * src/PSPattern.cpp, src/SVGCharHandler.cpp, src/SVGTree.cpp,
1984 src/TpicSpecialHandler.cpp:
1985 removed redundant calls of std::move()
1986
1987 * src/Subfont.cpp, src/Subfont.hpp, tests/CMapManagerTest.cpp,
1988 tests/FileFinderTest.cpp, tests/FontManagerTest.cpp, tests/Makefile.am,
1989 tests/MapLineTest.cpp, tests/SubfontTest.cpp, tests/create-makefile,
1990 tests/testmain.cpp, tests/testutil.hpp:
1991 tests: moved common initializations to testmain.cpp
1992
1993 * src/DVIReader.hpp, tests/DVIReaderTest.cpp, tests/Makefile.am,
1994 tests/data/Makefile.am, tests/data/cmr10.pfb, tests/data/sample_v2.dvi,
1995 tests/data/sample_v3.dvi:
1996 added test for DVIReader
1997
1998 2017-11-21 Martin Gieseking <martin.gieseking@uos.de>
1999
2000 * Makefile.am:
2001 removed redundant lcov statement from Makefile
2002
2003 2017-11-20 Martin Gieseking <martin.gieseking@uos.de>
2004
2005 * tests/CMapTest.cpp, tests/GFReaderTest.cpp, tests/JFMReaderTest.cpp,
2006 tests/RangeMapTest.cpp, tests/TFMReaderTest.cpp,
2007 tests/TensorProductPatchTest.cpp, tests/ToUnicodeMapTest.cpp,
2008 tests/VectorStreamTest.cpp:
2009 tests: few code improvements
2010
2011 * README.md:
2012 added donation badge to readme
2013
2014 2017-11-17 Martin Gieseking <martin.gieseking@uos.de>
2015
2016 * src/Font.cpp, src/Font.hpp:
2017 prevent dangling pointers to font map entries (closes #79)
2018
2019 * src/CMapManager.cpp, src/FileFinder.cpp, src/Font.cpp, src/Font.hpp,
2020 src/FontEngine.cpp, src/FontManager.cpp, src/FontMap.cpp,
2021 src/FontMap.hpp, src/Ghostscript.cpp, src/MiKTeXCom.cpp, src/XMLNode.cpp:
2022 replaced null pointer constants with 'nullptr'
2023
2024 * src/XMLString.cpp, tests/TensorProductPatchTest.cpp,
2025 tests/XMLStringTest.cpp:
2026 avoid scientific notation when printing floats/doubles
2027
2028 * .appveyor.yml, .travis.yml, configure.ac, src/Doxyfile, src/version.hpp:
2029 set version to 2.2.2
2030
2031 * NEWS:
2032 updated NEWS
2033
2034 2017-11-13 Martin Gieseking <martin.gieseking@uos.de>
2035
2036 * doc/Makefile.am:
2037 ensure tweak-db-refentry.xsl is put into the tarball
2038
2039 * .appveyor.yml, .travis.yml, configure.ac, src/Doxyfile, src/version.hpp:
2040 set version to 2.2.1
2041
2042 * NEWS, README.md:
2043 updated NEWS and README
2044
2045 * libs/variant/include/mpark/lib.hpp,
2046 libs/variant/include/mpark/variant.hpp:
2047 updated mpark::variant to commit
2048 ea542a0
2049 https://github.com/mpark/variant/commit/ea542a0fef86fb8c1696238b95bdaddb8ff2337c
2050
2051 2017-11-10 Martin Gieseking <martin.gieseking@uos.de>
2052
2053 * README, README.md, doc/dvisvgm.txt.in:
2054 minor additions/fixes of manpage and README
2055
2056 2017-11-02 Martin Gieseking <martin.gieseking@uos.de>
2057
2058 * doc/Makefile.am, doc/db2html.xsl, doc/tweak-db-refentry.xsl:
2059 manpage: avoid using 'stats' to improve portability (closes #72)
2060
2061 2017-10-31 Martin Gieseking <martin.gieseking@uos.de>
2062
2063 * src/InputReader.cpp, src/InputReader.hpp, src/PSInterpreter.cpp:
2064 simplified code to lookup PS operators
2065
2066 2017-10-30 Martin Gieseking <martin.gieseking@uos.de>
2067
2068 * src/PsSpecialHandler.hpp, src/psdefs.cpp, tests/PSInterpreterTest.cpp:
2069 properly apply CTM to linewidth (closes #77)
2070
2071 * src/PsSpecialHandler.hpp, src/psdefs.cpp, tests/PSInterpreterTest.cpp:
2072 call applyscalevals on every change of the CTM
2073
2074 2017-10-27 Martin Gieseking <martin.gieseking@uos.de>
2075
2076 * src/DVIToSVG.cpp, src/DVIToSVGActions.cpp, src/DVIToSVGActions.hpp,
2077 src/DvisvgmSpecialHandler.cpp, src/EPSToSVG.cpp, src/EPSToSVG.hpp,
2078 src/EmSpecialHandler.cpp, src/HyperlinkManager.cpp, src/PSPattern.cpp,
2079 src/PSPattern.hpp, src/PsSpecialHandler.cpp, src/SVGCharHandler.cpp,
2080 src/SVGCharHandler.hpp, src/SVGCharPathHandler.cpp,
2081 src/SVGCharTspanTextHandler.cpp, src/SVGSingleCharTextHandler.cpp,
2082 src/SVGTree.cpp, src/SVGTree.hpp, src/ShadingPatch.hpp,
2083 src/SpecialActions.hpp, src/TpicSpecialHandler.cpp, src/XMLDocument.cpp,
2084 src/XMLDocument.hpp, src/XMLNode.cpp, src/XMLNode.hpp, src/utility.hpp,
2085 tests/DvisvgmSpecialTest.cpp, tests/EmSpecialTest.cpp,
2086 tests/TpicSpecialTest.cpp, tests/XMLNodeTest.cpp:
2087 replaced raw XMLNode pointers with unique_ptrs
2088 which helps to ensure
2089 proper ownership and simplifies deleting the corresponding objects
2090
2091 * src/DependencyGraph.hpp, src/SVGTree.cpp, tests/DependencyGraphTest.cpp:
2092 manage heap memory in DependencyGraph with unique_ptrs
2093
2094 2017-10-21 Martin Gieseking <martin.gieseking@uos.de>
2095
2096 * libs/ff-woff/fontforge/macbinary.c:
2097 updated link to CTAN:/tools/macutils/crc
2098
2099 2017-10-20 Martin Gieseking <martin.gieseking@uos.de>
2100
2101 * libs/woff2/include/woff2/version.h:
2102 replaced CRLF line endings
2103
2104 2017-10-17 Martin Gieseking <martin.gieseking@uos.de>
2105
2106 * src/CMapManager.cpp, src/CMapReader.cpp, src/CMapReader.hpp,
2107 src/DVIActions.hpp, src/DVIToSVG.cpp, src/DVIToSVG.hpp,
2108 src/DVIToSVGActions.hpp, src/FileFinder.cpp, src/Font.cpp, src/Font.hpp,
2109 src/FontEncoding.cpp, src/FontEncoding.hpp, src/FontEngine.cpp,
2110 src/FontEngine.hpp, src/FontManager.cpp, src/FontMetrics.cpp,
2111 src/FontMetrics.hpp, src/PSPattern.hpp, src/PsSpecialHandler.cpp,
2112 src/PsSpecialHandler.hpp, src/SVGCharHandlerFactory.cpp,
2113 src/SVGCharHandlerFactory.hpp, src/SVGOutput.cpp,
2114 src/SVGSingleCharTextHandler.hpp, src/SVGTree.cpp, src/ShadingPatch.cpp,
2115 src/ShadingPatch.hpp, src/SignalHandler.cpp, src/Subfont.cpp,
2116 src/Subfont.hpp, src/XMLNode.cpp, tests/CMapReaderTest.cpp,
2117 tests/ShadingPatchTest.cpp:
2118 replaced several bare new/delete statements with unique pointers
2119
2120 * src/dvisvgm.cpp:
2121 fixed output of option --version
2122
2123 * src/Length.hpp, src/PageSize.cpp:
2124 added user-defined literals for some length units
2125
2126 * .appveyor.yml, .travis.yml, configure.ac, src/Doxyfile, src/version.hpp:
2127 set version to 2.2
2128
2129 * NEWS, README, README.md:
2130 updated NEWS and README
2131
2132 2017-10-16 Martin Gieseking <martin.gieseking@uos.de>
2133
2134 * src/FontWriter.cpp:
2135 added missing #include of config.h
2136
2137 * src/Message.cpp:
2138 check for '\0' at end of DVISVGM_COLORS
2139
2140 * src/Subfont.cpp:
2141 don't access unique_ptr after it has been moved
2142
2143 2017-10-15 Martin Gieseking <martin.gieseking@uos.de>
2144
2145 * src/PDFParser.cpp, src/PDFParser.hpp:
2146 replaced shared_ptr with unique_ptr in PDFParser
2147
2148 2017-10-13 Martin Gieseking <martin.gieseking@uos.de>
2149
2150 * AUTHORS, configure.ac, doc/dvisvgm.txt.in, libs/Makefile.am,
2151 libs/variant/CMakeLists.txt, libs/variant/LICENSE.md,
2152 libs/variant/Makefile.am, libs/variant/include/mpark/in_place.hpp,
2153 libs/variant/include/mpark/lib.hpp,
2154 libs/variant/include/mpark/variant.hpp, src/HyperlinkManager.cpp,
2155 src/HyperlinkManager.hpp, src/InputReader.hpp, src/Makefile.am,
2156 src/PDFParser.cpp, src/PDFParser.hpp, src/PdfSpecialHandler.cpp,
2157 src/PdfSpecialHandler.hpp, tests/Makefile.am, tests/PDFParserTest.cpp,
2158 tests/SpecialManagerTest.cpp, tests/create-makefile:
2159 added evaluation of PDF hyperlink specials (closes #74)
2160
2161 * libs/variant/include/mpark/config.hpp:
2162 added missing config file
2163
2164 * .travis.yml:
2165 Travis: use gcc 4.9 rather than 4.8 to compile mpark::variant correctly
2166
2167 * tests/Makefile.am, tests/create-makefile, tests/testmain.cpp:
2168 add custom testmain to gtest.a
2169
2170 2017-10-11 Martin Gieseking <martin.gieseking@uos.de>
2171
2172 * src/HtmlSpecialHandler.cpp, src/HtmlSpecialHandler.hpp,
2173 src/HyperlinkManager.cpp, src/HyperlinkManager.hpp, src/Makefile.am,
2174 src/dvisvgm.cpp:
2175 separated hyperlink functionality from HtmlSpecialHandler to
2176 HyperlinkManager
2177
2178 2017-10-09 Martin Gieseking <martin.gieseking@uos.de>
2179
2180 * libs/woff2/src/font.cc, libs/woff2/src/normalize.cc,
2181 libs/woff2/src/woff2_enc.cc:
2182 woff2: removed unused variables to prevent compiler warnings
2183
2184 * libs/woff2/src/font.cc, libs/woff2/src/normalize.cc,
2185 libs/woff2/src/woff2_enc.cc:
2186 woff2: removed unused variables to prevent compiler warnings
2187
2188 2017-10-08 Martin Gieseking <martin.gieseking@uos.de>
2189
2190 * libs/woff2/Makefile.am, libs/woff2/include/woff2/decode.h,
2191 libs/woff2/include/woff2/encode.h, libs/woff2/include/woff2/file.h,
2192 libs/woff2/include/woff2/output.h, libs/woff2/include/woff2/version.h,
2193 libs/woff2/src/buffer.h, libs/woff2/src/file.h, libs/woff2/src/font.cc,
2194 libs/woff2/src/font.h, libs/woff2/src/glyph.cc, libs/woff2/src/glyph.h,
2195 libs/woff2/src/normalize.cc, libs/woff2/src/normalize.h,
2196 libs/woff2/src/port.h, libs/woff2/src/round.h,
2197 libs/woff2/src/store_bytes.h, libs/woff2/src/table_tags.cc,
2198 libs/woff2/src/table_tags.h, libs/woff2/src/transform.cc,
2199 libs/woff2/src/transform.h, libs/woff2/src/variable_length.cc,
2200 libs/woff2/src/variable_length.h, libs/woff2/src/woff2_common.cc,
2201 libs/woff2/src/woff2_common.h, libs/woff2/src/woff2_dec.h,
2202 libs/woff2/src/woff2_enc.cc, libs/woff2/src/woff2_enc.h,
2203 libs/woff2/src/woff2_out.cc, libs/woff2/src/woff2_out.h,
2204 src/FontWriter.cpp, src/Makefile.am, src/dvisvgm.cpp:
2205 updated woff2 to version 1.0.1
2206
2207 2017-10-06 Martin Gieseking <martin.gieseking@uos.de>
2208
2209 * src/CRC32.hpp, src/SpecialManager.hpp, src/Subfont.hpp, src/XMLNode.hpp:
2210 use delete/default to remove/implement constructors
2211
2212 * src/XMLNode.cpp, src/XMLNode.hpp:
2213 added move constructor to XMLElementNode
2214
2215 * src/Subfont.cpp, src/Subfont.hpp, src/utility.hpp:
2216 removed stream-based constructor of SubfontException
2217
2218 2017-09-29 Martin Gieseking <martin.gieseking@uos.de>
2219
2220 * doc/dvisvgm.txt.in, src/PapersizeSpecialHandler.cpp,
2221 src/PapersizeSpecialHandler.hpp, src/PdfSpecialHandler.cpp,
2222 src/PdfSpecialHandler.hpp, src/SpecialManager.cpp,
2223 src/SpecialManager.hpp, tests/PapersizeSpecialTest.cpp:
2224 added evaluation of pdf:pagesize specials
2225
2226 2017-09-28 Martin Gieseking <martin.gieseking@uos.de>
2227
2228 * src/DVIToSVG.cpp, src/Length.hpp, src/PageSize.cpp, src/PageSize.hpp,
2229 src/utility.hpp, tests/PageSizeTest.cpp:
2230 use class Length in PageSize rather than plain numbers
2231
2232 * src/BoundingBox.cpp, src/BoundingBox.hpp, src/DVIToSVG.cpp,
2233 src/utility.cpp, src/utility.hpp, tests/BoundingBoxTest.cpp,
2234 tests/UtilityTest.cpp:
2235 rewrite of BoundingBox::extractLengths()
2236
2237 2017-09-21 Martin Gieseking <martin.gieseking@uos.de>
2238
2239 * src/TpicSpecialHandler.cpp:
2240 use isxdigit() to check hex digits
2241
2242 * src/InputReader.cpp, src/InputReader.hpp, tests/Makefile.am,
2243 tests/SplittedCharInputBufferTest.cpp, tests/StreamInputBufferTest.cpp,
2244 tests/StringMatcherTest.cpp:
2245 use Knuth-Morris-Pratt algorithm to find a string in a stream
2246
2247 * libs/woff2/brotli/common/constants.h,
2248 libs/woff2/brotli/common/dictionary.c,
2249 libs/woff2/brotli/common/dictionary.h,
2250 libs/woff2/brotli/common/version.h,
2251 libs/woff2/brotli/enc/backward_references.c,
2252 libs/woff2/brotli/enc/backward_references_hq.c,
2253 libs/woff2/brotli/enc/backward_references_hq.h,
2254 libs/woff2/brotli/enc/backward_references_inc.h,
2255 libs/woff2/brotli/enc/block_splitter.c,
2256 libs/woff2/brotli/enc/block_splitter_inc.h,
2257 libs/woff2/brotli/enc/brotli_bit_stream.c,
2258 libs/woff2/brotli/enc/brotli_bit_stream.h,
2259 libs/woff2/brotli/enc/cluster_inc.h, libs/woff2/brotli/enc/command.h,
2260 libs/woff2/brotli/enc/compress_fragment.c,
2261 libs/woff2/brotli/enc/compress_fragment_two_pass.c,
2262 libs/woff2/brotli/enc/encode.c,
2263 libs/woff2/brotli/enc/find_match_length.h, libs/woff2/brotli/enc/hash.h,
2264 libs/woff2/brotli/enc/hash_forgetful_chain_inc.h,
2265 libs/woff2/brotli/enc/hash_longest_match64_inc.h,
2266 libs/woff2/brotli/enc/hash_longest_match_inc.h,
2267 libs/woff2/brotli/enc/hash_longest_match_quickly_inc.h,
2268 libs/woff2/brotli/enc/hash_to_binary_tree_inc.h,
2269 libs/woff2/brotli/enc/memory.h, libs/woff2/brotli/enc/port.h,
2270 libs/woff2/brotli/enc/write_bits.h,
2271 libs/woff2/brotli/include/brotli/decode.h,
2272 libs/woff2/brotli/include/brotli/encode.h:
2273 updated Brotli to version 1.0.1
2274
2275 2017-09-15 Martin Gieseking <martin.gieseking@uos.de>
2276
2277 * src/DVIToSVG.cpp, src/SpecialManager.cpp, src/SpecialManager.hpp,
2278 src/utility.hpp, tests/Makefile.am, tests/SpecialManagerTest.cpp:
2279 use smart pointers to allocate/deallocate SpecialHandlers
2280
2281 * src/BgColorSpecialHandler.cpp, src/BgColorSpecialHandler.hpp,
2282 src/ColorSpecialHandler.cpp, src/ColorSpecialHandler.hpp,
2283 src/DvisvgmSpecialHandler.cpp, src/DvisvgmSpecialHandler.hpp,
2284 src/EmSpecialHandler.cpp, src/EmSpecialHandler.hpp,
2285 src/HtmlSpecialHandler.cpp, src/HtmlSpecialHandler.hpp,
2286 src/NoPsSpecialHandler.cpp, src/NoPsSpecialHandler.hpp,
2287 src/PapersizeSpecialHandler.cpp, src/PapersizeSpecialHandler.hpp,
2288 src/PdfSpecialHandler.cpp, src/PdfSpecialHandler.hpp,
2289 src/PsSpecialHandler.cpp, src/PsSpecialHandler.hpp,
2290 src/SpecialHandler.hpp, src/SpecialManager.cpp,
2291 src/TpicSpecialHandler.cpp, src/TpicSpecialHandler.hpp,
2292 tests/ColorSpecialTest.cpp, tests/PapersizeSpecialTest.cpp:
2293 changed return value of SpecialHandler::prefixes() to std::vector
2294
2295 * .appveyor.yml:
2296 AppVeyor: updated FreeType to version 2.8.1
2297
2298 2017-09-13 Martin Gieseking <martin.gieseking@uos.de>
2299
2300 * tests/FileSystemTest.cpp:
2301 close streams before removing corresponding files
2302
2303 2017-09-09 Martin Gieseking <martin.gieseking@uos.de>
2304
2305 * src/dvisvgm.cpp:
2306 fixed number of dashes printed by option -V1
2307
2308 2017-09-08 Martin Gieseking <martin.gieseking@uos.de>
2309
2310 * src/DependencyGraph.hpp, src/SVGTree.cpp, tests/DependencyGraphTest.cpp:
2311 DependencyGraph::getKeys(): return result, don't use reference parameter
2312
2313 * src/FileFinder.cpp, src/Makefile.am:
2314 added missing #include; added windows.hpp to Makefile.am
2315
2316 * tests/Makefile.am, tests/create-makefile, tests/testmain.cpp:
2317 define variable TEST_ARGV0 to make argv[0] of main() available in
2318 tests
2319 this is required to initialize kpathsea properly, for example
2320
2321 * src/FileFinder.cpp, src/FileFinder.hpp, tests/CMapManagerTest.cpp,
2322 tests/FileFinderTest.cpp, tests/FontManagerTest.cpp,
2323 tests/MapLineTest.cpp, tests/SubfontTest.cpp:
2324 init libkpathsea correctly in tests to prevent assertion failures
2325
2326 * libs/xxHash/xxhash.c, libs/xxHash/xxhash.h:
2327 updated xxHash to version 0.6.3
2328
2329 2017-09-07 Martin Gieseking <martin.gieseking@uos.de>
2330
2331 * tests/FontCacheTest.cpp, tests/Makefile.am, tests/create-makefile:
2332 fixed path issue in FontCacheTest
2333
2334 * src/GFReader.cpp:
2335 fixed incorrect integer type in GFReader; insert CharInfos with emplace
2336
2337 * src/MapLine.cpp, tests/MapLineTest.cpp:
2338 treat prefix "<<" in a mapline as "<[" (skip second char)
2339
2340 * doc/dvisvgm.txt.in, src/dvisvgm.cpp:
2341 added pdftex.map to default mapfiles
2342
2343 2017-09-06 Martin Gieseking <martin.gieseking@uos.de>
2344
2345 * src/BasicDVIReader.cpp, src/BgColorSpecialHandler.cpp, src/Bitmap.cpp,
2346 src/BoundingBox.cpp, src/CMap.cpp, src/CMapReader.cpp, src/CRC32.cpp,
2347 src/Calculator.cpp, src/ColorSpecialHandler.cpp, src/DLLoader.cpp,
2348 src/DVIReader.cpp, src/Directory.cpp, src/EPSFile.cpp, src/EPSToSVG.cpp,
2349 src/EmSpecialHandler.cpp, src/EncFile.cpp, src/FileFinder.cpp,
2350 src/FilePath.cpp, src/Font.cpp, src/FontCache.cpp, src/FontEncoding.cpp,
2351 src/FontEngine.cpp, src/FontManager.cpp, src/FontMap.cpp,
2352 src/FontMap.hpp, src/FontMetrics.cpp, src/FontWriter.cpp,
2353 src/GFGlyphTracer.cpp, src/GFTracer.cpp, src/HtmlSpecialHandler.cpp,
2354 src/InputBuffer.cpp, src/InputReader.cpp, src/JFM.cpp, src/MapLine.cpp,
2355 src/Message.cpp, src/MetafontWrapper.cpp, src/MiKTeXCom.cpp,
2356 src/NoPsSpecialHandler.cpp, src/PSInterpreter.cpp, src/PSPattern.cpp,
2357 src/PSPreviewFilter.cpp, src/PageRanges.cpp, src/PageSize.cpp,
2358 src/PathClipper.cpp, src/PdfSpecialHandler.cpp, src/SVGTree.cpp,
2359 src/SpecialManager.cpp, src/StreamWriter.cpp, src/TFM.cpp,
2360 src/VFReader.cpp, src/XMLDocument.cpp, src/XMLNode.cpp,
2361 src/XMLString.cpp, src/dvisvgm.cpp:
2362 removed redundant #includes of config.h
2363
2364 * src/DLLoader.hpp, src/Directory.cpp, src/Directory.hpp,
2365 src/FileSystem.cpp, src/MiKTeXCom.hpp, src/Process.cpp, src/Terminal.cpp,
2366 src/windows.hpp:
2367 disable macros min/max defined in windows.h
2368
2369 * src/CLCommandLine.cpp, src/CMapManager.cpp, src/CMapManager.hpp,
2370 src/Calculator.cpp, src/Calculator.hpp, src/DVIToSVG.cpp,
2371 src/DVIToSVGActions.hpp, src/DependencyGraph.hpp,
2372 src/DvisvgmSpecialHandler.cpp, src/DvisvgmSpecialHandler.hpp,
2373 src/EmSpecialHandler.cpp, src/EmSpecialHandler.hpp, src/FileFinder.cpp,
2374 src/Font.cpp, src/Font.hpp, src/FontCache.hpp, src/FontEncoding.cpp,
2375 src/FontManager.cpp, src/FontManager.hpp, src/FontMap.hpp,
2376 src/GFReader.hpp, src/HtmlSpecialHandler.cpp, src/HtmlSpecialHandler.hpp,
2377 src/InputReader.cpp, src/InputReader.hpp, src/Message.cpp,
2378 src/PsSpecialHandler.cpp, src/PsSpecialHandler.hpp, src/SVGTree.cpp,
2379 src/SVGTree.hpp, src/SpecialManager.hpp, src/Subfont.cpp,
2380 src/Subfont.hpp, tests/StreamInputBufferTest.cpp:
2381 replaced std::map with std::unordered_map where possible to increase
2382 performance
2383
2384 2017-09-05 Martin Gieseking <martin.gieseking@uos.de>
2385
2386 * tests/DvisvgmSpecialTest.cpp:
2387 replaced constexpr with const to make clang happy
2388
2389 * doc/dvisvgm.txt.in, src/DvisvgmSpecialHandler.cpp,
2390 tests/DvisvgmSpecialTest.cpp:
2391 allow all common length units in dvisvgm specials
2392
2393 2017-08-27 Martin Gieseking <martin.gieseking@uos.de>
2394
2395 * src/AGLTable.hpp, src/CMapReader.cpp, src/Color.cpp,
2396 src/CommandLine.hpp, src/FontWriter.cpp, tests/genhashcheck.py:
2397 use list initialization on constant std::arrays
2398
2399 * tests/MapLineTest.cpp:
2400 added braces to prevent compiler warnings
2401
2402 2017-08-25 Martin Gieseking <martin.gieseking@uos.de>
2403
2404 * src/CMapManager.cpp, src/DvisvgmSpecialHandler.cpp, src/Font.cpp,
2405 src/Ghostscript.cpp, src/PsSpecialHandler.cpp, src/dvisvgm.cpp,
2406 tests/DvisvgmSpecialTest.cpp:
2407 use range-based for to iterate over a fixed sequence of items
2408
2409 2017-08-17 Martin Gieseking <martin.gieseking@uos.de>
2410
2411 * m4/ax_code_coverage.m4:
2412 updated ax_code_coverage.m4 to version 25
2413
2414 2017-08-06 Martin Gieseking <martin.gieseking@uos.de>
2415
2416 * .appveyor.yml:
2417 AppVeyor: updated potrace to version 1.15
2418
2419 2017-08-01 Martin Gieseking <martin.gieseking@uos.de>
2420
2421 * libs/woff2/src/font.cc, libs/woff2/src/normalize.cc,
2422 libs/woff2/src/port.h, libs/woff2/src/store_bytes.h,
2423 libs/woff2/src/woff2_common.cc, libs/woff2/src/woff2_enc.cc:
2424 updated woff2 to https://github.com/google/woff2/commits/2e09253
2425
2426 2017-06-26 Martin Gieseking <martin.gieseking@uos.de>
2427
2428 * .appveyor.yml:
2429 AppVeyor: changed build image to VS 2017; updated FreeType to 2.8
2430
2431 2017-06-20 Martin Gieseking <martin.gieseking@uos.de>
2432
2433 * src/PsSpecialHandler.cpp:
2434 psfile: fixed sign of y coordinates
2435
2436 2017-06-12 Martin Gieseking <martin.gieseking@uos.de>
2437
2438 * src/PsSpecialHandler.hpp:
2439 use bp units for line width and miter limit
2440
2441 2017-06-09 Martin Gieseking <martin.gieseking@uos.de>
2442
2443 * src/EPSToSVG.cpp:
2444 remove redundant clipPath elements also when converting EPS files
2445
2446 2017-05-30 Martin Gieseking <martin.gieseking@uos.de>
2447
2448 * src/GraphicsPath.hpp:
2449 replaced vector with deque in class GraphicsPath
2450 due to cheaper front
2451 insertions/deletions
2452
2453 * src/PsSpecialHandler.cpp, src/PsSpecialHandler.hpp:
2454 manage memory of ClippingStack with shared pointers
2455 - automatically
2456 deletes unreferenced path objects
2457 - avoids keeping popped (and no longer
2458 required) paths in the pool vector
2459
2460 2017-05-26 Martin Gieseking <martin.gieseking@uos.de>
2461
2462 * src/Pair.hpp, tests/PairTest.cpp:
2463 added abs() and negation operator to class Pair
2464
2465 * src/Matrix.hpp, src/PsSpecialHandler.cpp:
2466 respect transformation of PS state in computation of psfile position
2467 (fixes #70)
2468
2469 * src/FileFinder.cpp, src/PsSpecialHandler.cpp:
2470 lookup psfile in texmf tree if it's not present in cwd (fixes #69)
2471
2472 2017-05-16 Martin Gieseking <martin.gieseking@uos.de>
2473
2474 * tests/FontCacheTest.cpp, tests/Makefile.am, tests/create-makefile:
2475 FontCacheTest: write test output to $builddir/data
2476 $srcdir/data may be
2477 read-only so that the tests fail unintentionally
2478
2479 2017-05-15 Martin Gieseking <martin.gieseking@uos.de>
2480
2481 * libs/woff2/brotli/LICENSE, libs/woff2/brotli/Makefile.am,
2482 libs/woff2/brotli/common/constants.h,
2483 libs/woff2/brotli/common/dictionary.c,
2484 libs/woff2/brotli/common/dictionary.h,
2485 libs/woff2/brotli/common/version.h,
2486 libs/woff2/brotli/enc/backward_references.c,
2487 libs/woff2/brotli/enc/backward_references.h,
2488 libs/woff2/brotli/enc/backward_references_hq.c,
2489 libs/woff2/brotli/enc/backward_references_hq.h,
2490 libs/woff2/brotli/enc/backward_references_inc.h,
2491 libs/woff2/brotli/enc/block_splitter_inc.h,
2492 libs/woff2/brotli/enc/command.h,
2493 libs/woff2/brotli/enc/compress_fragment.c,
2494 libs/woff2/brotli/enc/compress_fragment.h,
2495 libs/woff2/brotli/enc/compress_fragment_two_pass.c,
2496 libs/woff2/brotli/enc/compress_fragment_two_pass.h,
2497 libs/woff2/brotli/enc/context.h, libs/woff2/brotli/enc/dictionary_hash.c,
2498 libs/woff2/brotli/enc/dictionary_hash.h, libs/woff2/brotli/enc/encode.c,
2499 libs/woff2/brotli/enc/fast_log.h, libs/woff2/brotli/enc/hash.h,
2500 libs/woff2/brotli/enc/hash_forgetful_chain_inc.h,
2501 libs/woff2/brotli/enc/hash_longest_match64_inc.h,
2502 libs/woff2/brotli/enc/hash_longest_match_inc.h,
2503 libs/woff2/brotli/enc/hash_longest_match_quickly_inc.h,
2504 libs/woff2/brotli/enc/hash_to_binary_tree_inc.h,
2505 libs/woff2/brotli/enc/histogram.c, libs/woff2/brotli/enc/literal_cost.c,
2506 libs/woff2/brotli/enc/memory.h, libs/woff2/brotli/enc/metablock.c,
2507 libs/woff2/brotli/enc/metablock.h, libs/woff2/brotli/enc/quality.h,
2508 libs/woff2/brotli/enc/static_dict.c, libs/woff2/brotli/enc/static_dict.h,
2509 libs/woff2/brotli/include/brotli/decode.h,
2510 libs/woff2/brotli/include/brotli/encode.h,
2511 libs/woff2/brotli/include/brotli/port.h,
2512 libs/woff2/brotli/include/brotli/types.h:
2513 updated brotli to version 0.6.0
2514
2515 2017-05-11 Martin Gieseking <martin.gieseking@uos.de>
2516
2517 * src/Process.cpp:
2518 close pipe if fork() fails
2519
2520 2017-05-08 Martin Gieseking <martin.gieseking@uos.de>
2521
2522 * configure.ac, src/SignalHandler.cpp, src/SignalHandler.hpp:
2523 use sigaction() rather than signal() if possible
2524
2525 * src/Process.cpp, src/Process.hpp:
2526 refactored Process class
2527 - use separate class to encapsulate
2528 system-dependent stuff and to ensure
2529 proper termination in case of
2530 signals or errors
2531 - prevent blocking if subprocess doesn't write anything
2532 to stdout/stderr
2533
2534 2017-04-28 Martin Gieseking <martin.gieseking@uos.de>
2535
2536 * src/Process.cpp:
2537 quit Process::run() if child process terminated unexpectedly (fixes #68)
2538
2539 2017-04-27 Martin Gieseking <martin.gieseking@uos.de>
2540
2541 * tests/Makefile.am, tests/create-makefile:
2542 added the FontWriter dependencies to the tests
2543
2544 2017-04-24 Martin Gieseking <martin.gieseking@uos.de>
2545
2546 * src/Color.cpp, src/Color.hpp, src/PSPattern.cpp,
2547 tests/ColorSpecialTest.cpp:
2548 avoid implicit conversion of Color object to RGB integer
2549
2550 * src/TpicSpecialHandler.cpp, src/TpicSpecialHandler.hpp,
2551 tests/Makefile.am, tests/TpicSpecialTest.cpp:
2552 improved the TPIC special handler and added tests for it
2553
2554 * src/TpicSpecialHandler.cpp, tests/TpicSpecialTest.cpp:
2555 added evaluation of TPIC's 'tx' special command
2556
2557 2017-04-23 Martin Gieseking <martin.gieseking@uos.de>
2558
2559 * src/BasicDVIReader.hpp, src/BgColorSpecialHandler.hpp,
2560 src/CLCommandLine.hpp, src/CMapManager.hpp, src/DVIToSVGActions.hpp,
2561 src/DependencyGraph.hpp, src/DvisvgmSpecialHandler.hpp, src/FilePath.hpp,
2562 src/Font.hpp, src/FontCache.cpp, src/FontCache.hpp, src/FontEngine.cpp,
2563 src/FontManager.hpp, src/Ghostscript.hpp, src/Glyph.hpp,
2564 src/GraphicsPath.hpp, src/HtmlSpecialHandler.hpp, src/NumericRanges.hpp,
2565 src/PapersizeSpecialHandler.cpp, src/PapersizeSpecialHandler.hpp,
2566 src/PathClipper.cpp, src/PathClipper.hpp, src/PsSpecialHandler.hpp,
2567 src/RangeMap.hpp, src/SVGCharPathHandler.hpp, src/ShadingPatch.hpp,
2568 src/SpecialManager.hpp, src/Subfont.hpp, src/VFReader.hpp,
2569 src/XMLNode.cpp, src/XMLNode.hpp, src/dvisvgm.cpp:
2570 replaced typedefs with 'using' statements
2571
2572 2017-04-20 Martin Gieseking <martin.gieseking@uos.de>
2573
2574 * src/Ghostscript.cpp:
2575 simplify code for looking up libgs (closes #66)
2576
2577 2017-04-14 Martin Gieseking <martin.gieseking@uos.de>
2578
2579 * src/DLLoader.cpp, src/DLLoader.hpp:
2580 added DLLoader::loadLibrary() to assign a different library
2581
2582 * src/DLLoader.cpp, src/DLLoader.hpp, src/Ghostscript.cpp:
2583 replaced c-string parameters of DLLoader() and loadLibrary() with
2584 std::string
2585
2586 2017-04-13 Toby Fleming <tobywf@users.noreply.github.com>
2587
2588 * src/Ghostscript.cpp:
2589 Auto-detect ghostscript dynamic library on macOS
2590
2591 2017-03-22 Martin Gieseking <martin.gieseking@uos.de>
2592
2593 * m4/ax_code_coverage.m4, m4/ax_cxx_compile_stdcxx.m4:
2594 updated m4 scripts
2595
2596 2017-03-03 Martin Gieseking <martin.gieseking@uos.de>
2597
2598 * src/FileFinder.cpp, tests/FileFinderTest.cpp:
2599 fixed handling of absolute additional directories in FileFinder
2600
2601 * tests/FilePathTest.cpp, tests/FontCacheTest.cpp,
2602 tests/SVGOutputTest.cpp:
2603 tests: minor path improvements
2604
2605 2017-03-02 Martin Gieseking <martin.gieseking@uos.de>
2606
2607 * libs/woff2/src/normalize.cc, libs/woff2/src/woff2_enc.cc:
2608 woff2: removed unused variables
2609
2610 * src/Makefile.am, src/dvisvgm.cpp:
2611 improved generation of list showing the library versions
2612
2613 * src/Color.cpp, src/FilePath.cpp, src/FontWriter.cpp, src/PageSize.cpp,
2614 src/dvisvgm.cpp, src/utility.cpp, src/utility.hpp, tests/UtilityTest.cpp:
2615 removed side-effect from util::to_lower(); returns new modified string
2616 instead
2617
2618 2017-03-01 Martin Gieseking <martin.gieseking@uos.de>
2619
2620 * libs/ff-woff/fontforge/nowakowskittfinstr.c:
2621 ff-woff: removed redundant variables
2622
2623 * libs/woff2/Makefile.am, libs/woff2/brotli/Makefile.am,
2624 libs/woff2/brotli/common/constants.h,
2625 libs/woff2/brotli/common/dictionary.c,
2626 libs/woff2/brotli/common/dictionary.h,
2627 libs/woff2/brotli/common/version.h,
2628 libs/woff2/brotli/enc/backward_references.c,
2629 libs/woff2/brotli/enc/backward_references.cc,
2630 libs/woff2/brotli/enc/backward_references.h,
2631 libs/woff2/brotli/enc/backward_references_inc.h,
2632 libs/woff2/brotli/enc/bit_cost.c, libs/woff2/brotli/enc/bit_cost.h,
2633 libs/woff2/brotli/enc/bit_cost_inc.h,
2634 libs/woff2/brotli/enc/block_encoder_inc.h,
2635 libs/woff2/brotli/enc/block_splitter.c,
2636 libs/woff2/brotli/enc/block_splitter.cc,
2637 libs/woff2/brotli/enc/block_splitter.h,
2638 libs/woff2/brotli/enc/block_splitter_inc.h,
2639 libs/woff2/brotli/enc/brotli_bit_stream.c,
2640 libs/woff2/brotli/enc/brotli_bit_stream.cc,
2641 libs/woff2/brotli/enc/brotli_bit_stream.h,
2642 libs/woff2/brotli/enc/cluster.c, libs/woff2/brotli/enc/cluster.h,
2643 libs/woff2/brotli/enc/cluster_inc.h, libs/woff2/brotli/enc/command.h,
2644 libs/woff2/brotli/enc/compress_fragment.c,
2645 libs/woff2/brotli/enc/compress_fragment.cc,
2646 libs/woff2/brotli/enc/compress_fragment.h,
2647 libs/woff2/brotli/enc/compress_fragment_two_pass.c,
2648 libs/woff2/brotli/enc/compress_fragment_two_pass.cc,
2649 libs/woff2/brotli/enc/compress_fragment_two_pass.h,
2650 libs/woff2/brotli/enc/compressor.h, libs/woff2/brotli/enc/context.h,
2651 libs/woff2/brotli/enc/dictionary.cc, libs/woff2/brotli/enc/dictionary.h,
2652 libs/woff2/brotli/enc/dictionary_hash.h, libs/woff2/brotli/enc/encode.c,
2653 libs/woff2/brotli/enc/encode.cc, libs/woff2/brotli/enc/encode.h,
2654 libs/woff2/brotli/enc/encode_parallel.cc,
2655 libs/woff2/brotli/enc/encode_parallel.h,
2656 libs/woff2/brotli/enc/entropy_encode.c,
2657 libs/woff2/brotli/enc/entropy_encode.cc,
2658 libs/woff2/brotli/enc/entropy_encode.h,
2659 libs/woff2/brotli/enc/entropy_encode_static.h,
2660 libs/woff2/brotli/enc/fast_log.h,
2661 libs/woff2/brotli/enc/find_match_length.h, libs/woff2/brotli/enc/hash.h,
2662 libs/woff2/brotli/enc/hash_forgetful_chain_inc.h,
2663 libs/woff2/brotli/enc/hash_longest_match_inc.h,
2664 libs/woff2/brotli/enc/hash_longest_match_quickly_inc.h,
2665 libs/woff2/brotli/enc/histogram.c, libs/woff2/brotli/enc/histogram.cc,
2666 libs/woff2/brotli/enc/histogram.h, libs/woff2/brotli/enc/histogram_inc.h,
2667 libs/woff2/brotli/enc/literal_cost.c,
2668 libs/woff2/brotli/enc/literal_cost.cc,
2669 libs/woff2/brotli/enc/literal_cost.h, libs/woff2/brotli/enc/memory.c,
2670 libs/woff2/brotli/enc/memory.h, libs/woff2/brotli/enc/metablock.c,
2671 libs/woff2/brotli/enc/metablock.cc, libs/woff2/brotli/enc/metablock.h,
2672 libs/woff2/brotli/enc/metablock_inc.h, libs/woff2/brotli/enc/port.h,
2673 libs/woff2/brotli/enc/prefix.h, libs/woff2/brotli/enc/quality.h,
2674 libs/woff2/brotli/enc/ringbuffer.h, libs/woff2/brotli/enc/static_dict.c,
2675 libs/woff2/brotli/enc/static_dict.cc,
2676 libs/woff2/brotli/enc/static_dict.h,
2677 libs/woff2/brotli/enc/static_dict_lut.h,
2678 libs/woff2/brotli/enc/streams.cc, libs/woff2/brotli/enc/streams.h,
2679 libs/woff2/brotli/enc/transform.h, libs/woff2/brotli/enc/types.h,
2680 libs/woff2/brotli/enc/utf8_util.c, libs/woff2/brotli/enc/utf8_util.cc,
2681 libs/woff2/brotli/enc/utf8_util.h, libs/woff2/brotli/enc/write_bits.h,
2682 libs/woff2/brotli/include/brotli/decode.h,
2683 libs/woff2/brotli/include/brotli/encode.h,
2684 libs/woff2/brotli/include/brotli/port.h,
2685 libs/woff2/brotli/include/brotli/types.h, libs/woff2/src/buffer.h,
2686 libs/woff2/src/font.cc, libs/woff2/src/glyph.cc,
2687 libs/woff2/src/variable_length.cc, libs/woff2/src/woff2_dec.h,
2688 libs/woff2/src/woff2_enc.cc, src/Makefile.am:
2689 updated woff2 to https://github.com/google/woff2/commit/68e9ab5
2690
2691 2017-02-23 Martin Gieseking <martin.gieseking@uos.de>
2692
2693 * tests/BezierTest.cpp, tests/BitmapTest.cpp, tests/BoundingBoxTest.cpp,
2694 tests/CMapManagerTest.cpp, tests/CMapReaderTest.cpp, tests/CMapTest.cpp,
2695 tests/CRC32Test.cpp, tests/ColorTest.cpp, tests/CommandLineTest.cpp,
2696 tests/DirectoryTest.cpp, tests/FileSystemTest.cpp,
2697 tests/GraphicsPathTest.cpp, tests/JFMReaderTest.cpp,
2698 tests/MatrixTest.cpp, tests/PageRagesTest.cpp, tests/RangeMapTest.cpp,
2699 tests/SVGOutputTest.cpp, tests/SplittedCharInputBufferTest.cpp,
2700 tests/StreamInputBufferTest.cpp, tests/StreamReaderTest.cpp,
2701 tests/StreamWriterTest.cpp, tests/SubfontTest.cpp,
2702 tests/TFMReaderTest.cpp, tests/ToUnicodeMapTest.cpp,
2703 tests/UnicodeTest.cpp, tests/VectorIteratorTest.cpp,
2704 tests/XMLNodeTest.cpp:
2705 fixed signed/unsigned warnings in tests
2706
2707 2017-02-22 Martin Gieseking <martin.gieseking@uos.de>
2708
2709 * libs/woff2/brotli/tools/bro.cc, libs/woff2/brotli/tools/rfc-format.py,
2710 libs/woff2/brotli/tools/version.h:
2711 removed redundant files
2712
2713 2017-02-20 Martin Gieseking <martin.gieseking@uos.de>
2714
2715 * .appveyor.yml, .travis.yml, configure.ac, src/Doxyfile, src/version.hpp:
2716 set version to 2.1.3
2717
2718 * NEWS:
2719 updated NEWS
2720
2721 2017-02-18 Martin Gieseking <martin.gieseking@uos.de>
2722
2723 * libs/ff-woff/inc/ffintl.h:
2724 ff-woff: removed redundant defines and prototypes to fix build failure
2725 on Solaris
2726
2727 * tests/genhashcheck.py:
2728 reformatted genhashcheck
2729
2730 * tests/BezierTest.cpp, tests/CRC32Test.cpp, tests/ToUnicodeMapTest.cpp,
2731 tests/UnicodeTest.cpp, tests/VectorIteratorTest.cpp,
2732 tests/XMLNodeTest.cpp:
2733 minor additions to some tests
2734
2735 2017-02-15 Martin Gieseking <martin.gieseking@uos.de>
2736
2737 * configure.ac, libs/ff-woff/Makefile.am,
2738 libs/ff-woff/fontforge/fflocale.c, libs/ff-woff/fontforge/fflocale.h,
2739 libs/ff-woff/fontforge/sfd.c, libs/ff-woff/fontforge/splinefont.h,
2740 libs/ff-woff/fontforge/tottf.c:
2741 ff-woff: only call uselocale() if present, use setlocale() otherwise
2742
2743 2017-02-14 Martin Gieseking <martin.gieseking@uos.de>
2744
2745 * README, README.md:
2746 added information on required C++11 compiler to README
2747
2748 * tests/genhashcheck.py:
2749 made genhashcheck.py compatible with Python 3 (plus few minor changes)
2750
2751 2017-02-13 Martin Gieseking <martin.gieseking@uos.de>
2752
2753 * src/MapLine.cpp, src/MapLine.hpp, tests/ColorSpecialTest.cpp,
2754 tests/FontMapTest.cpp, tests/LengthTest.cpp, tests/MapLineTest.cpp:
2755 improved a couple of test cases
2756
2757 * src/Color.cpp, src/Matrix.cpp, src/TpicSpecialHandler.cpp,
2758 src/utility.hpp:
2759 replaced non-standard constant M_PI with own definition
2760
2761 * src/Color.cpp, src/Matrix.cpp, src/utility.hpp:
2762 replaced local copies of deg2rad with global function
2763
2764 2017-02-12 Martin Gieseking <martin.gieseking@uos.de>
2765
2766 * .appveyor.yml, .travis.yml, appveyor.yml:
2767 exclude branch 'tmp' from CI builds
2768
2769 2017-02-11 Martin Gieseking <martin.gieseking@uos.de>
2770
2771 * libs/ff-woff/Makefile.am, libs/ff-woff/fontforge/fontforge.h,
2772 libs/ff-woff/inc/ffintl.h, libs/ff-woff/inc/intl.h:
2773 don't try to #include libintl.h
2774
2775 * .travis.yml:
2776 Travis: enable clang builds again
2777
2778 * NEWS:
2779 updated NEWS
2780
2781 2017-02-10 Martin Gieseking <martin.gieseking@uos.de>
2782
2783 * src/Calculator.cpp:
2784 fixed number parsing in Calculator class (failed on Mac)
2785
2786 * tests/StreamReaderTest.cpp:
2787 clear istream flags to prevent failure of StreamReaderTest
2788
2789 * libs/xxHash/xxhash.c, libs/xxHash/xxhash.h:
2790 removed 'restrict' keyword from xxHash
2791
2792 * .travis.yml, appveyor.yml, configure.ac, src/Doxyfile, src/version.hpp:
2793 set version to 2.1.2
2794
2795 2017-02-09 Martin Gieseking <martin.gieseking@uos.de>
2796
2797 * .gitignore, .travis.yml, Makefile.am, configure.ac, tests/Makefile.am,
2798 tests/create-makefile, tests/gtest/LICENSE,
2799 tests/gtest/include/gtest/gtest-death-test.h,
2800 tests/gtest/include/gtest/gtest-message.h,
2801 tests/gtest/include/gtest/gtest-param-test.h,
2802 tests/gtest/include/gtest/gtest-printers.h,
2803 tests/gtest/include/gtest/gtest-spi.h,
2804 tests/gtest/include/gtest/gtest-test-part.h,
2805 tests/gtest/include/gtest/gtest-typed-test.h,
2806 tests/gtest/include/gtest/gtest.h,
2807 tests/gtest/include/gtest/gtest_pred_impl.h,
2808 tests/gtest/include/gtest/gtest_prod.h,
2809 tests/gtest/include/gtest/internal/custom/gtest-port.h,
2810 tests/gtest/include/gtest/internal/custom/gtest-printers.h,
2811 tests/gtest/include/gtest/internal/custom/gtest.h,
2812 tests/gtest/include/gtest/internal/gtest-death-test-internal.h,
2813 tests/gtest/include/gtest/internal/gtest-filepath.h,
2814 tests/gtest/include/gtest/internal/gtest-internal.h,
2815 tests/gtest/include/gtest/internal/gtest-linked_ptr.h,
2816 tests/gtest/include/gtest/internal/gtest-param-util-generated.h,
2817 tests/gtest/include/gtest/internal/gtest-param-util.h,
2818 tests/gtest/include/gtest/internal/gtest-port-arch.h,
2819 tests/gtest/include/gtest/internal/gtest-port.h,
2820 tests/gtest/include/gtest/internal/gtest-string.h,
2821 tests/gtest/include/gtest/internal/gtest-tuple.h,
2822 tests/gtest/include/gtest/internal/gtest-type-util.h,
2823 tests/gtest/src/gtest-all.cc, tests/gtest/src/gtest-death-test.cc,
2824 tests/gtest/src/gtest-filepath.cc, tests/gtest/src/gtest-internal-inl.h,
2825 tests/gtest/src/gtest-port.cc, tests/gtest/src/gtest-printers.cc,
2826 tests/gtest/src/gtest-test-part.cc, tests/gtest/src/gtest-typed-test.cc,
2827 tests/gtest/src/gtest.cc, tests/gtest/src/gtest_main.cc:
2828 bundle gtest with the sources to simplify building and running the tests
2829
2830 * src/Directory.cpp, tests/DirectoryTest.cpp:
2831 prevent calling closedir() with null pointer argument
2832
2833 * src/VectorStream.hpp:
2834 don't access first vector component if the vector is empty
2835
2836 * src/GFReader.cpp, src/StreamReader.cpp, tests/GFReaderTest.cpp,
2837 tests/StreamReaderTest.cpp:
2838 improved implementation of getString()
2839
2840 * src/CLCommandLine.cpp:
2841 reset status flags before changing the sstream source
2842
2843 2017-02-08 Martin Gieseking <martin.gieseking@uos.de>
2844
2845 * tests/CommandLineTest.cpp:
2846 removed redundant function
2847
2848 * src/XMLString.cpp, tests/EmSpecialTest.cpp, tests/GFGlyphTracerTest.cpp:
2849 avoid negative zeros (-0) in SVG output
2850
2851 * src/BoundingBox.cpp:
2852 fixed memory issue in BoundingBox class
2853
2854 * src/CMapReader.cpp, src/InputReader.cpp, src/InputReader.hpp,
2855 tests/SplittedCharInputBufferTest.cpp, tests/StreamInputBufferTest.cpp:
2856 fixed potential number overflow issue
2857
2858 * tests/CMapReaderTest.cpp:
2859 fixed memory leak in CMapReaderTest
2860
2861 * src/Subfont.cpp:
2862 fixed memory leak in Subfont class
2863
2864 * src/XMLNode.cpp:
2865 fixed memory leak in class XMLElementNode
2866
2867 2017-02-07 Martin Gieseking <martin.gieseking@uos.de>
2868
2869 * configure.ac:
2870 replaced deprecated AC_CONFIG_HEADER
2871
2872 * NEWS:
2873 updated NEWS
2874
2875 * libs/clipper/License.txt:
2876 fixed line endings of clipper/License.txt
2877
2878 2017-02-06 Martin Gieseking <martin.gieseking@uos.de>
2879
2880 * .travis.yml, appveyor.yml, configure.ac, src/Doxyfile, src/version.hpp:
2881 set version to 2.1.1
2882
2883 2017-02-04 Martin Gieseking <martin.gieseking@uos.de>
2884
2885 * tests/FontCacheTest.cpp:
2886 fixed FontCacheTest ('make distcheck' failed)
2887
2888 2017-02-03 Martin Gieseking <martin.gieseking@uos.de>
2889
2890 * src/Color.cpp, src/Color.hpp, src/VectorIterator.hpp,
2891 tests/ColorTest.cpp, tests/VectorIteratorTest.cpp:
2892 increased coverage of ColorTest
2893
2894 * configure.ac, libs/ff-woff/fontforge/splinefont.h:
2895 include xlocale.h in ff-woff if available (fixes #65)
2896
2897 2017-02-02 Martin Gieseking <martin.gieseking@uos.de>
2898
2899 * src/Makefile.am:
2900 removed spurious colon from src/Makefile.am
2901
2902 * configure.ac:
2903 allow C++11 language extensions if necessary
2904
2905 * src/Font.cpp, src/Font.hpp:
2906 report Metafont failures only once for each font
2907
2908 2017-01-31 Martin Gieseking <martin.gieseking@uos.de>
2909
2910 * README, README.md:
2911 README: updated links, added release badge
2912
2913 2017-01-30 Martin Gieseking <martin.gieseking@uos.de>
2914
2915 * tests/FontManagerTest.cpp, tests/data/cmr10.pfb:
2916 prevent FontManagerTest to fail due to missing font files
2917
2918 2017-01-26 Martin Gieseking <martin.gieseking@uos.de>
2919
2920 * src/Matrix.cpp, tests/MatrixTest.cpp:
2921 minor changes of matrix class; improved MatrixTest
2922
2923 2017-01-25 Martin Gieseking <martin.gieseking@uos.de>
2924
2925 * src/PapersizeSpecialHandler.cpp, src/PapersizeSpecialHandler.hpp,
2926 tests/Makefile.am, tests/PapersizeSpecialTest.cpp, tests/create-makefile:
2927 added PapersizeSpecialTest
2928
2929 * tests/CMapManagerTest.cpp, tests/CMapReaderTest.cpp,
2930 tests/DvisvgmSpecialTest.cpp, tests/EmSpecialTest.cpp,
2931 tests/FileFinderTest.cpp, tests/FontManagerTest.cpp,
2932 tests/JFMReaderTest.cpp, tests/MapLineTest.cpp, tests/SubfontTest.cpp,
2933 tests/TFMReaderTest.cpp, tests/TensorProductPatchTest.cpp:
2934 added 'override' specifier to gtest methods
2935
2936 * src/FontCache.cpp, src/FontCache.hpp, tests/FontCacheTest.cpp,
2937 tests/Makefile.am:
2938 added FontCacheTest
2939
2940 * tests/Makefile.am, tests/create-makefile:
2941 removed redundant linker flag from tests
2942
2943 * m4/ax_code_coverage.m4, m4/ax_cxx_compile_stdcxx.m4:
2944 updated m4 scripts to latest versions
2945
2946 2017-01-23 Martin Gieseking <martin.gieseking@uos.de>
2947
2948 * README.md, appveyor.yml:
2949 added basic appveyor.yml
2950
2951 2017-01-20 Martin Gieseking <martin.gieseking@uos.de>
2952
2953 * libs/ff-woff/Makefile.am, libs/ff-woff/fontforge/fontforge.h,
2954 libs/ff-woff/fontforge/tmpfile2.cpp, libs/ff-woff/fontforge/utils.c,
2955 src/dvisvgm.cpp:
2956 improved error handling of tmpfile2() in ff-woff
2957 The FontForge library
2958 doesn't check the return value of tmpfile() which may lead
2959 to segfaults.
2960 The replacement function tmpfile2() throws an exception or calls
2961 exit()
2962 so that dvisvgm can terminate more cleanly.
2963
2964 2017-01-18 Martin Gieseking <martin.gieseking@uos.de>
2965
2966 * src/BoundingBox.cpp, src/Color.cpp, src/DVIToSVGActions.cpp,
2967 src/FilePath.cpp, src/FileSystem.cpp, src/FontWriter.cpp,
2968 src/Makefile.am, src/PageSize.cpp, src/SVGOutput.cpp, src/utility.cpp,
2969 src/utility.hpp, tests/Makefile.am, tests/UtilityTest.cpp:
2970 moved common utility functions to separate compilation unit and
2971 namespace
2972
2973 * src/DVIToSVG.cpp, src/DVIToSVGActions.cpp, src/EPSToSVG.cpp:
2974 get program name and version from version.hpp, avoid using macros from
2975 config.h
2976
2977 * .travis.yml, configure.ac, src/Doxyfile, src/version.hpp:
2978 set version to 2.1
2979
2980 * NEWS:
2981 updated NEWS
2982
2983 2017-01-17 Martin Gieseking <martin.gieseking@uos.de>
2984
2985 * libs/ff-woff/fontforge/utils.c, src/FileSystem.cpp, src/FileSystem.hpp,
2986 src/Font.cpp, src/FontWriter.cpp, src/GlyphTracerMessages.hpp,
2987 src/MetafontWrapper.cpp, src/MetafontWrapper.hpp, src/Process.cpp,
2988 src/Process.hpp, src/SVGOutput.cpp, src/SVGOutput.hpp:
2989 create temp files in the system's temp folder rather than in cwd (closes
2990 #63)
2991
2992 * doc/dvisvgm.txt.in, src/CommandLine.hpp, src/dvisvgm.cpp,
2993 src/options.xml:
2994 added option --tmpdir to select a different temp folder
2995
2996 * src/FontWriter.cpp, src/FontWriter.hpp:
2997 print error message if FontWriter can't write temporary files
2998
2999 2017-01-12 Martin Gieseking <martin.gieseking@uos.de>
3000
3001 * src/FilePath.cpp, src/FilePath.hpp, tests/FilePathTest.cpp,
3002 tests/SVGOutputTest.cpp:
3003 retain letter case of filenames (Windows)
3004
3005 * src/DVIToSVG.cpp, src/EPSToSVG.cpp, src/SVGTree.hpp:
3006 print warning message if output file could not be written
3007
3008 * tests/GhostscriptTest.cpp:
3009 disable GS banner in GhostscriptTest
3010
3011 2017-01-10 Martin Gieseking <martin.gieseking@uos.de>
3012
3013 * src/PsSpecialHandler.cpp, src/dvisvgm.cpp:
3014 added missing newlines in messages; fixed typo
3015
3016 2017-01-05 Martin Gieseking <martin.gieseking@uos.de>
3017
3018 * src/AGLTable.hpp:
3019 updated AGL table and removed colliding codepoints (closes #64)
3020
3021 2017-01-03 Martin Gieseking <martin.gieseking@uos.de>
3022
3023 * Makefile.am, README, README.md, configure.ac, doc/Makefile.am,
3024 doc/conf-dblatex-man.xsl, doc/conf-dblatex-pdf.xsl, doc/db2html.xsl,
3025 doc/dvisvgm.txt.in, doc/tweak-db-article.xsl, doc/tweak-dblatex-pdf.xsl,
3026 libs/Makefile.am, src/AGLTable.hpp, src/BasicDVIReader.cpp,
3027 src/BasicDVIReader.hpp, src/Bezier.cpp, src/Bezier.hpp,
3028 src/BgColorSpecialHandler.cpp, src/BgColorSpecialHandler.hpp,
3029 src/Bitmap.cpp, src/Bitmap.hpp, src/BoundingBox.cpp, src/BoundingBox.hpp,
3030 src/CLCommandLine.cpp, src/CLCommandLine.hpp, src/CLOption.hpp,
3031 src/CMap.cpp, src/CMap.hpp, src/CMapManager.cpp, src/CMapManager.hpp,
3032 src/CMapReader.cpp, src/CMapReader.hpp, src/CRC32.cpp, src/CRC32.hpp,
3033 src/Calculator.cpp, src/Calculator.hpp, src/CharMapID.cpp,
3034 src/CharMapID.hpp, src/Character.hpp, src/Color.cpp, src/Color.hpp,
3035 src/ColorSpecialHandler.cpp, src/ColorSpecialHandler.hpp,
3036 src/CommandLine.hpp, src/DLLoader.cpp, src/DLLoader.hpp,
3037 src/DVIActions.hpp, src/DVIReader.cpp, src/DVIReader.hpp,
3038 src/DVIToSVG.cpp, src/DVIToSVG.hpp, src/DVIToSVGActions.cpp,
3039 src/DVIToSVGActions.hpp, src/DependencyGraph.hpp, src/Directory.cpp,
3040 src/Directory.hpp, src/DvisvgmSpecialHandler.cpp,
3041 src/DvisvgmSpecialHandler.hpp, src/EPSFile.cpp, src/EPSFile.hpp,
3042 src/EPSToSVG.cpp, src/EPSToSVG.hpp, src/EmSpecialHandler.cpp,
3043 src/EmSpecialHandler.hpp, src/EncFile.cpp, src/EncFile.hpp,
3044 src/FileFinder.cpp, src/FileFinder.hpp, src/FilePath.cpp,
3045 src/FilePath.hpp, src/FileSystem.cpp, src/FileSystem.hpp,
3046 src/FixWord.hpp, src/Font.cpp, src/Font.hpp, src/FontCache.cpp,
3047 src/FontCache.hpp, src/FontEncoding.cpp, src/FontEncoding.hpp,
3048 src/FontEngine.cpp, src/FontEngine.hpp, src/FontManager.cpp,
3049 src/FontManager.hpp, src/FontMap.cpp, src/FontMap.hpp,
3050 src/FontMetrics.cpp, src/FontMetrics.hpp, src/FontStyle.hpp,
3051 src/FontWriter.cpp, src/FontWriter.hpp, src/GFGlyphTracer.cpp,
3052 src/GFGlyphTracer.hpp, src/GFReader.cpp, src/GFReader.hpp,
3053 src/GFTracer.cpp, src/GFTracer.hpp, src/Ghostscript.cpp,
3054 src/Ghostscript.hpp, src/Glyph.hpp, src/GlyphTracerMessages.hpp,
3055 src/GraphicsPath.hpp, src/HtmlSpecialHandler.cpp,
3056 src/HtmlSpecialHandler.hpp, src/InputBuffer.cpp, src/InputBuffer.hpp,
3057 src/InputReader.cpp, src/InputReader.hpp, src/JFM.cpp, src/JFM.hpp,
3058 src/Length.cpp, src/Length.hpp, src/Makefile.am, src/MapLine.cpp,
3059 src/MapLine.hpp, src/Matrix.cpp, src/Matrix.hpp, src/Message.cpp,
3060 src/Message.hpp, src/MessageException.hpp, src/MetafontWrapper.cpp,
3061 src/MetafontWrapper.hpp, src/MiKTeXCom.cpp, src/MiKTeXCom.hpp,
3062 src/NoPsSpecialHandler.cpp, src/NoPsSpecialHandler.hpp,
3063 src/NumericRanges.hpp, src/PSFilter.hpp, src/PSInterpreter.cpp,
3064 src/PSInterpreter.hpp, src/PSPattern.cpp, src/PSPattern.hpp,
3065 src/PSPreviewFilter.cpp, src/PSPreviewFilter.hpp, src/PageRanges.cpp,
3066 src/PageRanges.hpp, src/PageSize.cpp, src/PageSize.hpp, src/Pair.hpp,
3067 src/PapersizeSpecialHandler.cpp, src/PapersizeSpecialHandler.hpp,
3068 src/PathClipper.cpp, src/PathClipper.hpp, src/PdfSpecialHandler.cpp,
3069 src/PdfSpecialHandler.hpp, src/PreScanDVIReader.cpp,
3070 src/PreScanDVIReader.hpp, src/Process.cpp, src/Process.hpp,
3071 src/PsSpecialHandler.cpp, src/PsSpecialHandler.hpp, src/RangeMap.cpp,
3072 src/RangeMap.hpp, src/SVGCharHandler.cpp, src/SVGCharHandler.hpp,
3073 src/SVGCharHandlerFactory.cpp, src/SVGCharHandlerFactory.hpp,
3074 src/SVGCharPathHandler.cpp, src/SVGCharPathHandler.hpp,
3075 src/SVGCharTspanTextHandler.cpp, src/SVGCharTspanTextHandler.hpp,
3076 src/SVGOutput.cpp, src/SVGOutput.hpp, src/SVGSingleCharTextHandler.cpp,
3077 src/SVGSingleCharTextHandler.hpp, src/SVGTree.cpp, src/SVGTree.hpp,
3078 src/ShadingPatch.cpp, src/ShadingPatch.hpp, src/SignalHandler.cpp,
3079 src/SignalHandler.hpp, src/SpecialActions.hpp, src/SpecialHandler.hpp,
3080 src/SpecialManager.cpp, src/SpecialManager.hpp, src/StreamReader.cpp,
3081 src/StreamReader.hpp, src/StreamWriter.cpp, src/StreamWriter.hpp,
3082 src/Subfont.cpp, src/Subfont.hpp, src/System.cpp, src/System.hpp,
3083 src/TFM.cpp, src/TFM.hpp, src/TensorProductPatch.cpp,
3084 src/TensorProductPatch.hpp, src/Terminal.cpp, src/Terminal.hpp,
3085 src/ToUnicodeMap.cpp, src/ToUnicodeMap.hpp, src/TpicSpecialHandler.cpp,
3086 src/TpicSpecialHandler.hpp, src/TriangularPatch.cpp,
3087 src/TriangularPatch.hpp, src/Unicode.cpp, src/Unicode.hpp,
3088 src/VFActions.hpp, src/VFReader.cpp, src/VFReader.hpp,
3089 src/VectorIterator.hpp, src/VectorStream.hpp, src/XMLDocument.cpp,
3090 src/XMLDocument.hpp, src/XMLNode.cpp, src/XMLNode.hpp, src/XMLString.cpp,
3091 src/XMLString.hpp, src/ZLibOutputStream.hpp, src/dvisvgm.cpp,
3092 src/ffwrapper.c, src/ffwrapper.h, src/macros.hpp, src/options.dtd,
3093 src/options.xml, src/psdefs.cpp, src/version.hpp, src/version.hpp.in,
3094 tests/BezierTest.cpp, tests/BitmapTest.cpp, tests/BoundingBoxTest.cpp,
3095 tests/CMapManagerTest.cpp, tests/CMapReaderTest.cpp, tests/CMapTest.cpp,
3096 tests/CRC32Test.cpp, tests/CalculatorTest.cpp,
3097 tests/ColorSpecialTest.cpp, tests/ColorTest.cpp,
3098 tests/CommandLineTest.cpp, tests/DependencyGraphTest.cpp,
3099 tests/DirectoryTest.cpp, tests/DvisvgmSpecialTest.cpp,
3100 tests/EmSpecialTest.cpp, tests/FileFinderTest.cpp,
3101 tests/FilePathTest.cpp, tests/FileSystemTest.cpp,
3102 tests/FontManagerTest.cpp, tests/FontMapTest.cpp,
3103 tests/GFGlyphTracerTest.cpp, tests/GFReaderTest.cpp,
3104 tests/GraphicsPathTest.cpp, tests/JFMReaderTest.cpp,
3105 tests/LengthTest.cpp, tests/Makefile.am, tests/MapLineTest.cpp,
3106 tests/MatrixTest.cpp, tests/MessageExceptionTest.cpp,
3107 tests/PSInterpreterTest.cpp, tests/PageRagesTest.cpp,
3108 tests/PageSizeTest.cpp, tests/PairTest.cpp, tests/RangeMapTest.cpp,
3109 tests/SVGOutputTest.cpp, tests/ShadingPatchTest.cpp,
3110 tests/SplittedCharInputBufferTest.cpp, tests/StreamInputBufferTest.cpp,
3111 tests/StreamReaderTest.cpp, tests/StreamWriterTest.cpp,
3112 tests/SubfontTest.cpp, tests/TFMReaderTest.cpp,
3113 tests/TensorProductPatchTest.cpp, tests/ToUnicodeMapTest.cpp,
3114 tests/TriangularPatchTest.cpp, tests/UnicodeTest.cpp,
3115 tests/VectorIteratorTest.cpp, tests/VectorStreamTest.cpp,
3116 tests/XMLNodeTest.cpp, tests/XMLStringTest.cpp, tests/check-conv,
3117 tests/create-makefile, tests/data/Makefile.am, tests/genhashcheck.py,
3118 tests/normalize.xsl:
3119 updated year in copyright statements to 2017
3120
3121 2016-12-20 Martin Gieseking <martin.gieseking@uos.de>
3122
3123 * doc/Makefile.am, doc/conf-dblatex-pdf.xsl, doc/db2html.xsl,
3124 doc/dvisvgm.txt.in, doc/dvisvgm.xpr, doc/tweak-db-article.xsl:
3125 manpage: minor refactorings of the XSLT scripts; added generation of
3126 epub
3127
3128 2016-12-16 Martin Gieseking <martin.gieseking@uos.de>
3129
3130 * doc/conf-dblatex-man.xsl, doc/conf-dblatex-pdf.xsl, doc/db2html.xsl,
3131 doc/tweak-dblatex-pdf.xsl:
3132 added missing email address to copyright headers
3133
3134 * doc/conf-dblatex-man.xsl, doc/conf-dblatex-pdf.xsl,
3135 doc/tweak-dblatex-pdf.xsl:
3136 indent with tabs rather than spaces
3137
3138 * doc/db2html.xsl:
3139 manpage: replace icon of Author section
3140
3141 * doc/conf-dblatex-pdf.xsl, doc/tweak-dblatex-pdf.xsl:
3142 manpage: use mixed case titles in pdf output
3143
3144 2016-12-15 Martin Gieseking <martin.gieseking@uos.de>
3145
3146 * doc/db2html.xsl, doc/dvisvgm.xpr:
3147 manpage: preserve whitespace in list of supported specials
3148
3149 2016-11-16 Martin Gieseking <martin.gieseking@uos.de>
3150
3151 * configure.ac:
3152 ensure compiling C files with --std=c99
3153
3154 2016-11-14 Martin Gieseking <martin.gieseking@uos.de>
3155
3156 * NEWS:
3157 updated NEWS
3158
3159 2016-11-12 Martin Gieseking <martin.gieseking@uos.de>
3160
3161 * doc/dvisvgm.txt.in:
3162 minor changes in manpage
3163
3164 * README, README.md, configure.ac, libs/Makefile.am, libs/ff-woff/LICENSE,
3165 libs/ff-woff/Makefile.am, libs/ff-woff/README.md,
3166 libs/ff-woff/fontforge/PfEd.h, libs/ff-woff/fontforge/alphabet.c,
3167 libs/ff-woff/fontforge/asmfpst.c, libs/ff-woff/fontforge/autohint.c,
3168 libs/ff-woff/fontforge/char.c, libs/ff-woff/fontforge/cjk.c,
3169 libs/ff-woff/fontforge/configure-fontforge.h,
3170 libs/ff-woff/fontforge/cvundoes.c, libs/ff-woff/fontforge/dumppfa.c,
3171 libs/ff-woff/fontforge/edgelist.h, libs/ff-woff/fontforge/edgelist2.h,
3172 libs/ff-woff/fontforge/encoding.c, libs/ff-woff/fontforge/encoding.h,
3173 libs/ff-woff/fontforge/fontforge-config.h,
3174 libs/ff-woff/fontforge/fontforge.h, libs/ff-woff/fontforge/fontforgevw.h,
3175 libs/ff-woff/fontforge/fvfonts.c, libs/ff-woff/fontforge/gwwiconv.c,
3176 libs/ff-woff/fontforge/libffstamp.h, libs/ff-woff/fontforge/lookups.c,
3177 libs/ff-woff/fontforge/macbinary.c, libs/ff-woff/fontforge/macenc.c,
3178 libs/ff-woff/fontforge/mathconstants.c, libs/ff-woff/fontforge/memory.c,
3179 libs/ff-woff/fontforge/mm.c, libs/ff-woff/fontforge/namehash.h,
3180 libs/ff-woff/fontforge/namelist.c, libs/ff-woff/fontforge/nouiutil.c,
3181 libs/ff-woff/fontforge/nowakowskittfinstr.c,
3182 libs/ff-woff/fontforge/parsepfa.c, libs/ff-woff/fontforge/parsettf.c,
3183 libs/ff-woff/fontforge/parsettfatt.c, libs/ff-woff/fontforge/psfont.h,
3184 libs/ff-woff/fontforge/psread.c, libs/ff-woff/fontforge/pua.c,
3185 libs/ff-woff/fontforge/sd.h, libs/ff-woff/fontforge/sfd.c,
3186 libs/ff-woff/fontforge/sfd1.c, libs/ff-woff/fontforge/sfd1.h,
3187 libs/ff-woff/fontforge/splinechar.c, libs/ff-woff/fontforge/splinefont.c,
3188 libs/ff-woff/fontforge/splinefont.h,
3189 libs/ff-woff/fontforge/splineorder2.c,
3190 libs/ff-woff/fontforge/splineoverlap.c,
3191 libs/ff-woff/fontforge/splinerefigure.c,
3192 libs/ff-woff/fontforge/splinesave.c,
3193 libs/ff-woff/fontforge/splinesaveafm.c,
3194 libs/ff-woff/fontforge/splineutil.c,
3195 libs/ff-woff/fontforge/splineutil2.c, libs/ff-woff/fontforge/start.c,
3196 libs/ff-woff/fontforge/stemdb.c, libs/ff-woff/fontforge/stemdb.h,
3197 libs/ff-woff/fontforge/tables.h, libs/ff-woff/fontforge/tottf.c,
3198 libs/ff-woff/fontforge/tottfaat.c, libs/ff-woff/fontforge/tottfgpos.c,
3199 libs/ff-woff/fontforge/tottfvar.c, libs/ff-woff/fontforge/ttf.h,
3200 libs/ff-woff/fontforge/ttfinstrs.c, libs/ff-woff/fontforge/ttfinstrs.h,
3201 libs/ff-woff/fontforge/ttfspecial.c,
3202 libs/ff-woff/fontforge/uiinterface.h, libs/ff-woff/fontforge/unialt.c,
3203 libs/ff-woff/fontforge/ustring.c, libs/ff-woff/fontforge/utils.c,
3204 libs/ff-woff/fontforge/utype.c, libs/ff-woff/fontforge/woff.c,
3205 libs/ff-woff/inc/basics.h, libs/ff-woff/inc/chardata.h,
3206 libs/ff-woff/inc/charset.h, libs/ff-woff/inc/dlist.h,
3207 libs/ff-woff/inc/gimage.h, libs/ff-woff/inc/gnetwork.h,
3208 libs/ff-woff/inc/gwwiconv.h, libs/ff-woff/inc/intl.h,
3209 libs/ff-woff/inc/ustring.h, libs/ff-woff/inc/utype.h, src/Makefile.am:
3210 bundle reduced fontforge library (ff-woff)
3211
3212 * configure.ac, libs/Makefile.am, libs/clipper/Makefile.am,
3213 libs/ff-woff/Makefile.am, libs/woff2/Makefile.am,
3214 libs/woff2/brotli/Makefile.am, libs/woff2/brotli/enc/Makefile.am,
3215 libs/woff2/src/Makefile.am, src/Makefile.am:
3216 added license files of bundled libraries; relocated Makefiles
3217
3218 * .travis.yml, configure.ac, src/Doxyfile, src/version.hpp:
3219 set version to 2.0.4
3220
3221 2016-11-07 Martin Gieseking <martin.gieseking@uos.de>
3222
3223 * src/CommandLine.hpp, src/options.xml:
3224 fixed a typo in the --help output
3225
3226 * src/BasicDVIReader.cpp, src/BasicDVIReader.hpp, src/DVIReader.cpp,
3227 src/DVIReader.hpp:
3228 use const variables for DVI opcodes rather than the values directly
3229
3230 2016-11-01 Martin Gieseking <martin.gieseking@uos.de>
3231
3232 * src/FontWriter.cpp:
3233 few cosmetic changes; added comments
3234
3235 2016-09-27 Martin Gieseking <martin.gieseking@uos.de>
3236
3237 * .travis.yml, configure.ac, src/Doxyfile, src/version.hpp:
3238 set version to 2.0.3
3239
3240 * NEWS, README, README.md:
3241 updated NEWS and README
3242
3243 2016-09-23 Martin Gieseking <martin.gieseking@uos.de>
3244
3245 * src/DVIReader.cpp, src/DVIReader.hpp, src/DVIToSVG.cpp,
3246 src/DVIToSVG.hpp:
3247 dropped tracking of previous DVI state from DVIReader
3248
3249 * src/DVIReader.cpp:
3250 fixed positioning of rules
3251
3252 2016-09-22 Martin Gieseking <martin.gieseking@uos.de>
3253
3254 * src/DVIReader.cpp, src/DVIReader.hpp, src/DVIToSVG.cpp:
3255 fixed regression in character positioning of of virtual fonts
3256
3257 2016-09-18 Martin Gieseking <martin.gieseking@uos.de>
3258
3259 * src/DVIReader.cpp:
3260 fixed type regression in computation of DVI positions (closes #61)
3261
3262 * .travis.yml, configure.ac, src/Doxyfile, src/version.hpp:
3263 set version to 2.0.2
3264
3265 * NEWS, README.md:
3266 updated NEWS and README
3267
3268 2016-09-16 Martin Gieseking <martin.gieseking@uos.de>
3269
3270 * src/Font.cpp:
3271 fixed sign of character depth computed for native fonts
3272
3273 2016-09-03 Martin Gieseking <martin.gieseking@uos.de>
3274
3275 * .travis.yml, configure.ac, src/Doxyfile, src/version.hpp:
3276 set version to 2.0.1
3277
3278 * NEWS, README, README.md:
3279 updated NEWS and README
3280
3281 2016-08-31 Martin Gieseking <martin.gieseking@uos.de>
3282
3283 * README, README.md:
3284 added link to reduced FF library to README
3285
3286 * doc/dvisvgm.txt.in, src/FontWriter.cpp, src/FontWriter.hpp,
3287 src/SVGTree.cpp, src/SVGTree.hpp, src/ffwrapper.c:
3288 added option to autohint fonts created by the FontForge library
3289
3290 2016-08-30 Martin Gieseking <martin.gieseking@uos.de>
3291
3292 * src/DVIToSVGActions.hpp, src/FontManager.hpp, src/MetafontWrapper.hpp:
3293 adapted struct/class forward declarations
3294
3295 2016-08-28 Martin Gieseking <martin.gieseking@uos.de>
3296
3297 * src/FileFinder.cpp, src/FileFinder.hpp:
3298 removed unused variable
3299
3300 * src/CLCommandLine.cpp:
3301 added missing cast to avoid compiler warning
3302
3303 * .travis.yml, configure.ac, src/Doxyfile, src/version.hpp:
3304 set version to 2.0
3305
3306 * README, README.md:
3307 updated README files
3308
3309 * NEWS:
3310 updated NEWS
3311
3312 2016-08-27 Martin Gieseking <martin.gieseking@uos.de>
3313
3314 * .travis.yml:
3315 use Ubuntu Trusty for Travis builds
3316
3317 * .travis.yml:
3318 Travis: prevent rebuilding files in folder 'src' when calling 'make
3319 check'
3320
3321 * src/FontWriter.cpp, src/FontWriter.hpp, src/ffwrapper.c,
3322 src/ffwrapper.h:
3323 added missing copyright headers
3324
3325 2016-08-25 Martin Gieseking <martin.gieseking@uos.de>
3326
3327 * Makefile.am, clipper/License.txt, clipper/Makefile.am,
3328 clipper/clipper.cpp, clipper/clipper.hpp, configure.ac, libs/Makefile.am,
3329 libs/clipper/License.txt, libs/clipper/Makefile.am,
3330 libs/clipper/clipper.cpp, libs/clipper/clipper.hpp, libs/xxHash/LICENSE,
3331 libs/xxHash/Makefile.am, libs/xxHash/xxhash.c, libs/xxHash/xxhash.h,
3332 src/Makefile.am, tests/Makefile.am, tests/create-makefile,
3333 xxHash/LICENSE, xxHash/Makefile.am, xxHash/xxhash.c, xxHash/xxhash.h:
3334 moved bundled libraries (clipper, xxHash) to subfolder 'libs'
3335
3336 * configure.ac, doc/dvisvgm.txt.in, libs/Makefile.am, libs/woff2/LICENSE,
3337 libs/woff2/brotli/LICENSE, libs/woff2/brotli/enc/Makefile.am,
3338 libs/woff2/brotli/enc/backward_references.cc,
3339 libs/woff2/brotli/enc/backward_references.h,
3340 libs/woff2/brotli/enc/bit_cost.h,
3341 libs/woff2/brotli/enc/block_splitter.cc,
3342 libs/woff2/brotli/enc/block_splitter.h,
3343 libs/woff2/brotli/enc/brotli_bit_stream.cc,
3344 libs/woff2/brotli/enc/brotli_bit_stream.h,
3345 libs/woff2/brotli/enc/cluster.h, libs/woff2/brotli/enc/command.h,
3346 libs/woff2/brotli/enc/compress_fragment.cc,
3347 libs/woff2/brotli/enc/compress_fragment.h,
3348 libs/woff2/brotli/enc/compress_fragment_two_pass.cc,
3349 libs/woff2/brotli/enc/compress_fragment_two_pass.h,
3350 libs/woff2/brotli/enc/compressor.h, libs/woff2/brotli/enc/context.h,
3351 libs/woff2/brotli/enc/dictionary.cc, libs/woff2/brotli/enc/dictionary.h,
3352 libs/woff2/brotli/enc/dictionary_hash.h, libs/woff2/brotli/enc/encode.cc,
3353 libs/woff2/brotli/enc/encode.h, libs/woff2/brotli/enc/encode_parallel.cc,
3354 libs/woff2/brotli/enc/encode_parallel.h,
3355 libs/woff2/brotli/enc/entropy_encode.cc,
3356 libs/woff2/brotli/enc/entropy_encode.h,
3357 libs/woff2/brotli/enc/entropy_encode_static.h,
3358 libs/woff2/brotli/enc/fast_log.h,
3359 libs/woff2/brotli/enc/find_match_length.h, libs/woff2/brotli/enc/hash.h,
3360 libs/woff2/brotli/enc/histogram.cc, libs/woff2/brotli/enc/histogram.h,
3361 libs/woff2/brotli/enc/literal_cost.cc,
3362 libs/woff2/brotli/enc/literal_cost.h, libs/woff2/brotli/enc/metablock.cc,
3363 libs/woff2/brotli/enc/metablock.h, libs/woff2/brotli/enc/port.h,
3364 libs/woff2/brotli/enc/prefix.h, libs/woff2/brotli/enc/ringbuffer.h,
3365 libs/woff2/brotli/enc/static_dict.cc,
3366 libs/woff2/brotli/enc/static_dict.h,
3367 libs/woff2/brotli/enc/static_dict_lut.h,
3368 libs/woff2/brotli/enc/streams.cc, libs/woff2/brotli/enc/streams.h,
3369 libs/woff2/brotli/enc/transform.h, libs/woff2/brotli/enc/types.h,
3370 libs/woff2/brotli/enc/utf8_util.cc, libs/woff2/brotli/enc/utf8_util.h,
3371 libs/woff2/brotli/enc/write_bits.h, libs/woff2/brotli/tools/bro.cc,
3372 libs/woff2/brotli/tools/rfc-format.py, libs/woff2/brotli/tools/version.h,
3373 libs/woff2/src/Makefile.am, libs/woff2/src/buffer.h,
3374 libs/woff2/src/file.h, libs/woff2/src/font.cc, libs/woff2/src/font.h,
3375 libs/woff2/src/glyph.cc, libs/woff2/src/glyph.h,
3376 libs/woff2/src/normalize.cc, libs/woff2/src/normalize.h,
3377 libs/woff2/src/port.h, libs/woff2/src/round.h,
3378 libs/woff2/src/store_bytes.h, libs/woff2/src/table_tags.cc,
3379 libs/woff2/src/table_tags.h, libs/woff2/src/transform.cc,
3380 libs/woff2/src/transform.h, libs/woff2/src/variable_length.cc,
3381 libs/woff2/src/variable_length.h, libs/woff2/src/woff2_common.cc,
3382 libs/woff2/src/woff2_common.h, libs/woff2/src/woff2_dec.h,
3383 libs/woff2/src/woff2_enc.cc, libs/woff2/src/woff2_enc.h,
3384 libs/woff2/src/woff2_out.cc, libs/woff2/src/woff2_out.h,
3385 src/FontWriter.cpp, src/FontWriter.hpp, src/Makefile.am:
3386 added support for embedding WOFF2 fonts
3387
3388 2016-08-24 Martin Gieseking <martin.gieseking@uos.de>
3389
3390 * src/XMLNode.hpp:
3391 added move constructors to XMLNode classes
3392
3393 2016-08-23 Martin Gieseking <martin.gieseking@uos.de>
3394
3395 * src/FontEngine.cpp:
3396 fixed sign of the font descender
3397
3398 * configure.ac, doc/dvisvgm.txt.in, src/CommandLine.hpp,
3399 src/FontWriter.cpp, src/FontWriter.hpp, src/GraphicsPath.hpp,
3400 src/Makefile.am, src/SVGTree.cpp, src/SVGTree.hpp, src/XMLNode.cpp,
3401 src/XMLNode.hpp, src/dvisvgm.cpp, src/ffwrapper.c, src/ffwrapper.h,
3402 src/options.xml:
3403 added option --font-format to select the file format used to embed fonts
3404
3405 2016-08-22 Martin Gieseking <martin.gieseking@uos.de>
3406
3407 * xxHash/xxhash.c, xxHash/xxhash.h:
3408 updated xxHash to version 0.6.2
3409
3410 2016-08-17 Martin Gieseking <martin.gieseking@uos.de>
3411
3412 * src/FixWord.hpp, src/Font.cpp, src/FontMetrics.hpp, src/SVGTree.cpp,
3413 src/TFM.cpp, src/TFM.hpp:
3414 added getters for ascent and descent to TFM-based fonts
3415
3416 2016-08-14 Martin Gieseking <martin.gieseking@uos.de>
3417
3418 * src/Ghostscript.hpp:
3419 removed copy constructor of class Ghostscript
3420
3421 * src/PathClipper.cpp:
3422 added missing initializers
3423
3424 2016-08-13 Martin Gieseking <martin.gieseking@uos.de>
3425
3426 * configure.ac, src/CLCommandLine.cpp, src/CLCommandLine.hpp,
3427 src/CommandLine.hpp, src/Makefile.am, src/dvisvgm.cpp, src/options.dtd,
3428 src/options.xml, src/version.hpp, src/version.hpp.in:
3429 added version.hpp to provide the current version number
3430
3431 2016-08-08 Martin Gieseking <martin.gieseking@uos.de>
3432
3433 * src/DVIReader.cpp, src/DVIReader.hpp, src/Directory.cpp,
3434 src/Directory.hpp, src/FilePath.cpp, src/FilePath.hpp, src/Font.cpp,
3435 src/Font.hpp, src/FontManager.cpp, src/FontManager.hpp, src/GFReader.hpp,
3436 src/PageRanges.cpp, src/PageRanges.hpp, src/PageSize.cpp,
3437 src/PageSize.hpp, src/SVGOutput.cpp, src/SVGOutput.hpp,
3438 src/VFActions.hpp, src/VFReader.cpp:
3439 pass string parameters by reference if possible
3440
3441 * src/System.cpp, src/dvisvgm.cpp:
3442 minor refactorings of dvisvgm.cpp
3443
3444 * src/Ghostscript.cpp, src/MiKTeXCom.cpp:
3445 replaced __WIN64__ with pre-defined _WIN64
3446
3447 2016-08-02 Martin Gieseking <martin.gieseking@uos.de>
3448
3449 * src/CLCommandLine.cpp, src/CLCommandLine.hpp, src/CLOption.hpp,
3450 src/CmdLineParserBase.cpp, src/CmdLineParserBase.hpp,
3451 src/CommandLine.cpp, src/CommandLine.hpp, src/Makefile.am,
3452 src/dvisvgm.cpp, src/options.dtd, src/options.xml,
3453 tests/CommandLineTest.cpp:
3454 reimplemented the CommandLine parser class
3455
3456 * src/CMap.cpp, src/CMapManager.cpp, src/CMapReader.cpp, src/EncFile.cpp,
3457 src/FileFinder.cpp, src/FileFinder.hpp, src/Font.cpp,
3458 src/FontEncoding.cpp, src/FontManager.cpp, src/FontMap.cpp,
3459 src/FontMetrics.cpp, src/Ghostscript.cpp, src/MetafontWrapper.cpp,
3460 src/PsSpecialHandler.cpp, src/Subfont.cpp, src/dvisvgm.cpp,
3461 tests/CMapManagerTest.cpp, tests/FileFinderTest.cpp,
3462 tests/MapLineTest.cpp, tests/SubfontTest.cpp:
3463 made FileFinder a singleton again
3464
3465 2016-07-27 Martin Gieseking <martin.gieseking@uos.de>
3466
3467 * src/BgColorSpecialHandler.cpp, src/BoundingBox.cpp,
3468 src/DvisvgmSpecialHandler.cpp, src/EmSpecialHandler.cpp,
3469 src/FileSystem.cpp, src/FontCache.cpp, src/FontEngine.cpp,
3470 src/FontManager.cpp, src/GraphicsPath.hpp, src/PSInterpreter.cpp,
3471 src/PapersizeSpecialHandler.cpp, src/PathClipper.cpp, src/RangeMap.cpp,
3472 src/Subfont.cpp, src/TpicSpecialHandler.cpp, src/XMLDocument.cpp,
3473 src/XMLNode.cpp:
3474 replaced insert/push_back with emplace/emplace_back where useful
3475
3476 2016-07-23 Martin Gieseking <martin.gieseking@uos.de>
3477
3478 * src/PathClipper.cpp:
3479 some minor refactorings of class PathClipper
3480
3481 * src/CMapReader.cpp:
3482 minor refactoring of class CMapReader
3483
3484 2016-07-22 Martin Gieseking <martin.gieseking@uos.de>
3485
3486 * src/FontMap.cpp, src/FontMap.hpp:
3487 some syntactic refactorings of class FontMap
3488
3489 * src/FontManager.cpp, src/FontManager.hpp:
3490 use unique_ptr to automatically release Font objects in class
3491 FontManager
3492
3493 2016-07-21 Martin Gieseking <martin.gieseking@uos.de>
3494
3495 * src/AGLTable.h, src/AGLTable.hpp, src/BasicDVIReader.cpp,
3496 src/BasicDVIReader.h, src/BasicDVIReader.hpp, src/Bezier.cpp,
3497 src/Bezier.h, src/Bezier.hpp, src/BgColorSpecialHandler.cpp,
3498 src/BgColorSpecialHandler.h, src/BgColorSpecialHandler.hpp,
3499 src/Bitmap.cpp, src/Bitmap.h, src/Bitmap.hpp, src/BoundingBox.cpp,
3500 src/BoundingBox.h, src/BoundingBox.hpp, src/CMap.cpp, src/CMap.h,
3501 src/CMap.hpp, src/CMapManager.cpp, src/CMapManager.h,
3502 src/CMapManager.hpp, src/CMapReader.cpp, src/CMapReader.h,
3503 src/CMapReader.hpp, src/CRC32.cpp, src/CRC32.h, src/CRC32.hpp,
3504 src/Calculator.cpp, src/Calculator.h, src/Calculator.hpp,
3505 src/CharMapID.cpp, src/CharMapID.h, src/CharMapID.hpp, src/Character.h,
3506 src/Character.hpp, src/CmdLineParserBase.cpp, src/CmdLineParserBase.h,
3507 src/CmdLineParserBase.hpp, src/Color.cpp, src/Color.h, src/Color.hpp,
3508 src/ColorSpecialHandler.cpp, src/ColorSpecialHandler.h,
3509 src/ColorSpecialHandler.hpp, src/CommandLine.cpp, src/CommandLine.h,
3510 src/CommandLine.hpp, src/DLLoader.cpp, src/DLLoader.h, src/DLLoader.hpp,
3511 src/DVIActions.h, src/DVIActions.hpp, src/DVIReader.cpp, src/DVIReader.h,
3512 src/DVIReader.hpp, src/DVIToSVG.cpp, src/DVIToSVG.h, src/DVIToSVG.hpp,
3513 src/DVIToSVGActions.cpp, src/DVIToSVGActions.h, src/DVIToSVGActions.hpp,
3514 src/DependencyGraph.h, src/DependencyGraph.hpp, src/Directory.cpp,
3515 src/Directory.h, src/Directory.hpp, src/DvisvgmSpecialHandler.cpp,
3516 src/DvisvgmSpecialHandler.h, src/DvisvgmSpecialHandler.hpp,
3517 src/EPSFile.cpp, src/EPSFile.h, src/EPSFile.hpp, src/EPSToSVG.cpp,
3518 src/EPSToSVG.h, src/EPSToSVG.hpp, src/EmSpecialHandler.cpp,
3519 src/EmSpecialHandler.h, src/EmSpecialHandler.hpp, src/EncFile.cpp,
3520 src/EncFile.h, src/EncFile.hpp, src/FileFinder.cpp, src/FileFinder.h,
3521 src/FileFinder.hpp, src/FilePath.cpp, src/FilePath.h, src/FilePath.hpp,
3522 src/FileSystem.cpp, src/FileSystem.h, src/FileSystem.hpp, src/FixWord.h,
3523 src/FixWord.hpp, src/Font.cpp, src/Font.h, src/Font.hpp,
3524 src/FontCache.cpp, src/FontCache.h, src/FontCache.hpp,
3525 src/FontEncoding.cpp, src/FontEncoding.h, src/FontEncoding.hpp,
3526 src/FontEngine.cpp, src/FontEngine.h, src/FontEngine.hpp,
3527 src/FontManager.cpp, src/FontManager.h, src/FontManager.hpp,
3528 src/FontMap.cpp, src/FontMap.h, src/FontMap.hpp, src/FontMetrics.cpp,
3529 src/FontMetrics.h, src/FontMetrics.hpp, src/FontStyle.h,
3530 src/FontStyle.hpp, src/GFGlyphTracer.cpp, src/GFGlyphTracer.h,
3531 src/GFGlyphTracer.hpp, src/GFReader.cpp, src/GFReader.h,
3532 src/GFReader.hpp, src/GFTracer.cpp, src/GFTracer.h, src/GFTracer.hpp,
3533 src/Ghostscript.cpp, src/Ghostscript.h, src/Ghostscript.hpp, src/Glyph.h,
3534 src/Glyph.hpp, src/GlyphTracerMessages.h, src/GlyphTracerMessages.hpp,
3535 src/GraphicsPath.h, src/GraphicsPath.hpp, src/HtmlSpecialHandler.cpp,
3536 src/HtmlSpecialHandler.h, src/HtmlSpecialHandler.hpp,
3537 src/InputBuffer.cpp, src/InputBuffer.h, src/InputBuffer.hpp,
3538 src/InputReader.cpp, src/InputReader.h, src/InputReader.hpp, src/JFM.cpp,
3539 src/JFM.h, src/JFM.hpp, src/Length.cpp, src/Length.h, src/Length.hpp,
3540 src/Makefile.am, src/MapLine.cpp, src/MapLine.h, src/MapLine.hpp,
3541 src/Matrix.cpp, src/Matrix.h, src/Matrix.hpp, src/Message.cpp,
3542 src/Message.h, src/Message.hpp, src/MessageException.h,
3543 src/MessageException.hpp, src/MetafontWrapper.cpp, src/MetafontWrapper.h,
3544 src/MetafontWrapper.hpp, src/MiKTeXCom.cpp, src/MiKTeXCom.h,
3545 src/MiKTeXCom.hpp, src/NoPsSpecialHandler.cpp, src/NoPsSpecialHandler.h,
3546 src/NoPsSpecialHandler.hpp, src/NumericRanges.h, src/NumericRanges.hpp,
3547 src/PSFilter.h, src/PSFilter.hpp, src/PSInterpreter.cpp,
3548 src/PSInterpreter.h, src/PSInterpreter.hpp, src/PSPattern.cpp,
3549 src/PSPattern.h, src/PSPattern.hpp, src/PSPreviewFilter.cpp,
3550 src/PSPreviewFilter.h, src/PSPreviewFilter.hpp, src/PageRanges.cpp,
3551 src/PageRanges.h, src/PageRanges.hpp, src/PageSize.cpp, src/PageSize.h,
3552 src/PageSize.hpp, src/Pair.h, src/Pair.hpp,
3553 src/PapersizeSpecialHandler.cpp, src/PapersizeSpecialHandler.h,
3554 src/PapersizeSpecialHandler.hpp, src/PathClipper.cpp, src/PathClipper.h,
3555 src/PathClipper.hpp, src/PdfSpecialHandler.cpp, src/PdfSpecialHandler.h,
3556 src/PdfSpecialHandler.hpp, src/PreScanDVIReader.cpp,
3557 src/PreScanDVIReader.h, src/PreScanDVIReader.hpp, src/Process.cpp,
3558 src/Process.h, src/Process.hpp, src/PsSpecialHandler.cpp,
3559 src/PsSpecialHandler.h, src/PsSpecialHandler.hpp, src/RangeMap.cpp,
3560 src/RangeMap.h, src/RangeMap.hpp, src/SVGCharHandler.cpp,
3561 src/SVGCharHandler.h, src/SVGCharHandler.hpp,
3562 src/SVGCharHandlerFactory.cpp, src/SVGCharHandlerFactory.h,
3563 src/SVGCharHandlerFactory.hpp, src/SVGCharPathHandler.cpp,
3564 src/SVGCharPathHandler.h, src/SVGCharPathHandler.hpp,
3565 src/SVGCharTspanTextHandler.cpp, src/SVGCharTspanTextHandler.h,
3566 src/SVGCharTspanTextHandler.hpp, src/SVGOutput.cpp, src/SVGOutput.h,
3567 src/SVGOutput.hpp, src/SVGSingleCharTextHandler.cpp,
3568 src/SVGSingleCharTextHandler.h, src/SVGSingleCharTextHandler.hpp,
3569 src/SVGTree.cpp, src/SVGTree.h, src/SVGTree.hpp, src/ShadingPatch.cpp,
3570 src/ShadingPatch.h, src/ShadingPatch.hpp, src/SignalHandler.cpp,
3571 src/SignalHandler.h, src/SignalHandler.hpp, src/SpecialActions.h,
3572 src/SpecialActions.hpp, src/SpecialHandler.h, src/SpecialHandler.hpp,
3573 src/SpecialManager.cpp, src/SpecialManager.h, src/SpecialManager.hpp,
3574 src/StreamReader.cpp, src/StreamReader.h, src/StreamReader.hpp,
3575 src/StreamWriter.cpp, src/StreamWriter.h, src/StreamWriter.hpp,
3576 src/Subfont.cpp, src/Subfont.h, src/Subfont.hpp, src/System.cpp,
3577 src/System.h, src/System.hpp, src/TFM.cpp, src/TFM.h, src/TFM.hpp,
3578 src/TensorProductPatch.cpp, src/TensorProductPatch.h,
3579 src/TensorProductPatch.hpp, src/Terminal.cpp, src/Terminal.h,
3580 src/Terminal.hpp, src/ToUnicodeMap.cpp, src/ToUnicodeMap.h,
3581 src/ToUnicodeMap.hpp, src/TpicSpecialHandler.cpp,
3582 src/TpicSpecialHandler.h, src/TpicSpecialHandler.hpp,
3583 src/TriangularPatch.cpp, src/TriangularPatch.h, src/TriangularPatch.hpp,
3584 src/Unicode.cpp, src/Unicode.h, src/Unicode.hpp, src/VFActions.h,
3585 src/VFActions.hpp, src/VFReader.cpp, src/VFReader.h, src/VFReader.hpp,
3586 src/VectorIterator.h, src/VectorIterator.hpp, src/VectorStream.h,
3587 src/VectorStream.hpp, src/XMLDocument.cpp, src/XMLDocument.h,
3588 src/XMLDocument.hpp, src/XMLNode.cpp, src/XMLNode.h, src/XMLNode.hpp,
3589 src/XMLString.cpp, src/XMLString.h, src/XMLString.hpp,
3590 src/ZLibOutputStream.h, src/ZLibOutputStream.hpp, src/dvisvgm.cpp,
3591 src/macros.h, src/macros.hpp, src/psdefs.cpp, tests/BezierTest.cpp,
3592 tests/BitmapTest.cpp, tests/BoundingBoxTest.cpp,
3593 tests/CMapManagerTest.cpp, tests/CMapReaderTest.cpp, tests/CMapTest.cpp,
3594 tests/CRC32Test.cpp, tests/CalculatorTest.cpp,
3595 tests/ColorSpecialTest.cpp, tests/ColorTest.cpp,
3596 tests/CommandLineTest.cpp, tests/DependencyGraphTest.cpp,
3597 tests/DirectoryTest.cpp, tests/DvisvgmSpecialTest.cpp,
3598 tests/EmSpecialTest.cpp, tests/FileFinderTest.cpp,
3599 tests/FilePathTest.cpp, tests/FileSystemTest.cpp,
3600 tests/FontManagerTest.cpp, tests/FontMapTest.cpp,
3601 tests/GFGlyphTracerTest.cpp, tests/GFReaderTest.cpp,
3602 tests/GhostscriptTest.cpp, tests/GraphicsPathTest.cpp,
3603 tests/JFMReaderTest.cpp, tests/LengthTest.cpp, tests/Makefile.am,
3604 tests/MapLineTest.cpp, tests/MatrixTest.cpp,
3605 tests/MessageExceptionTest.cpp, tests/PSInterpreterTest.cpp,
3606 tests/PageRagesTest.cpp, tests/PageSizeTest.cpp, tests/PairTest.cpp,
3607 tests/RangeMapTest.cpp, tests/SVGOutputTest.cpp,
3608 tests/ShadingPatchTest.cpp, tests/SplittedCharInputBufferTest.cpp,
3609 tests/StreamInputBufferTest.cpp, tests/StreamReaderTest.cpp,
3610 tests/StreamWriterTest.cpp, tests/SubfontTest.cpp,
3611 tests/TFMReaderTest.cpp, tests/TensorProductPatchTest.cpp,
3612 tests/ToUnicodeMapTest.cpp, tests/TriangularPatchTest.cpp,
3613 tests/UnicodeTest.cpp, tests/VectorIteratorTest.cpp,
3614 tests/VectorStreamTest.cpp, tests/XMLNodeTest.cpp,
3615 tests/XMLStringTest.cpp, tests/create-makefile:
3616 renamed filename extension of C++ headers to .hpp
3617
3618 2016-07-20 Martin Gieseking <martin.gieseking@uos.de>
3619
3620 * src/CMapManager.cpp, src/CMapManager.h, src/FileFinder.cpp,
3621 src/Font.cpp, src/Font.h, src/XMLDocument.cpp, src/XMLDocument.h,
3622 src/XMLNode.cpp, src/XMLNode.h, tests/XMLNodeTest.cpp:
3623 use smart pointers to release heap memory
3624
3625 * src/DVIToSVGActions.cpp, src/DVIToSVGActions.h:
3626 create BoxMap object directly, avoid new/delete
3627
3628 2016-07-19 Martin Gieseking <martin.gieseking@uos.de>
3629
3630 * src/AGLTable.h, src/Color.cpp, src/Unicode.cpp, tests/genhashcheck.py:
3631 replaced repeated binary search implementations with calls of
3632 lower_bound()
3633
3634 2016-07-13 Martin Gieseking <martin.gieseking@uos.de>
3635
3636 * src/FileFinder.cpp, src/Message.cpp:
3637 initialize maps with initializer-lists
3638
3639 2016-07-05 Martin Gieseking <martin.gieseking@uos.de>
3640
3641 * src/Length.cpp, src/TpicSpecialHandler.cpp:
3642 replaced 'id macros' with constexpr functions
3643
3644 2016-07-04 Martin Gieseking <martin.gieseking@uos.de>
3645
3646 * src/TFM.cpp:
3647 added missing initializers
3648
3649 * src/dvisvgm.cpp:
3650 catch exception in set_cache_dir()
3651
3652 * .travis.yml, configure.ac, src/Doxyfile:
3653 set version to 1.16
3654
3655 * NEWS, README.md:
3656 updated NEWS and README
3657
3658 2016-07-03 Martin Gieseking <martin.gieseking@uos.de>
3659
3660 * configure.ac, m4/ax_cxx_compile_stdcxx.m4:
3661 switch from C++03 to C++11
3662
3663 * src/NumericRanges.h, src/PapersizeSpecialHandler.cpp, src/Unicode.cpp,
3664 src/VFReader.cpp:
3665 replaced static callback functions with lambdas
3666
3667 * src/CMapReader.cpp, src/CMapReader.h, src/CmdLineParserBase.cpp,
3668 src/CmdLineParserBase.h, src/Color.cpp, src/Color.h, src/CommandLine.cpp,
3669 src/DVIReader.cpp, src/DVIReader.h, src/DVIToSVG.cpp,
3670 src/EmSpecialHandler.cpp, src/Font.cpp, src/Font.h, src/FontManager.cpp,
3671 src/GraphicsPath.h, src/HtmlSpecialHandler.cpp, src/HtmlSpecialHandler.h,
3672 src/Length.cpp, src/Length.h, src/PathClipper.cpp,
3673 src/PsSpecialHandler.cpp, src/SVGTree.cpp, src/ShadingPatch.cpp,
3674 src/TensorProductPatch.h, tests/BoundingBoxTest.cpp,
3675 tests/LengthTest.cpp, tests/ShadingPatchTest.cpp,
3676 tests/TensorProductPatchTest.cpp, tests/TriangularPatchTest.cpp:
3677 replaced some enums with enum classes
3678
3679 * clipper/clipper.hpp, src/AGLTable.h, src/BasicDVIReader.cpp,
3680 src/Bitmap.cpp, src/Bitmap.h, src/BoundingBox.h, src/CMap.cpp,
3681 src/CMap.h, src/CMapReader.cpp, src/CRC32.cpp, src/CRC32.h,
3682 src/CharMapID.h, src/Character.h, src/Color.cpp, src/Color.h,
3683 src/DVIActions.h, src/DVIReader.cpp, src/DVIReader.h, src/DVIToSVG.cpp,
3684 src/DVIToSVG.h, src/DVIToSVGActions.cpp, src/DVIToSVGActions.h,
3685 src/EPSFile.cpp, src/EPSFile.h, src/EncFile.cpp, src/EncFile.h,
3686 src/FileSystem.cpp, src/FileSystem.h, src/FixWord.h, src/Font.cpp,
3687 src/Font.h, src/FontCache.cpp, src/FontCache.h, src/FontEncoding.cpp,
3688 src/FontEncoding.h, src/FontEngine.cpp, src/FontEngine.h,
3689 src/FontManager.cpp, src/FontManager.h, src/FontMetrics.cpp,
3690 src/FontMetrics.h, src/GFGlyphTracer.cpp, src/GFGlyphTracer.h,
3691 src/GFReader.cpp, src/GFReader.h, src/GFTracer.cpp, src/GFTracer.h,
3692 src/Glyph.h, src/GlyphTracerMessages.h, src/InputBuffer.cpp,
3693 src/InputBuffer.h, src/JFM.cpp, src/JFM.h, src/Makefile.am,
3694 src/Message.h, src/Pair.h, src/PathClipper.cpp, src/PreScanDVIReader.cpp,
3695 src/PsSpecialHandler.h, src/RangeMap.cpp, src/RangeMap.h,
3696 src/SVGCharHandler.h, src/SVGCharPathHandler.cpp,
3697 src/SVGCharPathHandler.h, src/SVGCharTspanTextHandler.cpp,
3698 src/SVGCharTspanTextHandler.h, src/SVGSingleCharTextHandler.cpp,
3699 src/SVGSingleCharTextHandler.h, src/StreamReader.cpp, src/StreamReader.h,
3700 src/StreamWriter.cpp, src/StreamWriter.h, src/Subfont.cpp, src/Subfont.h,
3701 src/TFM.cpp, src/TFM.h, src/ToUnicodeMap.cpp, src/ToUnicodeMap.h,
3702 src/Unicode.cpp, src/Unicode.h, src/VFActions.h, src/VFReader.cpp,
3703 src/VFReader.h, src/XMLString.cpp, src/types.h, tests/BitmapTest.cpp,
3704 tests/CRC32Test.cpp, tests/ColorSpecialTest.cpp, tests/ColorTest.cpp,
3705 tests/GFGlyphTracerTest.cpp, tests/GFReaderTest.cpp,
3706 tests/JFMReaderTest.cpp, tests/Makefile.am, tests/StreamReaderTest.cpp,
3707 tests/TriangularPatchTest.cpp, tests/TypesTest.cpp,
3708 tests/UnicodeTest.cpp:
3709 replaced own fixed-sized integer types with types from cstdint
3710
3711 * AUTHORS, LGPL-2.1.txt, Makefile.am, gzstream/COPYING.LIB,
3712 gzstream/Makefile, gzstream/README, gzstream/gzstream.cpp,
3713 gzstream/gzstream.h, gzstream/index.html, gzstream/logo.gif,
3714 gzstream/test_gunzip.C, gzstream/test_gzip.C, gzstream/version,
3715 src/Makefile.am, src/SVGOutput.cpp, src/SVGOutput.h,
3716 src/ZLibOutputStream.h, src/dvisvgm.cpp, src/gzstream.cpp,
3717 src/gzstream.h, tests/Makefile.am, tests/SVGOutputTest.cpp,
3718 tests/create-makefile:
3719 replaced old gzstream classes
3720
3721 * src/DVIReader.cpp, src/DVIReader.h, src/Font.cpp, src/Font.h,
3722 src/FontManager.cpp, src/FontManager.h, src/VFActions.h,
3723 src/VFReader.cpp:
3724 transfer DVI snippet of a VF char by move semantics rather than by heap
3725 pointer
3726
3727 2016-07-02 Martin Gieseking <martin.gieseking@uos.de>
3728
3729 * src/Bitmap.cpp, src/BoundingBox.h, src/CMapManager.cpp,
3730 src/CmdLineParserBase.cpp, src/DVIToSVG.cpp, src/DVIToSVGActions.cpp,
3731 src/DVIToSVGActions.h, src/DependencyGraph.h,
3732 src/DvisvgmSpecialHandler.cpp, src/EmSpecialHandler.cpp,
3733 src/FileFinder.cpp, src/FilePath.cpp, src/FilePath.h, src/Font.cpp,
3734 src/FontCache.cpp, src/FontEncoding.cpp, src/FontManager.cpp,
3735 src/FontMap.cpp, src/FontMap.h, src/GFReader.cpp, src/GFReader.h,
3736 src/GraphicsPath.h, src/HtmlSpecialHandler.cpp, src/NumericRanges.h,
3737 src/PSPattern.cpp, src/PsSpecialHandler.cpp, src/SVGTree.cpp,
3738 src/SVGTree.h, src/SpecialManager.cpp, src/SpecialManager.h,
3739 src/Subfont.cpp, src/Subfont.h, src/TpicSpecialHandler.cpp,
3740 src/XMLDocument.cpp, src/XMLNode.cpp, src/XMLString.cpp, src/macros.h:
3741 use range-based 'for' loop to iterate over containers; drop FORALL macro
3742
3743 * clipper/clipper.hpp, src/BgColorSpecialHandler.h, src/Bitmap.cpp,
3744 src/CMap.h, src/CmdLineParserBase.h, src/ColorSpecialHandler.h,
3745 src/CommandLine.h, src/DVIReader.h, src/DVIToSVG.h,
3746 src/DVIToSVGActions.h, src/DvisvgmSpecialHandler.h, src/EPSToSVG.h,
3747 src/EmSpecialHandler.h, src/EncFile.h, src/Font.h, src/FontCache.cpp,
3748 src/FontEncoding.h, src/FontMetrics.h, src/GFGlyphTracer.h,
3749 src/GFReader.h, src/GFTracer.h, src/GlyphTracerMessages.h,
3750 src/GraphicsPath.h, src/HtmlSpecialHandler.h, src/InputBuffer.h,
3751 src/InputReader.h, src/JFM.h, src/MessageException.h,
3752 src/NoPsSpecialHandler.h, src/PSPattern.h, src/PSPreviewFilter.h,
3753 src/PapersizeSpecialHandler.h, src/PathClipper.cpp,
3754 src/PdfSpecialHandler.h, src/PreScanDVIReader.h,
3755 src/PsSpecialHandler.cpp, src/PsSpecialHandler.h,
3756 src/SVGCharPathHandler.h, src/SVGCharTspanTextHandler.h, src/SVGOutput.h,
3757 src/SVGSingleCharTextHandler.h, src/SpecialActions.h, src/TFM.h,
3758 src/TensorProductPatch.h, src/TpicSpecialHandler.h,
3759 src/TriangularPatch.h, src/VectorStream.h, src/XMLNode.h:
3760 mark overridden methods with 'override' keyword
3761
3762 * src/PsSpecialHandler.cpp:
3763 use unique_ptr rather than deprecated auto_ptr
3764
3765 * src/BasicDVIReader.h, src/Bitmap.h, src/CMap.h, src/CmdLineParserBase.h,
3766 src/DVIActions.h, src/Font.h, src/FontEncoding.h, src/FontMetrics.h,
3767 src/GFGlyphTracer.h, src/GFReader.h, src/GFTracer.h, src/GraphicsPath.h,
3768 src/InputBuffer.h, src/InputReader.h, src/MessageException.h,
3769 src/PSFilter.h, src/PSInterpreter.h, src/PSPattern.h,
3770 src/SVGCharHandler.h, src/SVGOutput.h, src/ShadingPatch.h,
3771 src/SpecialActions.h, src/SpecialHandler.h, src/StreamReader.h,
3772 src/StreamWriter.h, src/Subfont.h, src/VFActions.h, src/XMLNode.h:
3773 replaced empty virtual destructors with default ones
3774
3775 2016-07-01 Martin Gieseking <martin.gieseking@uos.de>
3776
3777 * src/BasicDVIReader.h, src/DVIActions.h, src/DVIReader.cpp,
3778 src/DVIReader.h, src/DVIToSVG.cpp, src/DVIToSVG.h,
3779 src/DVIToSVGActions.cpp, src/DVIToSVGActions.h, src/FontManager.cpp,
3780 src/FontManager.h, src/PreScanDVIReader.h, src/dvisvgm.cpp:
3781 refactored the DVI reader classes
3782 - added higher-level template methods
3783 to process the DVI commands more safely
3784 - moved triggering of DVIActions
3785 from DVIReader to DVIToSVG
3786
3787 2016-06-29 Martin Gieseking <martin.gieseking@uos.de>
3788
3789 * src/BoundingBox.cpp, src/BoundingBox.h, src/DVIToSVG.cpp,
3790 src/dvisvgm.cpp:
3791 fixed computation of bounding boxes modified by relative --bbox argument
3792
3793 * xxHash/xxhash.c, xxHash/xxhash.h:
3794 updated xxHash to version 0.6.1
3795
3796 2016-06-17 Martin Gieseking <martin.gieseking@uos.de>
3797
3798 * src/TFM.cpp, tests/JFMReaderTest.cpp, tests/TFMReaderTest.cpp:
3799 minor improvements to TFM/JFM tests
3800
3801 2016-06-16 Martin Gieseking <martin.gieseking@uos.de>
3802
3803 * src/DVIReader.cpp, src/VectorStream.h, tests/VectorStreamTest.cpp:
3804 refactored VectorStreamBuffer to keep constness of assigned vector
3805
3806 * src/GFReader.cpp:
3807 ensure validity of postpost command in GFReader::executePostamble()
3808
3809 2016-06-14 Martin Gieseking <martin.gieseking@uos.de>
3810
3811 * src/DvisvgmSpecialHandler.cpp, src/TFM.cpp, src/VFReader.cpp:
3812 replaced local definitions of pt2bp with Length::pt2bp
3813
3814 * src/XMLNode.h:
3815 added ouput operators for the XML node objects
3816
3817 * src/EmSpecialHandler.cpp, src/EmSpecialHandler.h,
3818 tests/EmSpecialTest.cpp, tests/Makefile.am:
3819 improved the emTeX special handler; added EmSpecialTest
3820
3821 * src/BoundingBox.cpp, src/BoundingBox.h, tests/BoundingBoxTest.cpp:
3822 fixed unit conversion in BoundingBox class
3823
3824 2016-06-13 Martin Gieseking <martin.gieseking@uos.de>
3825
3826 * doc/dvisvgm.txt.in, src/Length.cpp, src/Length.h, tests/LengthTest.cpp:
3827 added dd, cc, and sp units to class Length; fixed factor pt2pc
3828
3829 2016-06-12 Martin Gieseking <martin.gieseking@uos.de>
3830
3831 * xxHash/xxhash.c, xxHash/xxhash.h:
3832 updated xxHash to version 0.6.0
3833
3834 * src/DLLoader.cpp, src/DLLoader.h, src/Directory.cpp, src/Directory.h,
3835 src/FilePath.cpp, src/FilePath.h, src/FileSystem.cpp, src/GFTracer.cpp,
3836 src/Ghostscript.cpp, src/Ghostscript.h, src/Message.cpp,
3837 src/MetafontWrapper.cpp, src/Process.cpp, src/Terminal.cpp,
3838 src/Terminal.h, src/dvisvgm.cpp:
3839 cleaned up Windows-related #defines
3840
3841 2016-06-10 Martin Gieseking <martin.gieseking@uos.de>
3842
3843 * src/CommandLine.cpp:
3844 removed redundant #includes
3845
3846 * src/Length.cpp, src/Length.h, tests/LengthTest.cpp:
3847 added functions to convert between Length::Unit and std::string
3848
3849 2016-06-07 Martin Gieseking <martin.gieseking@uos.de>
3850
3851 * src/CMapManager.cpp, src/CMapManager.h, src/DVIActions.h,
3852 src/DVIToSVGActions.h, src/DvisvgmSpecialHandler.h, src/Font.h,
3853 src/FontEngine.h, src/FontManager.h, src/HtmlSpecialHandler.cpp,
3854 src/HtmlSpecialHandler.h, src/PSPattern.h, src/PSPreviewFilter.h,
3855 src/SVGCharHandler.cpp, src/SVGCharHandler.h, src/SVGCharPathHandler.cpp,
3856 src/SVGCharTspanTextHandler.cpp, src/SVGSingleCharTextHandler.cpp,
3857 src/SVGTree.h, src/SpecialActions.h, src/SpecialHandler.h,
3858 src/SpecialManager.h, src/XMLDocument.cpp, src/XMLNode.h,
3859 tests/XMLNodeTest.cpp:
3860 changed some structs to classes and replaced #includes with forward
3861 declarations
3862
3863 * src/SVGCharHandler.h:
3864 added missing initializer to class SVGCharHandler
3865
3866 2016-06-03 Martin Gieseking <martin.gieseking@uos.de>
3867
3868 * src/BgColorSpecialHandler.cpp, src/BgColorSpecialHandler.h,
3869 src/ColorSpecialHandler.cpp, src/ColorSpecialHandler.h, src/DVIToSVG.cpp,
3870 src/DVIToSVGActions.cpp, src/DvisvgmSpecialHandler.cpp,
3871 src/DvisvgmSpecialHandler.h, src/EPSToSVG.cpp, src/EmSpecialHandler.cpp,
3872 src/EmSpecialHandler.h, src/HtmlSpecialHandler.cpp,
3873 src/HtmlSpecialHandler.h, src/NoPsSpecialHandler.cpp,
3874 src/NoPsSpecialHandler.h, src/PSPattern.cpp, src/PSPattern.h,
3875 src/PdfSpecialHandler.cpp, src/PdfSpecialHandler.h,
3876 src/PsSpecialHandler.cpp, src/PsSpecialHandler.h, src/SpecialHandler.h,
3877 src/SpecialManager.cpp, src/SpecialManager.h, src/TpicSpecialHandler.cpp,
3878 src/TpicSpecialHandler.h, tests/ColorSpecialTest.cpp,
3879 tests/DvisvgmSpecialTest.cpp:
3880 refactored handling of SpecialAction objects
3881
3882 * src/DVIReader.cpp, src/DVIReader.h, src/DVIToSVG.cpp, src/DVIToSVG.h,
3883 src/DVIToSVGActions.cpp, src/DVIToSVGActions.h, src/SVGTree.cpp,
3884 src/SVGTree.h:
3885 refactored processing of end-of-page (eop) commands
3886
3887 * doc/dvisvgm.txt.in, src/DVIToSVG.cpp, src/Makefile.am,
3888 src/PapersizeSpecialHandler.cpp, src/PapersizeSpecialHandler.h,
3889 src/PsSpecialHandler.cpp, src/dvisvgm.cpp:
3890 added evaluation of PS special 'papersize='
3891
3892 2016-06-02 Martin Gieseking <martin.gieseking@uos.de>
3893
3894 * src/DVIToSVG.cpp:
3895 fixed transformation of background color rectange
3896
3897 2016-05-31 Martin Gieseking <martin.gieseking@uos.de>
3898
3899 * src/DVIToSVG.cpp, src/EPSToSVG.cpp:
3900 reworded messages printed after finishing a conversion
3901
3902 2016-05-30 Martin Gieseking <martin.gieseking@uos.de>
3903
3904 * src/DVIToSVGActions.cpp, src/Font.cpp, src/Makefile.am,
3905 src/SVGCharHandler.cpp, src/SVGCharHandler.h,
3906 src/SVGCharHandlerFactory.cpp, src/SVGCharHandlerFactory.h,
3907 src/SVGCharPathHandler.cpp, src/SVGCharPathHandler.h,
3908 src/SVGCharTspanTextHandler.cpp, src/SVGCharTspanTextHandler.h,
3909 src/SVGSingleCharTextHandler.cpp, src/SVGSingleCharTextHandler.h,
3910 src/SVGTree.cpp, src/SVGTree.h, src/dvisvgm.cpp:
3911 replaced static SVG text backend by specialized handler classes
3912
3913 * src/BasicDVIReader.cpp, src/BasicDVIReader.h, src/Bezier.h,
3914 src/TensorProductPatch.h, src/TriangularPatch.h:
3915 replaced leading spaces with tabs
3916
3917 2016-05-29 Martin Gieseking <martin.gieseking@uos.de>
3918
3919 * src/BasicDVIReader.cpp, src/DVIReader.cpp:
3920 fixed handling of subfont index in native font definition of XDV 7
3921
3922 2016-05-27 Martin Gieseking <martin.gieseking@uos.de>
3923
3924 * src/XMLDocument.cpp, src/XMLNode.cpp, src/XMLNode.h,
3925 tests/DvisvgmSpecialTest.cpp:
3926 prevent line wrapping inside text nodes
3927
3928 2016-05-26 Martin Gieseking <martin.gieseking@uos.de>
3929
3930 * README.md, doc/dvisvgm.txt.in, src/BasicDVIReader.cpp,
3931 src/BasicDVIReader.h, src/DVIReader.cpp, src/DVIToSVG.cpp:
3932 reworded 'DVI format' to 'DVI (format) version'
3933
3934 * README.md, doc/dvisvgm.txt.in, src/BasicDVIReader.cpp,
3935 src/BasicDVIReader.h, src/DVIReader.cpp:
3936 added support for XDV version 7 introduced by XeTeX 0.99995
3937
3938 2016-05-25 Martin Gieseking <martin.gieseking@uos.de>
3939
3940 * src/TFM.cpp:
3941 prevent reading more than 7 TFM param values (fixes #58)
3942
3943 * .travis.yml:
3944 temporarily drop clang from Travis builds
3945
3946 2016-05-24 Martin Gieseking <martin.gieseking@uos.de>
3947
3948 * src/JFM.cpp, src/JFM.h, src/TFM.cpp, src/TFM.h:
3949 TFM: store design size in bp units rather than as fixword
3950
3951 * src/FontMetrics.h, src/JFM.cpp, src/TFM.cpp, src/TFM.h:
3952 added methods to query space-related parameters from TFM/JFM files
3953
3954 * src/TFM.cpp, tests/JFMReaderTest.cpp, tests/TFMReaderTest.cpp:
3955 fixed calculation of character dimensions in TFM class
3956
3957 2016-04-22 Martin Gieseking <martin.gieseking@uos.de>
3958
3959 * src/Process.cpp:
3960 fixed collecting stdout/stderr output when executing a process
3961
3962 2016-04-20 Martin Gieseking <martin.gieseking@uos.de>
3963
3964 * src/CMap.h, src/CMapReader.cpp, tests/CMapManagerTest.cpp,
3965 tests/Makefile.am, tests/data/Makefile.am, tests/data/ot1.cmap:
3966 added CMapManagerTest
3967
3968 2016-04-19 Martin Gieseking <martin.gieseking@uos.de>
3969
3970 * .travis.yml, configure.ac, src/Doxyfile:
3971 set version to 1.15.1
3972
3973 * NEWS, README, README.md:
3974 updated NEWS and README
3975
3976 2016-04-18 Martin Gieseking <martin.gieseking@uos.de>
3977
3978 * src/Calculator.cpp, src/Matrix.cpp:
3979 use std::ws to skip whitespace in istreams
3980
3981 * src/Matrix.cpp:
3982 avoid adding trailing EOF characters when parsing parameters of
3983 transformation commands
3984
3985 * tests/CMapReaderTest.cpp:
3986 improved CMapReaderTest
3987
3988 2016-04-11 Martin Gieseking <martin.gieseking@uos.de>
3989
3990 * src/AGLTable.h, src/Makefile.am, src/Unicode.cpp, tests/Makefile.am,
3991 tests/create-makefile, tests/genhashcheck.py:
3992 moved AGL hash table from Unicode.cpp to a separate file
3993
3994 2016-04-07 Martin Gieseking <martin.gieseking@uos.de>
3995
3996 * src/XMLDocument.cpp:
3997 explicitly specify UTF-8 encoding in XML declaration (closes #54)
3998
3999 * src/Unicode.cpp, tests/UnicodeTest.cpp:
4000 added support for the AGL character names 'uniFOO' and 'uFOO'
4001
4002 2016-03-17 Martin Gieseking <martin.gieseking@uos.de>
4003
4004 * src/GraphicsPath.h:
4005 renamed GraphicsPath::sconito/scubicto
4006
4007 2016-03-14 Martin Gieseking <martin.gieseking@uos.de>
4008
4009 * doc/db2html.xsl:
4010 adapted db2html to insert anchors for each option entry
4011
4012 * src/DVIActions.h, src/DVIReader.cpp, src/DVIToSVGActions.cpp,
4013 src/DVIToSVGActions.h, src/SVGTree.cpp, src/SVGTree.h:
4014 changed font parameter of setFont() methods from pointer to reference
4015
4016 * src/SVGTree.cpp, src/SVGTree.h:
4017 split text and path section of SVGTree::appendChar() into seperate
4018 methods
4019
4020 2016-02-27 Martin Gieseking <martin.gieseking@uos.de>
4021
4022 * NEWS:
4023 updated NEWS
4024
4025 2016-02-26 Martin Gieseking <martin.gieseking@uos.de>
4026
4027 * doc/dvisvgm.txt.in, src/CommandLine.cpp, src/CommandLine.h,
4028 src/Font.cpp, src/Font.h, src/SVGTree.cpp, src/SVGTree.h,
4029 src/dvisvgm.cpp, src/options.xml:
4030 added option --comments (adds comments with additional information to
4031 the SVG file
4032
4033 * src/Font.cpp, src/Unicode.cpp, src/Unicode.h, tests/UnicodeTest.cpp:
4034 renamed Unicode::psNameToCodepoint() to Unicode::aglNameToCodepoint
4035
4036 * src/FileFinder.cpp, src/FilePath.cpp, src/FileSystem.cpp,
4037 src/FileSystem.h, src/Font.cpp, src/MetafontWrapper.cpp, src/dvisvgm.cpp:
4038 changed string parameters of FileSystem functions to type std::string
4039
4040 * .travis.yml, configure.ac, src/Doxyfile:
4041 set version to 1.15
4042
4043 2016-02-23 Martin Gieseking <martin.gieseking@uos.de>
4044
4045 * src/FontEngine.cpp:
4046 reworded error messages of class FontEngine
4047
4048 * src/MetafontWrapper.cpp, src/Process.cpp:
4049 avoid reading Metafont logfiles to extract the GF filename
4050
4051 * configure.ac, src/FileFinder.cpp, src/FileFinder.h,
4052 tests/FileFinderTest.cpp, tests/GFGlyphTracerTest.cpp,
4053 tests/GFReaderTest.cpp, tests/JFMReaderTest.cpp, tests/Makefile.am,
4054 tests/TFMReaderTest.cpp, tests/cidjmgr0-h.tfm, tests/cmr10.600gf,
4055 tests/cmr10.tfm, tests/create-makefile, tests/data/Makefile.am,
4056 tests/data/cidjmgr0-h.tfm, tests/data/cmr10.600gf, tests/data/cmr10.tfm,
4057 tests/data/dvipdfm_test.map, tests/data/dvips_test.map,
4058 tests/data/frktest-nf-cmp.svg, tests/data/frktest-wf-cmp.svg,
4059 tests/data/frktest.dvi, tests/data/sample-nf-cmp.svg,
4060 tests/data/sample-wf-cmp.svg, tests/data/sample.dvi,
4061 tests/data/sample.sfd, tests/dvipdfm_test.map, tests/dvips_test.map,
4062 tests/frktest-nf-cmp.svg, tests/frktest-wf-cmp.svg, tests/frktest.dvi,
4063 tests/sample-nf-cmp.svg, tests/sample-wf-cmp.svg, tests/sample.dvi,
4064 tests/sample.sfd:
4065 moved test data files to subfolder
4066
4067 2016-02-22 Martin Gieseking <martin.gieseking@uos.de>
4068
4069 * tests/FileFinderTest.cpp, tests/GFReaderTest.cpp,
4070 tests/SVGOutputTest.cpp:
4071 avoid implicit casts of ifstream/ozstream objects in tests
4072
4073 * src/CmdLineParserBase.cpp, src/CmdLineParserBase.h,
4074 tests/CommandLineTest.cpp:
4075 minor improvements of class CommandLineTest
4076
4077 * src/XMLNode.cpp, tests/DvisvgmSpecialTest.cpp:
4078 improved DvisvgmSpecialTest
4079
4080 * src/FontEngine.cpp, src/FontEngine.h:
4081 removed redundant code from class FontEngine
4082
4083 2016-02-05 Martin Gieseking <martin.gieseking@uos.de>
4084
4085 * src/PsSpecialHandler.cpp:
4086 don't remove clipping paths that consist of single moveto commands only
4087
4088 2016-02-01 Martin Gieseking <martin.gieseking@uos.de>
4089
4090 * src/Bitmap.cpp, src/BoundingBox.cpp, src/CMap.cpp, src/CMapManager.cpp,
4091 src/Calculator.cpp, src/CommandLine.cpp, src/DVIReader.cpp,
4092 src/DVIToSVG.cpp, src/DVIToSVG.h, src/DVIToSVGActions.cpp,
4093 src/Directory.cpp, src/Directory.h, src/EPSToSVG.cpp, src/EncFile.cpp,
4094 src/FileFinder.cpp, src/Font.cpp, src/FontCache.h, src/FontEngine.cpp,
4095 src/FontManager.cpp, src/FontMap.cpp, src/FontMetrics.cpp,
4096 src/GFGlyphTracer.cpp, src/GFReader.cpp, src/GFTracer.cpp,
4097 src/HtmlSpecialHandler.cpp, src/InputReader.cpp, src/MapLine.cpp,
4098 src/MetafontWrapper.cpp, src/PSInterpreter.cpp,
4099 src/PdfSpecialHandler.cpp, src/Process.cpp, src/PsSpecialHandler.cpp,
4100 src/SVGTree.cpp, src/SpecialManager.cpp, src/StreamReader.cpp,
4101 src/StreamWriter.cpp, src/Subfont.cpp, src/TFM.cpp,
4102 src/TensorProductPatch.cpp, src/TpicSpecialHandler.cpp, src/VFReader.cpp,
4103 src/XMLDocument.cpp, src/dvisvgm.cpp, tests/XMLStringTest.cpp:
4104 minor code cleanup (removed redundant includes, added casts)
4105
4106 2016-01-21 Martin Gieseking <martin.gieseking@uos.de>
4107
4108 * m4/ax_code_coverage.m4:
4109 updated m4 code coverage script to latest version
4110
4111 * src/JFM.h, tests/JFMReaderTest.cpp, tests/Makefile.am,
4112 tests/TFMReaderTest.cpp, tests/cidjmgr0-h.tfm, tests/cmr10.tfm,
4113 tests/create-makefile:
4114 added tests for the TFM and JFM classes
4115
4116 2016-01-19 Martin Gieseking <martin.gieseking@uos.de>
4117
4118 * src/GraphicsPath.h, tests/GraphicsPathTest.cpp:
4119 fixed access of invalid iterator
4120
4121 * .travis.yml, configure.ac, src/Doxyfile:
4122 set version to 1.14.2
4123
4124 * NEWS, README.md:
4125 updated NEWS
4126
4127 2016-01-18 Martin Gieseking <martin.gieseking@uos.de>
4128
4129 * doc/dvisvgm.txt.in:
4130 added generic info about the command-line interface to the manpage
4131
4132 * doc/db2html.xsl:
4133 updated links to Bootstrap and Font Awesome in stylesheet db2html.xsl
4134
4135 * src/dvisvgm.cpp, xxHash/xxhash.c, xxHash/xxhash.h:
4136 updated xxHash to version 0.5.0
4137
4138 * tests/Makefile.am, tests/create-makefile, tests/genhashcheck.py:
4139 added test to check the validity of the char name hashes used in
4140 Unicode.cpp
4141
4142 2016-01-15 Martin Gieseking <martin.gieseking@uos.de>
4143
4144 * src/BgColorSpecialHandler.cpp, src/ColorSpecialHandler.cpp,
4145 src/ColorSpecialHandler.h, tests/ColorSpecialTest.cpp:
4146 removed check for 'background' special from ColorSpecialHandler
4147
4148 2016-01-13 Martin Gieseking <martin.gieseking@uos.de>
4149
4150 * src/DVIReader.h, src/FontStyle.h, src/SVGTree.cpp,
4151 src/TriangularPatch.cpp:
4152 updated/fixed some comments
4153
4154 * src/BgColorSpecialHandler.cpp, src/BgColorSpecialHandler.h,
4155 src/ColorSpecialHandler.cpp, src/ColorSpecialHandler.h, src/DVIToSVG.cpp,
4156 src/SpecialHandler.h, src/SpecialManager.cpp, src/SpecialManager.h:
4157 corrected handling of background color special across DVI pages
4158
4159 2016-01-05 Martin Gieseking <martin.gieseking@uos.de>
4160
4161 * src/GFReader.cpp, src/GFReader.h:
4162 added checks for misplaced GF commands
4163
4164 * NEWS:
4165 updated NEWS
4166
4167 2016-01-04 Martin Gieseking <martin.gieseking@uos.de>
4168
4169 * .travis.yml:
4170 force Travis to use legacy builds due to an issue with clang and gtest
4171
4172 * Makefile.am, README, README.md, configure.ac, doc/Makefile.am,
4173 doc/conf-dblatex-man.xsl, doc/conf-dblatex-pdf.xsl, doc/db2html.xsl,
4174 doc/dvisvgm.txt.in, src/BasicDVIReader.cpp, src/BasicDVIReader.h,
4175 src/Bezier.cpp, src/Bezier.h, src/BgColorSpecialHandler.cpp,
4176 src/BgColorSpecialHandler.h, src/Bitmap.cpp, src/Bitmap.h,
4177 src/BoundingBox.cpp, src/BoundingBox.h, src/CMap.cpp, src/CMap.h,
4178 src/CMapManager.cpp, src/CMapManager.h, src/CMapReader.cpp,
4179 src/CMapReader.h, src/CRC32.cpp, src/CRC32.h, src/Calculator.cpp,
4180 src/Calculator.h, src/CharMapID.cpp, src/CharMapID.h, src/Character.h,
4181 src/CmdLineParserBase.cpp, src/CmdLineParserBase.h, src/Color.cpp,
4182 src/Color.h, src/ColorSpecialHandler.cpp, src/ColorSpecialHandler.h,
4183 src/CommandLine.cpp, src/CommandLine.h, src/DLLoader.cpp, src/DLLoader.h,
4184 src/DVIActions.h, src/DVIReader.cpp, src/DVIReader.h, src/DVIToSVG.cpp,
4185 src/DVIToSVG.h, src/DVIToSVGActions.cpp, src/DVIToSVGActions.h,
4186 src/DependencyGraph.h, src/Directory.cpp, src/Directory.h,
4187 src/DvisvgmSpecialHandler.cpp, src/DvisvgmSpecialHandler.h,
4188 src/EPSFile.cpp, src/EPSFile.h, src/EPSToSVG.cpp, src/EPSToSVG.h,
4189 src/EmSpecialHandler.cpp, src/EmSpecialHandler.h, src/EncFile.cpp,
4190 src/EncFile.h, src/FileFinder.cpp, src/FileFinder.h, src/FilePath.cpp,
4191 src/FilePath.h, src/FileSystem.cpp, src/FileSystem.h, src/Font.cpp,
4192 src/Font.h, src/FontCache.cpp, src/FontCache.h, src/FontEncoding.cpp,
4193 src/FontEncoding.h, src/FontEngine.cpp, src/FontEngine.h,
4194 src/FontManager.cpp, src/FontManager.h, src/FontMap.cpp, src/FontMap.h,
4195 src/FontMetrics.cpp, src/FontMetrics.h, src/GFGlyphTracer.cpp,
4196 src/GFGlyphTracer.h, src/GFReader.cpp, src/GFReader.h, src/GFTracer.cpp,
4197 src/GFTracer.h, src/Ghostscript.cpp, src/Ghostscript.h, src/Glyph.h,
4198 src/GlyphTracerMessages.h, src/GraphicsPath.h,
4199 src/HtmlSpecialHandler.cpp, src/HtmlSpecialHandler.h,
4200 src/InputBuffer.cpp, src/InputBuffer.h, src/InputReader.cpp,
4201 src/InputReader.h, src/JFM.cpp, src/JFM.h, src/Length.cpp, src/Length.h,
4202 src/Makefile.am, src/MapLine.cpp, src/MapLine.h, src/Matrix.cpp,
4203 src/Matrix.h, src/Message.cpp, src/Message.h, src/MessageException.h,
4204 src/MetafontWrapper.cpp, src/MetafontWrapper.h, src/MiKTeXCom.cpp,
4205 src/MiKTeXCom.h, src/NoPsSpecialHandler.cpp, src/NoPsSpecialHandler.h,
4206 src/NumericRanges.h, src/PSFilter.h, src/PSInterpreter.cpp,
4207 src/PSInterpreter.h, src/PSPattern.cpp, src/PSPattern.h,
4208 src/PSPreviewFilter.cpp, src/PSPreviewFilter.h, src/PageRanges.cpp,
4209 src/PageRanges.h, src/PageSize.cpp, src/PageSize.h, src/Pair.h,
4210 src/PathClipper.cpp, src/PathClipper.h, src/PdfSpecialHandler.cpp,
4211 src/PdfSpecialHandler.h, src/PreScanDVIReader.cpp,
4212 src/PreScanDVIReader.h, src/Process.cpp, src/Process.h,
4213 src/PsSpecialHandler.cpp, src/PsSpecialHandler.h, src/RangeMap.cpp,
4214 src/RangeMap.h, src/SVGOutput.cpp, src/SVGOutput.h, src/SVGTree.cpp,
4215 src/SVGTree.h, src/ShadingPatch.cpp, src/ShadingPatch.h,
4216 src/SignalHandler.cpp, src/SignalHandler.h, src/SpecialActions.h,
4217 src/SpecialHandler.h, src/SpecialManager.cpp, src/SpecialManager.h,
4218 src/StreamReader.cpp, src/StreamReader.h, src/StreamWriter.cpp,
4219 src/StreamWriter.h, src/Subfont.cpp, src/Subfont.h, src/System.cpp,
4220 src/System.h, src/TFM.cpp, src/TFM.h, src/TensorProductPatch.cpp,
4221 src/TensorProductPatch.h, src/Terminal.cpp, src/Terminal.h,
4222 src/ToUnicodeMap.cpp, src/ToUnicodeMap.h, src/TpicSpecialHandler.cpp,
4223 src/TpicSpecialHandler.h, src/TriangularPatch.cpp, src/TriangularPatch.h,
4224 src/Unicode.cpp, src/Unicode.h, src/VFActions.h, src/VFReader.cpp,
4225 src/VFReader.h, src/VectorIterator.h, src/VectorStream.h,
4226 src/XMLDocument.cpp, src/XMLDocument.h, src/XMLNode.cpp, src/XMLNode.h,
4227 src/XMLString.cpp, src/XMLString.h, src/dvisvgm.cpp, src/macros.h,
4228 src/options.dtd, src/options.xml, src/psdefs.cpp, src/types.h,
4229 tests/BezierTest.cpp, tests/BitmapTest.cpp, tests/BoundingBoxTest.cpp,
4230 tests/CMapReaderTest.cpp, tests/CMapTest.cpp, tests/CRC32Test.cpp,
4231 tests/CalculatorTest.cpp, tests/ColorSpecialTest.cpp,
4232 tests/ColorTest.cpp, tests/CommandLineTest.cpp,
4233 tests/DependencyGraphTest.cpp, tests/DirectoryTest.cpp,
4234 tests/DvisvgmSpecialTest.cpp, tests/FileFinderTest.cpp,
4235 tests/FilePathTest.cpp, tests/FileSystemTest.cpp,
4236 tests/FontManagerTest.cpp, tests/FontMapTest.cpp,
4237 tests/GFGlyphTracerTest.cpp, tests/GFReaderTest.cpp,
4238 tests/GraphicsPathTest.cpp, tests/LengthTest.cpp, tests/Makefile.am,
4239 tests/MapLineTest.cpp, tests/MatrixTest.cpp,
4240 tests/MessageExceptionTest.cpp, tests/PSInterpreterTest.cpp,
4241 tests/PageRagesTest.cpp, tests/PageSizeTest.cpp, tests/PairTest.cpp,
4242 tests/RangeMapTest.cpp, tests/SVGOutputTest.cpp,
4243 tests/ShadingPatchTest.cpp, tests/SplittedCharInputBufferTest.cpp,
4244 tests/StreamInputBufferTest.cpp, tests/StreamReaderTest.cpp,
4245 tests/StreamWriterTest.cpp, tests/SubfontTest.cpp,
4246 tests/TensorProductPatchTest.cpp, tests/ToUnicodeMapTest.cpp,
4247 tests/TriangularPatchTest.cpp, tests/TypesTest.cpp,
4248 tests/UnicodeTest.cpp, tests/VectorIteratorTest.cpp,
4249 tests/VectorStreamTest.cpp, tests/XMLNodeTest.cpp,
4250 tests/XMLStringTest.cpp, tests/check-conv, tests/create-makefile,
4251 tests/normalize.xsl:
4252 updated year in copyright statements to 2016
4253
4254 * .travis.yml, configure.ac, src/Doxyfile:
4255 set version to 1.14.1
4256
4257 2015-12-31 Martin Gieseking <martin.gieseking@uos.de>
4258
4259 * src/PsSpecialHandler.cpp, src/PsSpecialHandler.h:
4260 reset PS graphics state at end of every DVI page
4261
4262 2015-12-28 Martin Gieseking <martin.gieseking@uos.de>
4263
4264 * .travis.yml, configure.ac, src/Doxyfile:
4265 set version to 1.14
4266
4267 * NEWS:
4268 updated NEWS
4269
4270 2015-12-27 Martin Gieseking <martin.gieseking@uos.de>
4271
4272 * src/PsSpecialHandler.cpp:
4273 added evaluation of PSTricks specials 'pst:' and 'PST:'
4274
4275 2015-12-26 Martin Gieseking <martin.gieseking@uos.de>
4276
4277 * src/FileFinder.cpp:
4278 lookup files in the current working directory before searching the texmf
4279 tree
4280
4281 * src/GraphicsPath.h, tests/GraphicsPathTest.cpp:
4282 fixed memory issue in class GraphicsPath<T>
4283
4284 2015-12-17 Martin Gieseking <martin.gieseking@uos.de>
4285
4286 * doc/dvisvgm.txt.in, src/DVIToSVG.cpp, src/DVIToSVG.h,
4287 src/DVIToSVGActions.cpp, src/DVIToSVGActions.h, src/EPSToSVG.h,
4288 src/PSPreviewFilter.cpp, src/PSPreviewFilter.h, src/PsSpecialHandler.cpp,
4289 src/SpecialActions.h, src/dvisvgm.cpp:
4290 added option --bbox=preview; adapt preview data if --bbox=min
4291
4292 2015-12-09 Martin Gieseking <martin.gieseking@uos.de>
4293
4294 * src/FileFinder.cpp:
4295 return entire kpathsea version string if it doesn't start with
4296 'kpathsea'
4297
4298 * tests/GhostscriptTest.cpp:
4299 prevent opening a graphics window when running GhostscriptTest
4300
4301 2015-12-08 Martin Gieseking <martin.gieseking@uos.de>
4302
4303 * .travis.yml, configure.ac, src/Doxyfile:
4304 set version to 1.13
4305
4306 * NEWS:
4307 updated NEWS
4308
4309 * clipper/clipper.cpp, clipper/clipper.hpp:
4310 replaced DOS line endings of the Clipper sources to Unix ones
4311
4312 2015-12-02 Martin Gieseking <martin.gieseking@uos.de>
4313
4314 * src/Font.cpp, src/Font.h, src/Glyph.h, src/GraphicPath.h,
4315 src/GraphicsPath.h, src/Makefile.am, src/PathClipper.h,
4316 src/PsSpecialHandler.cpp, src/PsSpecialHandler.h, src/ShadingPatch.h,
4317 src/TensorProductPatch.cpp, src/TensorProductPatch.h,
4318 src/TpicSpecialHandler.cpp, src/TriangularPatch.cpp,
4319 src/TriangularPatch.h, tests/GraphicPathTest.cpp,
4320 tests/GraphicsPathTest.cpp, tests/Makefile.am,
4321 tests/TensorProductPatchTest.cpp, tests/TriangularPatchTest.cpp:
4322 renamed class GraphicPath to GraphicsPath
4323
4324 2015-11-30 Martin Gieseking <martin.gieseking@uos.de>
4325
4326 * doc/dvisvgm.txt.in:
4327 added a couple of links to the manpage
4328
4329 * src/GraphicPath.h, src/PsSpecialHandler.cpp:
4330 remove redundant moveto commands from graphics paths
4331
4332 2015-11-25 Martin Gieseking <martin.gieseking@uos.de>
4333
4334 * src/DVIToSVGActions.cpp, src/EPSToSVG.cpp:
4335 remove progress message before printing a PS error message
4336
4337 * src/DVIToSVGActions.cpp, src/DVIToSVGActions.h:
4338 removed redundant methods
4339
4340 2015-11-24 Martin Gieseking <martin.gieseking@uos.de>
4341
4342 * src/psdefs.cpp:
4343 added evaluation of PS operators ashow, awidthshow, and widthshow (fixes
4344 #49)
4345
4346 * xxHash/xxhash.c:
4347 updated xxHash to version r42
4348
4349 2015-11-23 Martin Gieseking <martin.gieseking@uos.de>
4350
4351 * src/PsSpecialHandler.cpp, src/psdefs.cpp:
4352 minor code cleanup and reordering
4353
4354 * src/psdefs.cpp:
4355 reduce rounding errors produced by PS operator 'charpath'
4356
4357 * src/psdefs.cpp:
4358 propagate call of PS operator 'setcolor' to the PS handler
4359
4360 2015-11-18 Martin Gieseking <martin.gieseking@uos.de>
4361
4362 * .travis.yml, configure.ac, src/Doxyfile:
4363 set version to 1.12
4364
4365 * NEWS:
4366 updated NEWS
4367
4368 2015-11-16 Martin Gieseking <martin.gieseking@uos.de>
4369
4370 * src/FontManager.cpp:
4371 removed redundant #include
4372
4373 * src/FontEngine.cpp:
4374 treat character code as character index if no font mapping is set
4375
4376 2015-11-12 Martin Gieseking <martin.gieseking@uos.de>
4377
4378 * README, README.md:
4379 updated links to Google Test framework
4380
4381 2015-11-09 Martin Gieseking <martin.gieseking@uos.de>
4382
4383 * src/Color.cpp, src/Color.h, src/ColorSpecialHandler.cpp,
4384 src/HtmlSpecialHandler.cpp, tests/ColorTest.cpp:
4385 renamed Color::setName() to Color::setPSName()
4386
4387 * tests/Makefile.am, tests/ShadingPatch.cpp, tests/ShadingPatchTest.cpp:
4388 renamed ShadingPatchTest
4389
4390 * doc/dvisvgm.txt.in, src/Color.cpp, src/Color.h, src/CommandLine.cpp,
4391 src/CommandLine.h, src/DVIToSVGActions.cpp,
4392 src/DvisvgmSpecialHandler.cpp, src/EmSpecialHandler.cpp,
4393 src/HtmlSpecialHandler.cpp, src/PSPattern.cpp, src/PsSpecialHandler.cpp,
4394 src/SVGTree.cpp, src/TpicSpecialHandler.cpp, src/dvisvgm.cpp,
4395 src/options.xml, tests/ColorTest.cpp:
4396 added option --colornames to replace RGB color values with SVG color
4397 names
4398
4399 2015-10-27 Martin Gieseking <martin.gieseking@uos.de>
4400
4401 * src/Process.cpp, src/Process.h:
4402 fixed invalid access to freed string memory
4403
4404 2015-10-06 Martin Gieseking <martin.gieseking@uos.de>
4405
4406 * doc/dvisvgm.txt.in:
4407 minor improvements of the manual page
4408
4409 2015-09-21 Martin Gieseking <martin.gieseking@uos.de>
4410
4411 * NEWS, README, README.md:
4412 updated NEWS and README files
4413
4414 2015-09-18 Martin Gieseking <martin.gieseking@uos.de>
4415
4416 * .travis.yml, configure.ac, src/Doxyfile:
4417 set version to 1.11
4418
4419 2015-09-14 Martin Gieseking <martin.gieseking@uos.de>
4420
4421 * src/Font.cpp, src/ToUnicodeMap.cpp, src/Unicode.cpp, src/Unicode.h,
4422 tests/UnicodeTest.cpp:
4423 improved handling of invalid Unicode points
4424
4425 * src/Font.cpp, src/Unicode.cpp, src/Unicode.h, tests/UnicodeTest.cpp:
4426 renamed Unicode::psName2Codepoint to Unicode::psNameToCodepoint
4427
4428 2015-09-10 Martin Gieseking <martin.gieseking@uos.de>
4429
4430 * src/Font.cpp:
4431 prevent creating 0x00 codepoints if PS character name is unknown
4432
4433 * src/HtmlSpecialHandler.cpp:
4434 quote XML metacharacters in xlink:title attributes
4435
4436 * src/CmdLineParserBase.h, src/InputReader.h:
4437 changed 'struct InputReader' to 'class InputReader'
4438
4439 2015-09-09 Martin Gieseking <martin.gieseking@uos.de>
4440
4441 * src/SVGTree.cpp:
4442 force creating a new text element after appending a different node to
4443 the page
4444
4445 2015-08-13 Martin Gieseking <martin.gieseking@uos.de>
4446
4447 * README, README.md:
4448 minor updates to README and README.md
4449
4450 2015-07-29 Martin Gieseking <martin.gieseking@uos.de>
4451
4452 * tests/GhostscriptTest.cpp, tests/Makefile.am:
4453 added GhostscriptTest
4454
4455 * tests/UnicodeTest.cpp:
4456 improved UnicodeTest
4457
4458 * tests/CommandLineTest.cpp, tests/MessageExceptionTest.cpp:
4459 use ASSERT_STREQ in tests
4460
4461 2015-07-22 Martin Gieseking <martin.gieseking@uos.de>
4462
4463 * README, README.md, doc/dvisvgm.txt.in:
4464 updated links to project website again (relocated to
4465 dvisvgm.bplaced.net)
4466
4467 2015-07-20 Martin Gieseking <martin.gieseking@uos.de>
4468
4469 * README, README.md, doc/dvisvgm.txt.in:
4470 updated info about new project website
4471
4472 2015-07-14 Martin Gieseking <martin.gieseking@uos.de>
4473
4474 * .travis.yml, configure.ac, src/Doxyfile:
4475 set version to 1.10
4476
4477 * NEWS:
4478 updated NEWS
4479
4480 2015-07-12 Martin Gieseking <martin.gieseking@uos.de>
4481
4482 * README.md, doc/dvisvgm.txt.in, src/BasicDVIReader.cpp,
4483 src/BasicDVIReader.h, src/DVIReader.cpp, src/DVIReader.h, src/Font.h,
4484 src/FontManager.cpp, src/FontManager.h:
4485 added support for new XDV format 6
4486
4487 2015-07-11 Martin Gieseking <martin.gieseking@uos.de>
4488
4489 * README, README.md:
4490 updated README
4491
4492 2015-07-03 Martin Gieseking <martin.gieseking@uos.de>
4493
4494 * src/dvisvgm.cpp:
4495 check for option --help before initializing the FileFinder
4496
4497 * src/MiKTeXCom.cpp:
4498 added some comments to MiKTeXCom.cpp
4499
4500 2015-07-02 Martin Gieseking <martin.gieseking@uos.de>
4501
4502 * tests/BezierTest.cpp:
4503 removed #include "debug.h" from test
4504
4505 * Makefile.am, configure.ac, xxHash/LICENSE, xxHash/Makefile.am,
4506 xxHash/xxhash.c, xxHash/xxhash.h:
4507 added xxHash library (https://github.com/Cyan4973/xxHash)
4508
4509 * src/Font.cpp, src/Makefile.am, src/Unicode.cpp, src/Unicode.h,
4510 tests/Makefile.am, tests/create-makefile:
4511 added mapping from character names to unicode for PostScript fonts
4512
4513 2015-04-07 Martin Gieseking <martin.gieseking@uos.de>
4514
4515 * .travis.yml, configure.ac, src/Doxyfile:
4516 set version to 1.9.2
4517
4518 * NEWS, README.md:
4519 updated NEWS and README.md
4520
4521 * src/SVGTree.cpp:
4522 apply --precision settings to font-size attributes too
4523
4524 2015-04-04 Martin Gieseking <martin.gieseking@uos.de>
4525
4526 * tests/SVGOutputTest.cpp:
4527 remove output files created by SVGOutputTest::getPageStream()
4528
4529 2015-04-02 Martin Gieseking <martin.gieseking@uos.de>
4530
4531 * README.md:
4532 minor additions to README.md
4533
4534 2015-03-26 Martin Gieseking <martin.gieseking@uos.de>
4535
4536 * src/GlyphTracerMessages.h:
4537 always skip tracer message if no glyphs have been traced
4538
4539 * src/GFReader.cpp, src/GFReader.h, tests/GFReaderTest.cpp:
4540 improved GFReaderTest
4541
4542 2015-03-25 Martin Gieseking <martin.gieseking@uos.de>
4543
4544 * src/GFGlyphTracer.cpp, src/GFTracer.h, tests/GFGlyphTracerTest.cpp,
4545 tests/Makefile.am:
4546 ensure GFGlyphTracer::executeChar() returns the correct status; added
4547 GFGlyphtracerTest
4548
4549 * src/DVIToSVG.cpp:
4550 avoid retracing of fonts if option --no-fonts is given
4551
4552 2015-03-22 Martin Gieseking <martin.gieseking@uos.de>
4553
4554 * tests/StreamWriterTest.cpp:
4555 fixed StreamWriterTest
4556
4557 * tests/SVGOutputTest.cpp:
4558 improved SVGOutputTest
4559
4560 2015-03-19 Martin Gieseking <martin.gieseking@uos.de>
4561
4562 * tests/Makefile.am, tests/ShadingPatch.cpp:
4563 added ShadingPatchTest
4564
4565 2015-03-18 Martin Gieseking <martin.gieseking@uos.de>
4566
4567 * src/ShadingPatch.h, src/TensorProductPatch.cpp,
4568 src/TensorProductPatch.h, src/TriangularPatch.cpp, src/TriangularPatch.h,
4569 tests/Makefile.am, tests/TriangularPatchTest.cpp:
4570 added test for class TriangularPatch
4571
4572 * src/Bezier.cpp, src/Bezier.h, src/TensorProductPatch.cpp,
4573 src/TriangularPatch.cpp, src/TriangularPatch.h,
4574 tests/TriangularPatchTest.cpp:
4575 renamed method pointAt() of class Bezier and TriangularPatch to
4576 valueAt()
4577
4578 * src/TensorProductPatch.h, tests/TensorProductPatchTest.cpp:
4579 improved TensorProductPatchTest
4580
4581 2015-03-17 Martin Gieseking <martin.gieseking@uos.de>
4582
4583 * m4/ax_code_coverage.m4:
4584 added missing file ax_code_coverage.m4
4585
4586 * autogen.sh:
4587 updated autogen.sh
4588
4589 2015-03-15 Martin Gieseking <martin.gieseking@uos.de>
4590
4591 * src/XMLNode.cpp, src/XMLNode.h, tests/Makefile.am,
4592 tests/XMLNodeTest.cpp:
4593 fixed a few issues in class XMLElementNode; added XMLNodeTest
4594
4595 * .gitignore, Makefile.am, clipper/Makefile.am, configure.ac,
4596 src/Makefile.am, tests/Makefile.am, tests/create-makefile:
4597 extended build system to generate coverage reports
4598
4599 * tests/Makefile.am, tests/VectorIteratorTest.cpp:
4600 added VectorIteratorTest
4601
4602 2015-03-13 Martin Gieseking <martin.gieseking@uos.de>
4603
4604 * tests/XMLStringTest.cpp:
4605 fixed test class name of XMLString
4606
4607 2015-03-09 Martin Gieseking <martin.gieseking@uos.de>
4608
4609 * tests/CRC32Test.cpp:
4610 added test for 'compute' methods of class CRC32
4611
4612 * tests/GraphicPathTest.cpp:
4613 extended tests of class GraphicPath
4614
4615 2015-03-08 Martin Gieseking <martin.gieseking@uos.de>
4616
4617 * src/Unicode.cpp, tests/Makefile.am, tests/UnicodeTest.cpp:
4618 fixed UTF-8 encoding of 0xfffe and 0xffff; added UnicodeTest
4619
4620 * tests/StreamReaderTest.cpp:
4621 exteded StreamReader tests
4622
4623 2015-03-07 Martin Gieseking <martin.gieseking@uos.de>
4624
4625 * src/XMLString.cpp, tests/Makefile.am, tests/XMLStringTest.cpp:
4626 fixed conversion from C and C++ strings to XMLString; added
4627 XMLStringTest
4628
4629 * .gitignore:
4630 added .gitignore
4631
4632 2015-03-06 Martin Gieseking <martin.gieseking@uos.de>
4633
4634 * src/Bitmap.cpp, src/Bitmap.h, tests/BitmapTest.cpp,
4635 tests/GFReaderTest.cpp, tests/Makefile.am:
4636 small refactorings of class Bitmap; added tests for class Bitmap
4637
4638 * src/BoundingBox.cpp, src/BoundingBox.h, tests/BoundingBoxTest.cpp:
4639 improved BoundingBox tests
4640
4641 2015-03-04 Martin Gieseking <martin.gieseking@uos.de>
4642
4643 * src/Bezier.cpp, src/BoundingBox.cpp, src/BoundingBox.h,
4644 tests/BezierTest.cpp, tests/Makefile.am:
4645 fixed Bezier::reduceDegree() for degree 1 and added BezierTest class
4646
4647 2015-03-01 Martin Gieseking <martin.gieseking@uos.de>
4648
4649 * .travis.yml:
4650 Travis conf: added configuration data for Coverity Scan
4651
4652 * README.md:
4653 added license badge to README.md
4654
4655 2015-02-28 Martin Gieseking <martin.gieseking@uos.de>
4656
4657 * NEWS, README.md:
4658 updated NEWS and README.md
4659
4660 2015-02-27 Martin Gieseking <martin.gieseking@uos.de>
4661
4662 * src/Calculator.cpp:
4663 replaced while(1) with for(;;) for consistency
4664
4665 2015-02-26 Martin Gieseking <martin.gieseking@uos.de>
4666
4667 * configure.ac, src/Doxyfile:
4668 set version to 1.9.1
4669
4670 2015-02-25 Martin Gieseking <martin.gieseking@uos.de>
4671
4672 * src/Ghostscript.cpp:
4673 disable lookup of GS library in Windows registry for old gcc versions
4674
4675 2015-02-20 Martin Gieseking <martin.gieseking@uos.de>
4676
4677 * src/DVIToSVG.cpp, src/EPSToSVG.cpp, src/Makefile.am, src/SVGOutput.cpp,
4678 src/SVGOutput.h, src/SVGOutputBase.h, src/dvisvgm.cpp:
4679 moved class SVGOutput to separate compilation unit
4680
4681 * doc/dvisvgm.txt.in, src/SVGOutput.cpp, src/SVGOutput.h,
4682 tests/Makefile.am, tests/SVGOutputTest.cpp, tests/create-makefile:
4683 added width specifiers and exression evaluation to --output patterns
4684
4685 * doc/dvisvgm.txt.in:
4686 minor additions and formatting changes of the manpage
4687
4688 * doc/Makefile.am, doc/conf-dblatex-man.xsl, doc/conf-dblatex-pdf.xsl,
4689 doc/dvisvgm.sty, doc/dvisvgm.xpr, doc/tweak-dblatex-pdf.xsl:
4690 improved the layout of the pdf manpage
4691
4692 * doc/Makefile.am, doc/db2html.xsl, doc/dvisvgm.css:
4693 create html manpage with a separate stylesheet matching the new website
4694 theme
4695
4696 2015-02-19 Martin Gieseking <martin.gieseking@uos.de>
4697
4698 * .travis.yml:
4699 added configuration file for Travis CI
4700
4701 * .travis.yml:
4702 added dependency 'python-lxml' to Travis configuration
4703
4704 * .travis.yml:
4705 added dependency 'libgtest-dev' to Travis configuration; ensure call of
4706 'make check'
4707
4708 * .travis.yml:
4709 Travis conf: added missing call of 'configure'
4710
4711 * .travis.yml:
4712 Travis conf: build gtest libraries since Ubuntu doesn't provide the
4713 binaries
4714
4715 2015-02-18 Martin Gieseking <martin.gieseking@uos.de>
4716
4717 * src/TpicSpecialHandler.cpp:
4718 use constant M_PI rather than computing PI locally
4719
4720 2015-02-17 Martin Gieseking <martin.gieseking@uos.de>
4721
4722 * README, README.md:
4723 updated README and README.md
4724
4725 2015-01-26 Martin Gieseking <martin.gieseking@uos.de>
4726
4727 * src/ShadingPatch.h:
4728 removed redundant methods from class ShadingPatch
4729
4730 2015-01-21 Martin Gieseking <martin.gieseking@uos.de>
4731
4732 * src/TensorProductPatch.cpp, src/TriangularPatch.cpp:
4733 renamed static helper function clip() to snap()
4734
4735 2015-01-15 Martin Gieseking <martin.gieseking@uos.de>
4736
4737 * src/Color.cpp:
4738 resolved ambiguous call of pow (patch by Peter Breitenlohner)
4739
4740 2015-01-12 Martin Gieseking <martin.gieseking@uos.de>
4741
4742 * src/VectorIterator.h:
4743 removed redundant method VectorIterator::distanceToLast()
4744
4745 2014-12-30 Martin Gieseking <martin.gieseking@uos.de>
4746
4747 * Makefile.am, README, README.md, configure.ac, doc/Makefile.am,
4748 doc/dvisvgm.txt.in, src/BasicDVIReader.cpp, src/BasicDVIReader.h,
4749 src/Bezier.cpp, src/Bezier.h, src/BgColorSpecialHandler.cpp,
4750 src/BgColorSpecialHandler.h, src/Bitmap.cpp, src/Bitmap.h,
4751 src/BoundingBox.cpp, src/BoundingBox.h, src/CMap.cpp, src/CMap.h,
4752 src/CMapManager.cpp, src/CMapManager.h, src/CMapReader.cpp,
4753 src/CMapReader.h, src/CRC32.cpp, src/CRC32.h, src/Calculator.cpp,
4754 src/Calculator.h, src/CharMapID.cpp, src/CharMapID.h, src/Character.h,
4755 src/CmdLineParserBase.cpp, src/CmdLineParserBase.h, src/Color.cpp,
4756 src/Color.h, src/ColorSpecialHandler.cpp, src/ColorSpecialHandler.h,
4757 src/CommandLine.cpp, src/CommandLine.h, src/DLLoader.cpp, src/DLLoader.h,
4758 src/DVIActions.h, src/DVIReader.cpp, src/DVIReader.h, src/DVIToSVG.cpp,
4759 src/DVIToSVG.h, src/DVIToSVGActions.cpp, src/DVIToSVGActions.h,
4760 src/DependencyGraph.h, src/Directory.cpp, src/Directory.h,
4761 src/DvisvgmSpecialHandler.cpp, src/DvisvgmSpecialHandler.h,
4762 src/EPSFile.cpp, src/EPSFile.h, src/EPSToSVG.cpp, src/EPSToSVG.h,
4763 src/EmSpecialHandler.cpp, src/EmSpecialHandler.h, src/EncFile.cpp,
4764 src/EncFile.h, src/FileFinder.cpp, src/FileFinder.h, src/FilePath.cpp,
4765 src/FilePath.h, src/FileSystem.cpp, src/FileSystem.h, src/Font.cpp,
4766 src/Font.h, src/FontCache.cpp, src/FontCache.h, src/FontEncoding.cpp,
4767 src/FontEncoding.h, src/FontEngine.cpp, src/FontEngine.h,
4768 src/FontManager.cpp, src/FontManager.h, src/FontMap.cpp, src/FontMap.h,
4769 src/FontMetrics.cpp, src/FontMetrics.h, src/GFGlyphTracer.cpp,
4770 src/GFGlyphTracer.h, src/GFReader.cpp, src/GFReader.h, src/GFTracer.cpp,
4771 src/GFTracer.h, src/Ghostscript.cpp, src/Ghostscript.h, src/Glyph.h,
4772 src/GlyphTracerMessages.h, src/GraphicPath.h, src/HtmlSpecialHandler.cpp,
4773 src/HtmlSpecialHandler.h, src/InputBuffer.cpp, src/InputBuffer.h,
4774 src/InputReader.cpp, src/InputReader.h, src/JFM.cpp, src/JFM.h,
4775 src/Length.cpp, src/Length.h, src/Makefile.am, src/MapLine.cpp,
4776 src/MapLine.h, src/Matrix.cpp, src/Matrix.h, src/Message.cpp,
4777 src/Message.h, src/MessageException.h, src/MetafontWrapper.cpp,
4778 src/MetafontWrapper.h, src/MiKTeXCom.cpp, src/MiKTeXCom.h,
4779 src/NoPsSpecialHandler.cpp, src/NoPsSpecialHandler.h,
4780 src/NumericRanges.h, src/PSFilter.h, src/PSInterpreter.cpp,
4781 src/PSInterpreter.h, src/PSPattern.cpp, src/PSPattern.h,
4782 src/PSPreviewFilter.cpp, src/PSPreviewFilter.h, src/PageRanges.cpp,
4783 src/PageRanges.h, src/PageSize.cpp, src/PageSize.h, src/Pair.h,
4784 src/PathClipper.cpp, src/PathClipper.h, src/PdfSpecialHandler.cpp,
4785 src/PdfSpecialHandler.h, src/PreScanDVIReader.cpp,
4786 src/PreScanDVIReader.h, src/Process.cpp, src/Process.h,
4787 src/PsSpecialHandler.cpp, src/PsSpecialHandler.h, src/RangeMap.cpp,
4788 src/RangeMap.h, src/SVGOutputBase.h, src/SVGTree.cpp, src/SVGTree.h,
4789 src/ShadingPatch.cpp, src/ShadingPatch.h, src/SignalHandler.cpp,
4790 src/SignalHandler.h, src/SpecialActions.h, src/SpecialHandler.h,
4791 src/SpecialManager.cpp, src/SpecialManager.h, src/StreamReader.cpp,
4792 src/StreamReader.h, src/StreamWriter.cpp, src/StreamWriter.h,
4793 src/Subfont.cpp, src/Subfont.h, src/System.cpp, src/System.h,
4794 src/TFM.cpp, src/TFM.h, src/TensorProductPatch.cpp,
4795 src/TensorProductPatch.h, src/Terminal.cpp, src/Terminal.h,
4796 src/ToUnicodeMap.cpp, src/ToUnicodeMap.h, src/TpicSpecialHandler.cpp,
4797 src/TpicSpecialHandler.h, src/TriangularPatch.cpp, src/TriangularPatch.h,
4798 src/Unicode.cpp, src/Unicode.h, src/VFActions.h, src/VFReader.cpp,
4799 src/VFReader.h, src/VectorIterator.h, src/VectorStream.h,
4800 src/XMLDocument.cpp, src/XMLDocument.h, src/XMLNode.cpp, src/XMLNode.h,
4801 src/XMLString.cpp, src/XMLString.h, src/dvisvgm.cpp, src/macros.h,
4802 src/options.dtd, src/options.xml, src/psdefs.cpp, src/types.h,
4803 tests/BoundingBoxTest.cpp, tests/CMapReaderTest.cpp, tests/CMapTest.cpp,
4804 tests/CRC32Test.cpp, tests/CalculatorTest.cpp,
4805 tests/ColorSpecialTest.cpp, tests/ColorTest.cpp,
4806 tests/CommandLineTest.cpp, tests/DependencyGraphTest.cpp,
4807 tests/DirectoryTest.cpp, tests/DvisvgmSpecialTest.cpp,
4808 tests/FileFinderTest.cpp, tests/FilePathTest.cpp,
4809 tests/FileSystemTest.cpp, tests/FontManagerTest.cpp,
4810 tests/FontMapTest.cpp, tests/GFReaderTest.cpp, tests/GraphicPathTest.cpp,
4811 tests/LengthTest.cpp, tests/Makefile.am, tests/MapLineTest.cpp,
4812 tests/MatrixTest.cpp, tests/MessageExceptionTest.cpp,
4813 tests/PSInterpreterTest.cpp, tests/PageRagesTest.cpp,
4814 tests/PageSizeTest.cpp, tests/PairTest.cpp, tests/RangeMapTest.cpp,
4815 tests/SplittedCharInputBufferTest.cpp, tests/StreamInputBufferTest.cpp,
4816 tests/StreamReaderTest.cpp, tests/StreamWriterTest.cpp,
4817 tests/SubfontTest.cpp, tests/TensorProductPatchTest.cpp,
4818 tests/ToUnicodeMapTest.cpp, tests/TypesTest.cpp,
4819 tests/VectorStreamTest.cpp, tests/check-conv, tests/create-makefile,
4820 tests/normalize.xsl:
4821 updated year in copyright statements to 2015
4822
4823 2014-12-28 Martin Gieseking <martin.gieseking@uos.de>
4824
4825 * doc/dvisvgm.txt.in, src/CommandLine.cpp, src/CommandLine.h,
4826 src/PsSpecialHandler.cpp, src/PsSpecialHandler.h, src/ShadingPatch.h,
4827 src/TensorProductPatch.cpp, src/TensorProductPatch.h,
4828 src/TriangularPatch.cpp, src/TriangularPatch.h, src/dvisvgm.cpp,
4829 src/options.xml:
4830 added command-line options --grad-overlap, --grad-segments, and
4831 --grad-simplify
4832
4833 * src/DVIToSVGActions.cpp, src/DVIToSVGActions.h, src/EPSToSVG.cpp,
4834 src/EPSToSVG.h, src/SpecialActions.h, src/SpecialManager.cpp,
4835 src/dvisvgm.cpp:
4836 show PS instruction counter when processing EPS files with option
4837 --progress
4838
4839 * src/dvisvgm.cpp:
4840 clear line before printing the message about user interruption to avoid
4841 trailing text fragments
4842
4843 * configure.ac, src/Doxyfile:
4844 set version to 1.9
4845
4846 * NEWS:
4847 updated NEWS
4848
4849 2014-12-20 Martin Gieseking <martin.gieseking@uos.de>
4850
4851 * src/DVIReader.cpp:
4852 check validity of DVI file before trying to collect the BOPs
4853
4854 2014-12-18 Martin Gieseking <martin.gieseking@uos.de>
4855
4856 * src/Makefile.am, src/TriangularPatch.cpp, src/TriangularPatch.h:
4857 added class to compute triangular shading patches
4858
4859 * src/Makefile.am, src/PsSpecialHandler.cpp, src/ShadingPatch.cpp,
4860 src/ShadingPatch.h, src/TensorProductPatch.cpp, src/TensorProductPatch.h:
4861 extracted common interface class ShadingPatch from TensorProductPatch
4862
4863 * src/Color.cpp, src/Color.h, src/Makefile.am, src/PsSpecialHandler.cpp,
4864 src/PsSpecialHandler.h, src/VectorIterator.h, src/psdefs.cpp:
4865 extended PS operator 'shfill' to support triangular patch meshes
4866
4867 2014-12-16 Martin Gieseking <martin.gieseking@uos.de>
4868
4869 * src/PsSpecialHandler.cpp, src/PsSpecialHandler.h:
4870 added processing of the optional 'BBox' entry in a PS shading dictionary
4871
4872 2014-12-03 Martin Gieseking <martin.gieseking@uos.de>
4873
4874 * src/CommandLine.cpp, src/CommandLine.h, src/dvisvgm.cpp,
4875 src/options.xml:
4876 disable option --clipjoin if PS support is disabled
4877
4878 * src/Color.cpp, tests/ColorSpecialTest.cpp, tests/ColorTest.cpp:
4879 fixed CMYK to RGB approximation
4880
4881 2014-11-27 Martin Gieseking <martin.gieseking@uos.de>
4882
4883 * src/PSInterpreter.cpp, src/PSInterpreter.h, src/PsSpecialHandler.cpp,
4884 src/PsSpecialHandler.h, src/psdefs.cpp, tests/PSInterpreterTest.cpp:
4885 added evaluation of PS operator shfill (Coons and tensor product patches
4886 only)
4887
4888 2014-11-24 Martin Gieseking <martin.gieseking@uos.de>
4889
4890 * README.md:
4891 added list of features and a download button to README.md
4892
4893 2014-11-09 Martin Gieseking <martin.gieseking@uos.de>
4894
4895 * clipper/clipper.cpp, clipper/clipper.hpp:
4896 updated clipper library to version 6.2.1
4897
4898 2014-11-08 Martin Gieseking <martin.gieseking@uos.de>
4899
4900 * src/Bezier.cpp, src/Bezier.h, src/BoundingBox.h, src/GraphicPath.h,
4901 src/Makefile.am, src/TensorProductPatch.cpp, src/TensorProductPatch.h,
4902 tests/Makefile.am, tests/TensorProductPatchTest.cpp:
4903 added code to compute tensor-product patches required for gradient fills
4904
4905 2014-11-06 Martin Gieseking <martin.gieseking@uos.de>
4906
4907 * src/Matrix.cpp:
4908 use constant M_PI rather than defining PI locally
4909
4910 2014-10-23 Martin Gieseking <martin.gieseking@uos.de>
4911
4912 * src/Color.cpp, src/Color.h, src/ColorSpecialHandler.cpp,
4913 src/PsSpecialHandler.cpp, tests/ColorTest.cpp:
4914 replaced float by double in class Color
4915
4916 * src/Color.cpp, src/Color.h, src/ColorSpecialHandler.cpp,
4917 src/DVIReader.cpp, src/HtmlSpecialHandler.cpp, src/PsSpecialHandler.cpp,
4918 tests/ColorTest.cpp:
4919 renamed RGB setters/getters of class Color
4920
4921 * src/Color.cpp, src/Color.h:
4922 replaced vectors with valarrays in class Color
4923
4924 * src/Color.cpp, src/Color.h, tests/ColorTest.cpp:
4925 added deltaE and L*a*b* color space methods to class Color
4926
4927 2014-10-17 Martin Gieseking <martin.gieseking@uos.de>
4928
4929 * clipper/clipper.cpp, clipper/clipper.hpp:
4930 updated clipper library to version 6.2.0
4931
4932 * src/GraphicPath.h, src/PathClipper.cpp, src/PathClipper.h,
4933 src/XMLNode.h:
4934 fixed a couple of doxygen comments; removed redundant
4935 PathClipperException
4936
4937 2014-10-08 Martin Gieseking <martin.gieseking@uos.de>
4938
4939 * src/CommandLine.cpp:
4940 updated CommandLine.cpp with description of option --no-merge
4941
4942 * src/Ghostscript.cpp:
4943 try to lookup the location of the GS DLL in the Windows registry
4944
4945 2014-10-01 Martin Gieseking <martin.gieseking@uos.de>
4946
4947 * doc/dvisvgm.txt.in, src/options.xml:
4948 added info about option --no-merge to the manpage
4949
4950 2014-09-24 Khaled Hosny <khaled.hosny@hindawi.com>
4951
4952 * src/Makefile.am:
4953 Add an opt2cpp Python script
4954
4955 A very ugly script that should work as a
4956 drop in replacement for the
4957 opt2cpp XSLT.
4958
4959 2014-09-15 Martin Gieseking <martin.gieseking@uos.de>
4960
4961 * src/PsSpecialHandler.cpp, src/PsSpecialHandler.h:
4962 ensure that colors set by a color special are always considered by the
4963 PS handler
4964
4965 2014-09-10 Martin Gieseking <martin.gieseking@uos.de>
4966
4967 * src/BasicDVIReader.cpp, src/DVIReader.cpp, src/FontCache.cpp,
4968 src/GFReader.cpp, src/dvisvgm.cpp:
4969 replaced namespace 'ios_base' with 'ios'
4970
4971 2014-08-29 Martin Gieseking <martin.gieseking@uos.de>
4972
4973 * src/PsSpecialHandler.cpp:
4974 added missing whitespace boundaries in PS code
4975
4976 * src/FontEngine.cpp, tests/PageRagesTest.cpp:
4977 removed unused static functions
4978
4979 * configure.ac, src/Doxyfile:
4980 set version to 1.8.1
4981
4982 * NEWS:
4983 updated NEWS
4984
4985 2014-08-18 Martin Gieseking <martin.gieseking@uos.de>
4986
4987 * src/DVIToSVG.cpp, src/DependencyGraph.h, src/Makefile.am,
4988 src/SVGTree.cpp, src/SVGTree.h, src/XMLNode.cpp, src/XMLNode.h,
4989 tests/DependencyGraphTest.cpp, tests/Makefile.am:
4990 remove redundant clipPath elements from generated SVG files
4991
4992 2014-08-16 Martin Gieseking <martin.gieseking@uos.de>
4993
4994 * src/PSPattern.cpp, src/XMLNode.cpp, src/XMLNode.h:
4995 renamed XMLElementNode::findDescendants() and made it constant
4996
4997 2014-08-11 Martin Gieseking <martin.gieseking@uos.de>
4998
4999 * tests/Makefile.am, tests/create-makefile:
5000 link tests against FreeType library
5001
5002 * README.md:
5003 minor fixed to README.md
5004
5005 2014-08-10 Khaled Hosny <khaledhosny@eglug.org>
5006
5007 * configure.ac, src/Makefile.am:
5008 Don't override CXXFLAGS in configure script
5009
5010 Breaks standard things
5011 like:
5012
5013 make CXXFLAGS="-g -O0 -pg"
5014
5015 * configure.ac, src/Makefile.am:
5016 Don't override CPPFLAGS and LDFLAGS in configure
5017
5018 For the same reasons
5019 as the previous commit
5020
5021 2014-08-07 Martin Gieseking <mgieseki@users.sourceforge.net>
5022
5023 * src/dvisvgm.cpp:
5024 removed old code that moved cache files to new location
5025
5026 * src/XMLDocument.cpp, src/XMLDocument.h, src/XMLNode.cpp, src/XMLNode.h:
5027 removed unused emit() methods from XML classes
5028
5029 2014-07-31 Martin Gieseking <mgieseki@users.sourceforge.net>
5030
5031 * src/PsSpecialHandler.cpp, src/psdefs.cpp:
5032 prevent side-effects caused by bop/eop operators present in PS specials
5033
5034 2014-07-29 Martin Gieseking <mgieseki@users.sourceforge.net>
5035
5036 * NEWS:
5037 updated NEWS
5038
5039 2014-07-28 Martin Gieseking <mgieseki@users.sourceforge.net>
5040
5041 * src/GraphicPath.h, src/PSInterpreter.cpp, src/PSInterpreter.h,
5042 src/PsSpecialHandler.cpp, src/PsSpecialHandler.h, src/psdefs.cpp,
5043 tests/PSInterpreterTest.cpp:
5044 added evaluation of PS operator 'clippath' (copies clipping path into
5045 graphics path)
5046
5047 * configure.ac, src/Doxyfile:
5048 set version to 1.8
5049
5050 2014-07-26 Martin Gieseking <mgieseki@users.sourceforge.net>
5051
5052 * src/Font.cpp, src/GFGlyphTracer.cpp, src/GraphicPath.h,
5053 src/PsSpecialHandler.cpp:
5054 renamed GraphicPath::newpath() to GraphicPath::clear()
5055
5056 2014-07-24 Martin Gieseking <mgieseki@users.sourceforge.net>
5057
5058 * src/InputReader.cpp, src/PSInterpreter.cpp:
5059 ensure that InputReader::compare() checks whole and not just partial
5060 words
5061
5062 2014-07-22 Martin Gieseking <mgieseki@users.sourceforge.net>
5063
5064 * src/DVIToSVG.h, src/dvisvgm.cpp:
5065 prevent throwing a DVIException when option -l is present
5066
5067 * Makefile.am, clipper/License.txt, clipper/Makefile.am,
5068 clipper/clipper.cpp, clipper/clipper.hpp, configure.ac, src/Makefile.am:
5069 added slightly modified sources of clipper library (computes boolops on
5070 polygons)
5071
5072 * src/GraphicPath.h:
5073 added field to store the winding rule to class GraphicPath
5074
5075 * README, README.md, src/Bezier.cpp, src/Bezier.h, src/GraphicPath.h,
5076 src/Makefile.am, src/PathClipper.cpp, src/PathClipper.h, src/dvisvgm.cpp:
5077 added class PathClipper to compute intersections of closed curved
5078 graphics paths
5079
5080 * doc/dvisvgm.txt.in, src/CommandLine.cpp, src/CommandLine.h,
5081 src/PsSpecialHandler.cpp, src/PsSpecialHandler.h, src/dvisvgm.cpp,
5082 src/options.xml:
5083 added option --clippath to compute the intersection of clipping paths
5084
5085 2014-07-20 Khaled Hosny <khaledhosny@eglug.org>
5086
5087 * src/FontEngine.cpp:
5088 Free existing FT_Face before creating a new one
5089
5090 FontEngine was never
5091 destroying the FT_Face's it creates, except the
5092 very last one that was
5093 destroyed by the destructor. For some reason,
5094 this was causing
5095 FT_New_Face() to fail on Windows after processing the
5096 first hundred or so
5097 pages of DVI files.
5098
5099 2014-07-18 Martin Gieseking <mgieseki@users.sourceforge.net>
5100
5101 * doc/dvisvgm.txt.in, src/CommandLine.cpp, src/CommandLine.h,
5102 src/GraphicPath.h, src/PsSpecialHandler.cpp, src/SVGTree.cpp,
5103 src/SVGTree.h, src/dvisvgm.cpp, src/options.xml,
5104 tests/GraphicPathTest.cpp:
5105 added option to create relative rather than absolute path commands
5106
5107 * src/TpicSpecialHandler.cpp:
5108 TPIC handler: use class GraphicPath to create SVG path commands
5109
5110 2014-07-07 Martin Gieseking <mgieseki@users.sourceforge.net>
5111
5112 * src/DVIToSVGActions.h, src/Doxyfile, src/HtmlSpecialHandler.h,
5113 src/RangeMap.cpp, src/SpecialManager.cpp, src/ToUnicodeMap.cpp:
5114 fixed a couple of broken doxygen comments
5115
5116 2014-06-25 Martin Gieseking <mgieseki@users.sourceforge.net>
5117
5118 * src/Ghostscript.cpp:
5119 get proper name of Ghostscript library when building for Cygwin
5120
5121 2014-06-23 Martin Gieseking <mgieseki@users.sourceforge.net>
5122
5123 * README.md:
5124 added markdown version of README
5125
5126 2014-06-20 Martin Gieseking <martin.gieseking@uos.de>
5127
5128 * src/psdefs.cpp:
5129 suppress output of PS operator ':show' to prevent the creation of
5130 additional graphic elements
5131
5132 2014-06-17 Martin Gieseking <mgieseki@users.sourceforge.net>
5133
5134 * src/SpecialManager.cpp, src/SpecialManager.h:
5135 removed redundant method SpecialManager::leavePSHeaderSection()
5136
5137 * doc/dvisvgm.txt.in, src/DVIToSVGActions.cpp,
5138 src/DvisvgmSpecialHandler.cpp, src/DvisvgmSpecialHandler.h,
5139 tests/DvisvgmSpecialTest.cpp, tests/Makefile.am:
5140 added/improved dvisvgm::raw* specials
5141
5142 * src/InputReader.cpp:
5143 added missing include
5144
5145 * configure.ac, src/Doxyfile:
5146 set version to 1.7
5147
5148 * NEWS:
5149 updated NEWS
5150
5151 2014-06-12 Martin Gieseking <mgieseki@users.sourceforge.net>
5152
5153 * src/XMLNode.cpp, src/XMLNode.h:
5154 added clear() to XMLNode classes; added XMLTextNode::getText()
5155
5156 2014-06-11 Martin Gieseking <martin.gieseking@uos.de>
5157
5158 * src/InputReader.cpp, src/InputReader.h:
5159 added InputReader::getLine()
5160
5161 * src/DVIToSVG.cpp, src/SpecialHandler.h, src/SpecialManager.cpp,
5162 src/SpecialManager.h:
5163 added listener to allow SpecialHandlers being notified when
5164 pre-processing has finished
5165
5166 2014-06-10 Martin Gieseking <mgieseki@users.sourceforge.net>
5167
5168 * src/SpecialActions.h, tests/ColorSpecialTest.cpp:
5169 renamed class SpecialEmptyActions to EmptySpecialActions
5170
5171 2014-06-09 Martin Gieseking <mgieseki@users.sourceforge.net>
5172
5173 * src/DVIReader.cpp, src/Ghostscript.cpp:
5174 removed unused variable; call Ghostscript::exit() with explicitely given
5175 object
5176
5177 * src/DVIToSVG.h, src/SpecialManager.h:
5178 removed redundant definition of assignment operators
5179
5180 2014-06-05 Martin Gieseking <martin.gieseking@uos.de>
5181
5182 * src/BasicDVIReader.cpp, src/BasicDVIReader.h, src/DVIReader.cpp,
5183 src/DVIReader.h, src/Makefile.am:
5184 moved basic funtionality of DVIReader to base class BasicDVIReader
5185
5186 * src/BasicDVIReader.h, src/DVIReader.cpp, src/DVIToSVG.cpp,
5187 src/DVIToSVG.h, src/dvisvgm.cpp:
5188 moved call of executePreamble() and executePostamble() from DVIToSVG to
5189 DVIReader
5190
5191 * src/DVIActions.h, src/DVIReader.cpp, src/DVIToSVG.cpp, src/DVIToSVG.h,
5192 src/DVIToSVGActions.cpp, src/DVIToSVGActions.h, src/Makefile.am,
5193 src/PreScanDVIReader.cpp, src/PreScanDVIReader.h,
5194 src/PsSpecialHandler.cpp, src/PsSpecialHandler.h, src/SpecialHandler.h,
5195 src/SpecialManager.cpp, src/SpecialManager.h, src/StreamReader.cpp,
5196 src/StreamReader.h:
5197 pre-process DVI file to collect required data not present in the page
5198 ranges to be converted
5199
5200 * src/DVIToSVG.cpp, src/DVIToSVG.h, src/DVIToSVGActions.cpp,
5201 src/SpecialManager.cpp, src/SpecialManager.h, src/dvisvgm.cpp:
5202 made class SpecialManager a singleton
5203
5204 * src/BasicDVIReader.h, src/DVIToSVG.cpp, src/DVIToSVGActions.cpp,
5205 src/DVIToSVGActions.h:
5206 allow to replace the DVI reader assigned to an instance of
5207 DVIToSVGActions
5208
5209 * doc/dvisvgm.txt.in, src/BasicDVIReader.h, src/DVIToSVG.cpp,
5210 src/DVIToSVG.h, src/DVIToSVGActions.cpp, src/DVIToSVGActions.h,
5211 src/EPSToSVG.cpp, src/EPSToSVG.h, src/HtmlSpecialHandler.cpp,
5212 src/HtmlSpecialHandler.h, src/PreScanDVIReader.cpp,
5213 src/PreScanDVIReader.h, src/SpecialActions.h:
5214 process hyperref anchors and links across pages
5215
5216 * src/BasicDVIReader.cpp, src/BasicDVIReader.h, src/Bitmap.h,
5217 src/BoundingBox.h, src/CMap.h, src/CMapManager.cpp, src/CMapManager.h,
5218 src/CMapReader.h, src/CRC32.h, src/Calculator.cpp, src/Calculator.h,
5219 src/CmdLineParserBase.h, src/Color.cpp, src/ColorSpecialHandler.cpp,
5220 src/ColorSpecialHandler.h, src/CommandLine.cpp, src/CommandLine.h,
5221 src/DLLoader.h, src/DVIReader.cpp, src/DVIToSVG.h, src/DVIToSVGActions.h,
5222 src/Directory.h, src/DvisvgmSpecialHandler.h, src/EmSpecialHandler.cpp,
5223 src/EmSpecialHandler.h, src/EncFile.h, src/FileFinder.h,
5224 src/FileSystem.cpp, src/Font.cpp, src/Font.h, src/FontCache.h,
5225 src/FontEncoding.cpp, src/FontEngine.cpp, src/FontEngine.h,
5226 src/FontManager.cpp, src/FontManager.h, src/FontMap.cpp, src/FontMap.h,
5227 src/GFGlyphTracer.cpp, src/GFGlyphTracer.h, src/GFReader.cpp,
5228 src/GFReader.h, src/GFTracer.h, src/Ghostscript.cpp, src/Ghostscript.h,
5229 src/GraphicPath.h, src/HtmlSpecialHandler.h, src/InputBuffer.cpp,
5230 src/InputBuffer.h, src/JFM.h, src/Length.cpp, src/Length.h,
5231 src/MapLine.cpp, src/MapLine.h, src/Matrix.cpp, src/Matrix.h,
5232 src/MessageException.h, src/MetafontWrapper.cpp, src/MetafontWrapper.h,
5233 src/NoPsSpecialHandler.h, src/NumericRanges.h, src/PSInterpreter.h,
5234 src/PSPattern.h, src/PSPreviewFilter.h, src/PageRanges.h, src/PageSize.h,
5235 src/Pair.h, src/PdfSpecialHandler.cpp, src/PdfSpecialHandler.h,
5236 src/Process.h, src/PsSpecialHandler.cpp, src/PsSpecialHandler.h,
5237 src/SVGTree.h, src/SignalHandler.h, src/SpecialActions.h,
5238 src/SpecialManager.h, src/StreamWriter.h, src/Subfont.cpp, src/Subfont.h,
5239 src/TFM.h, src/ToUnicodeMap.h, src/TpicSpecialHandler.cpp,
5240 src/TpicSpecialHandler.h, src/VFReader.cpp, src/VectorStream.h,
5241 src/XMLDocument.h, src/XMLNode.h, src/XMLString.cpp, src/XMLString.h,
5242 src/dvisvgm.cpp, src/types.h:
5243 replaced leading spaces by tabs; removed trailing whitespace
5244
5245 2014-06-03 Martin Gieseking <mgieseki@users.sourceforge.net>
5246
5247 * src/DVIReader.cpp, src/DVIReader.h:
5248 removed redundant variable DVIReader::_prevBop
5249
5250 * src/PsSpecialHandler.cpp:
5251 fixed incorrect extent values shown when applying a preview bbox
5252 (bp->pt)
5253
5254 2014-06-01 Martin Gieseking <mgieseki@users.sourceforge.net>
5255
5256 * src/EPSFile.cpp, src/GFReader.cpp:
5257 replaced relative variant of seekg() by absolute one where possible
5258
5259 * src/DVIReader.cpp, src/DVIReader.h:
5260 removed redundant code from DVIReader::evalCommand()
5261
5262 2014-05-31 Martin Gieseking <mgieseki@users.sourceforge.net>
5263
5264 * src/DVIReader.cpp, src/VFReader.cpp:
5265 few code adjustments
5266
5267 * src/DVIReader.cpp, src/StreamReader.cpp, src/StreamReader.h,
5268 src/VFReader.cpp:
5269 removed StreamReader::in()
5270
5271 * src/DVIReader.cpp, src/StreamReader.h, src/VFReader.cpp:
5272 renamed some methods of class StreamReader
5273
5274 2014-05-29 Martin Gieseking <mgieseki@users.sourceforge.net>
5275
5276 * src/DVIReader.cpp, src/DVIReader.h, src/StreamReader.h:
5277 collect all DVI BOP offsets to reach them quickly
5278
5279 * src/DVIReader.cpp, src/DVIReader.h, src/DVIToSVG.cpp, src/DVIToSVG.h:
5280 removed DVIReader::_totalPages; use number of BOP offsets instead
5281
5282 * src/DVIReader.cpp, src/DVIReader.h, src/dvisvgm.cpp:
5283 simplified computation of progress ratio
5284
5285 * src/DVIReader.cpp, src/DVIReader.h:
5286 simplified DVIReader::executePage; removed DVIReader::executePages
5287
5288 2014-05-22 Martin Gieseking <martin.gieseking@uos.de>
5289
5290 * src/Font.cpp, src/Makefile.am, src/Unicode.cpp, src/Unicode.h,
5291 src/XMLString.cpp:
5292 moved unicode-related funtions to separate class
5293
5294 * src/CharMap.cpp, src/CharMap.h, src/Font.cpp, src/FontEngine.cpp,
5295 src/FontEngine.h:
5296 removed redundant method CharMap::invert()
5297
5298 * src/CMap.cpp, src/CMap.h, src/Makefile.am, src/RangeMap.cpp,
5299 src/RangeMap.h, tests/Makefile.am, tests/RangeMapTest.cpp:
5300 extracted class RangeMap previously implemented as part of SegmentedCMap
5301
5302 * src/RangeMap.cpp:
5303 fixed right joins of touching ranges in a RangeMap
5304
5305 * src/CharMap.cpp, src/CharMap.h, src/Font.cpp, src/Font.h,
5306 src/FontEngine.cpp, src/FontEngine.h, src/Makefile.am:
5307 replaced class CharMap with more generic class RangeMap
5308
5309 * src/DVIToSVG.cpp, src/Makefile.am, src/NumericRanges.h,
5310 src/PageRanges.cpp, src/PageRanges.h, tests/PageRagesTest.cpp:
5311 extracted functionality of class PageRanges to separate class
5312 NumericRanges
5313
5314 * src/Makefile.am, src/RangeMap.h, src/ToUnicodeMap.cpp,
5315 src/ToUnicodeMap.h, tests/Makefile.am, tests/ToUnicodeMapTest.cpp:
5316 added class ToUnicodeMap to handle mappings from character indexes to
5317 unicode points
5318
5319 * src/Makefile.am:
5320 Makefile: put source files on separate lines
5321
5322 2014-04-30 Martin Gieseking <mgieseki@users.sourceforge.net>
5323
5324 * src/CharMapID.cpp, src/CharMapID.h, src/DVIReader.cpp, src/Font.cpp,
5325 src/Font.h, src/FontEngine.cpp, src/FontEngine.h:
5326 try to add unicode mappings missing in a font's cmap table
5327
5328 2014-04-29 Martin Gieseking <mgieseki@users.sourceforge.net>
5329
5330 * src/SVGTree.cpp:
5331 don't add unnecessary element 'missing-glyph' to SVG files
5332
5333 2014-04-24 Martin Gieseking <mgieseki@users.sourceforge.net>
5334
5335 * doc/dvisvgm.txt.in, src/CommandLine.cpp, src/options.xml:
5336 renamed argument of option --linkmark from 'type' to 'style'
5337
5338 2014-04-23 Martin Gieseking <mgieseki@users.sourceforge.net>
5339
5340 * src/System.h:
5341 removed redundant semicolon
5342
5343 2014-04-22 Martin Gieseking <martin.gieseking@uos.de>
5344
5345 * configure.ac, src/Doxyfile:
5346 set version to 1.6
5347
5348 * NEWS:
5349 updated NEWS
5350
5351 2014-04-21 Martin Gieseking <mgieseki@users.sourceforge.net>
5352
5353 * doc/dvisvgm.txt.in, src/DVIToSVG.cpp, src/EPSToSVG.cpp:
5354 removed date and machine triplet from generated SVG files
5355
5356 2014-04-18 Martin Gieseking <mgieseki@users.sourceforge.net>
5357
5358 * doc/dvisvgm.txt.in, src/HtmlSpecialHandler.cpp,
5359 src/HtmlSpecialHandler.h:
5360 added optional selection of line/box colors to option --linkmark
5361
5362 2014-04-17 Martin Gieseking <mgieseki@users.sourceforge.net>
5363
5364 * src/CommandLine.h, src/DVIToSVG.cpp, src/EPSToSVG.cpp:
5365 don't link GS messages unnecessarily if HAVE_LIBGS is defined
5366
5367 * src/DVIReader.h, src/DVIToSVGActions.h, src/HtmlSpecialHandler.cpp,
5368 src/HtmlSpecialHandler.h, src/SpecialActions.h:
5369 only split hyperlink boxes on line breaks
5370
5371 * doc/dvisvgm.txt.in, src/CommandLine.cpp, src/options.xml:
5372 changed default argument of option --linkmark to 'box'
5373
5374 2014-04-16 Martin Gieseking <mgieseki@users.sourceforge.net>
5375
5376 * src/DLLoader.cpp:
5377 prevent calling dlopen() if the length of the string argument is 0
5378
5379 * doc/dvisvgm.txt.in, src/Ghostscript.cpp:
5380 if libgs is loaded during runtime, look for libgs.so.X instead of
5381 libgs.so
5382
5383 * src/Ghostscript.cpp, src/dvisvgm.cpp:
5384 moved lookup of MiKTeX's GS DLL to get_libgs()
5385
5386 * doc/dvisvgm.txt.in, src/CommandLine.cpp, src/CommandLine.h,
5387 src/SVGTree.cpp, src/SVGTree.h, src/dvisvgm.cpp, src/options.xml:
5388 added command-line option --zoom
5389
5390 2014-04-11 Martin Gieseking <mgieseki@users.sourceforge.net>
5391
5392 * src/CMap.cpp, src/CmdLineParserBase.cpp, src/ColorSpecialHandler.cpp,
5393 src/DVIReader.cpp, src/DVIToSVGActions.cpp, src/Doxyfile,
5394 src/DvisvgmSpecialHandler.cpp, src/DvisvgmSpecialHandler.h,
5395 src/EPSFile.cpp, src/EmSpecialHandler.cpp, src/FileFinder.cpp,
5396 src/FileSystem.cpp, src/Font.cpp, src/FontCache.cpp, src/FontEncoding.h,
5397 src/FontEngine.cpp, src/FontMap.cpp, src/GraphicPath.h,
5398 src/PSInterpreter.cpp, src/PageRanges.cpp, src/PsSpecialHandler.cpp,
5399 src/SVGTree.cpp, src/SVGTree.h, src/SpecialManager.cpp, src/Subfont.cpp,
5400 src/TFM.cpp, src/TpicSpecialHandler.cpp, src/XMLDocument.cpp,
5401 src/XMLNode.cpp, src/dvisvgm.cpp:
5402 fixed issues in the doxygen documentation
5403
5404 * configure.ac, src/Doxyfile:
5405 set version to 1.5.3
5406
5407 * NEWS:
5408 updated NEWS
5409
5410 2014-04-09 Martin Gieseking <mgieseki@users.sourceforge.net>
5411
5412 * src/DVIToSVGActions.cpp:
5413 equalize implementations of moveToX and moveToY
5414
5415 * src/BoundingBox.h, src/DVIActions.cpp, src/DVIActions.h,
5416 src/DVIReader.cpp, src/DVIReader.h, src/DVIToSVG.cpp,
5417 src/DVIToSVGActions.cpp, src/DVIToSVGActions.h,
5418 src/DvisvgmSpecialHandler.cpp, src/EPSToSVG.cpp,
5419 src/EmSpecialHandler.cpp, src/Font.h, src/FontManager.cpp,
5420 src/GFGlyphTracer.cpp, src/GFReader.cpp, src/GFTracer.cpp,
5421 src/GFTracer.h, src/GraphicPath.h, src/HtmlSpecialHandler.h,
5422 src/Makefile.am, src/PSPattern.cpp, src/PSPreviewFilter.cpp,
5423 src/PSPreviewFilter.h, src/PageSize.cpp, src/PageSize.h,
5424 src/PsSpecialHandler.cpp, src/PsSpecialHandler.h, src/SVGTree.cpp,
5425 src/SpecialHandler.h, src/SpecialManager.cpp, src/SpecialManager.h,
5426 src/TFM.cpp, src/TpicSpecialHandler.cpp, src/TpicSpecialHandler.h,
5427 src/VFReader.cpp:
5428 switched internal computations from TeX points (pt) to PS points (bp)
5429
5430 2014-02-05 Martin Gieseking <martin.gieseking@uos.de>
5431
5432 * src/DVIReader.cpp, src/DVIReader.h:
5433 ensure updating the SVG cursor position when executing DVI command
5434 set_rule
5435
5436 2014-01-13 Martin Gieseking <mgieseki@users.sourceforge.net>
5437
5438 * src/Ghostscript.cpp:
5439 check if library given by --libgs is actually a GS library
5440
5441 2014-01-10 Martin Gieseking <mgieseki@users.sourceforge.net>
5442
5443 * NEWS:
5444 updated NEWS
5445
5446 2014-01-03 Martin Gieseking <mgieseki@users.sourceforge.net>
5447
5448 * src/FileFinder.cpp:
5449 catch exceptions thrown by MiKTeXCom object
5450
5451 * src/Directory.cpp:
5452 initialize Directory member variables (Win only)
5453
5454 * src/FileFinder.cpp:
5455 return 'unknown' if MiKTeX version can't be retrieved
5456
5457 * configure.ac, src/Doxyfile:
5458 set version to 1.5.2
5459
5460 2014-01-02 Martin Gieseking <martin.gieseking@uos.de>
5461
5462 * Makefile.am, README, configure.ac, doc/Makefile.am, doc/dvisvgm.txt.in,
5463 src/BgColorSpecialHandler.cpp, src/BgColorSpecialHandler.h,
5464 src/Bitmap.cpp, src/Bitmap.h, src/BoundingBox.cpp, src/BoundingBox.h,
5465 src/CMap.cpp, src/CMap.h, src/CMapManager.cpp, src/CMapManager.h,
5466 src/CMapReader.cpp, src/CMapReader.h, src/CRC32.cpp, src/CRC32.h,
5467 src/Calculator.cpp, src/Calculator.h, src/CharMap.cpp, src/CharMap.h,
5468 src/CharMapID.cpp, src/CharMapID.h, src/Character.h,
5469 src/CmdLineParserBase.cpp, src/CmdLineParserBase.h, src/Color.cpp,
5470 src/Color.h, src/ColorSpecialHandler.cpp, src/ColorSpecialHandler.h,
5471 src/CommandLine.cpp, src/CommandLine.h, src/DLLoader.cpp, src/DLLoader.h,
5472 src/DVIActions.cpp, src/DVIActions.h, src/DVIReader.cpp, src/DVIReader.h,
5473 src/DVIToSVG.cpp, src/DVIToSVG.h, src/DVIToSVGActions.cpp,
5474 src/DVIToSVGActions.h, src/Directory.cpp, src/Directory.h,
5475 src/DvisvgmSpecialHandler.cpp, src/DvisvgmSpecialHandler.h,
5476 src/EPSFile.cpp, src/EPSFile.h, src/EPSToSVG.cpp, src/EPSToSVG.h,
5477 src/EmSpecialHandler.cpp, src/EmSpecialHandler.h, src/EncFile.cpp,
5478 src/EncFile.h, src/FileFinder.cpp, src/FileFinder.h, src/FilePath.cpp,
5479 src/FilePath.h, src/FileSystem.cpp, src/FileSystem.h, src/Font.cpp,
5480 src/Font.h, src/FontCache.cpp, src/FontCache.h, src/FontEncoding.cpp,
5481 src/FontEncoding.h, src/FontEngine.cpp, src/FontEngine.h,
5482 src/FontManager.cpp, src/FontManager.h, src/FontMap.cpp, src/FontMap.h,
5483 src/FontMetrics.cpp, src/FontMetrics.h, src/GFGlyphTracer.cpp,
5484 src/GFGlyphTracer.h, src/GFReader.cpp, src/GFReader.h, src/GFTracer.cpp,
5485 src/GFTracer.h, src/Ghostscript.cpp, src/Ghostscript.h, src/Glyph.h,
5486 src/GlyphTracerMessages.h, src/GraphicPath.h, src/HtmlSpecialHandler.cpp,
5487 src/HtmlSpecialHandler.h, src/InputBuffer.cpp, src/InputBuffer.h,
5488 src/InputReader.cpp, src/InputReader.h, src/JFM.cpp, src/JFM.h,
5489 src/Length.cpp, src/Length.h, src/Makefile.am, src/MapLine.cpp,
5490 src/MapLine.h, src/Matrix.cpp, src/Matrix.h, src/Message.cpp,
5491 src/Message.h, src/MessageException.h, src/MetafontWrapper.cpp,
5492 src/MetafontWrapper.h, src/MiKTeXCom.cpp, src/MiKTeXCom.h,
5493 src/NoPsSpecialHandler.cpp, src/NoPsSpecialHandler.h, src/PSFilter.h,
5494 src/PSInterpreter.cpp, src/PSInterpreter.h, src/PSPattern.cpp,
5495 src/PSPattern.h, src/PSPreviewFilter.cpp, src/PSPreviewFilter.h,
5496 src/PageRanges.cpp, src/PageRanges.h, src/PageSize.cpp, src/PageSize.h,
5497 src/Pair.h, src/PdfSpecialHandler.cpp, src/PdfSpecialHandler.h,
5498 src/Process.cpp, src/Process.h, src/PsSpecialHandler.cpp,
5499 src/PsSpecialHandler.h, src/SVGOutputBase.h, src/SVGTree.cpp,
5500 src/SVGTree.h, src/SignalHandler.cpp, src/SignalHandler.h,
5501 src/SpecialActions.h, src/SpecialHandler.h, src/SpecialManager.cpp,
5502 src/SpecialManager.h, src/StreamReader.cpp, src/StreamReader.h,
5503 src/StreamWriter.cpp, src/StreamWriter.h, src/Subfont.cpp, src/Subfont.h,
5504 src/System.cpp, src/System.h, src/TFM.cpp, src/TFM.h, src/Terminal.cpp,
5505 src/Terminal.h, src/TpicSpecialHandler.cpp, src/TpicSpecialHandler.h,
5506 src/VFActions.h, src/VFReader.cpp, src/VFReader.h, src/VectorStream.h,
5507 src/XMLDocument.cpp, src/XMLDocument.h, src/XMLNode.cpp, src/XMLNode.h,
5508 src/XMLString.cpp, src/XMLString.h, src/dvisvgm.cpp, src/macros.h,
5509 src/options.dtd, src/options.xml, src/psdefs.cpp, src/types.h,
5510 tests/BoundingBoxTest.cpp, tests/CMapReaderTest.cpp, tests/CMapTest.cpp,
5511 tests/CRC32Test.cpp, tests/CalculatorTest.cpp,
5512 tests/ColorSpecialTest.cpp, tests/ColorTest.cpp,
5513 tests/CommandLineTest.cpp, tests/DirectoryTest.cpp,
5514 tests/FileFinderTest.cpp, tests/FilePathTest.cpp,
5515 tests/FileSystemTest.cpp, tests/FontManagerTest.cpp,
5516 tests/FontMapTest.cpp, tests/GFReaderTest.cpp, tests/GraphicPathTest.cpp,
5517 tests/LengthTest.cpp, tests/Makefile.am, tests/MapLineTest.cpp,
5518 tests/MatrixTest.cpp, tests/MessageExceptionTest.cpp,
5519 tests/PSInterpreterTest.cpp, tests/PageRagesTest.cpp,
5520 tests/PageSizeTest.cpp, tests/PairTest.cpp,
5521 tests/SplittedCharInputBufferTest.cpp, tests/StreamInputBufferTest.cpp,
5522 tests/StreamReaderTest.cpp, tests/StreamWriterTest.cpp,
5523 tests/SubfontTest.cpp, tests/TypesTest.cpp, tests/VectorStreamTest.cpp,
5524 tests/check-conv, tests/create-makefile, tests/normalize.xsl:
5525 updated year in copyright statements to 2014
5526
5527 2014-01-01 Martin Gieseking <mgieseki@users.sourceforge.net>
5528
5529 * src/MiKTeXCom.cpp:
5530 prevent releasing MiKTeX object if its initialization failed
5531
5532 2013-12-29 Martin Gieseking <mgieseki@users.sourceforge.net>
5533
5534 * src/Font.cpp:
5535 check if units per EM are not 0 to prevent divisions by zero
5536
5537 * src/Directory.cpp, src/Directory.h, src/FontMap.cpp,
5538 tests/DirectoryTest.cpp:
5539 changed directory entry types from char to enums
5540
5541 * src/FontCache.cpp:
5542 catch potential StreamReaderException
5543
5544 2013-12-18 Martin Gieseking <mgieseki@users.sourceforge.net>
5545
5546 * src/BoundingBox.cpp:
5547 explicitely initialize BoundingBox fields
5548
5549 * src/FontCache.cpp:
5550 avoid accessing strings constructed from temporaries
5551
5552 * src/Matrix.cpp:
5553 ensure return value of istream::get() is assigned to int vars
5554
5555 * src/DVIReader.cpp:
5556 check if denominator of DVI unit is non-zero
5557
5558 * src/DvisvgmSpecialHandler.cpp, src/FontCache.cpp:
5559 ensure null pointer checks before dereferencing
5560
5561 * src/FontCache.cpp, src/SpecialManager.cpp:
5562 restore stream format flags
5563
5564 * src/DVIReader.cpp, src/Directory.cpp, src/GFReader.cpp:
5565 added missing initializations of member variables
5566
5567 2013-12-09 Martin Gieseking <martin.gieseking@uos.de>
5568
5569 * src/BgColorSpecialHandler.h, src/Bitmap.h, src/BoundingBox.h,
5570 src/CMap.h, src/CMapManager.h, src/CMapReader.h, src/Calculator.h,
5571 src/CharMap.h, src/CharMapID.h, src/Character.h, src/CmdLineParserBase.h,
5572 src/Color.h, src/ColorSpecialHandler.h, src/CommandLine.h,
5573 src/DLLoader.h, src/DVIActions.h, src/DVIReader.h, src/DVIToSVG.h,
5574 src/DVIToSVGActions.h, src/Directory.h, src/DvisvgmSpecialHandler.h,
5575 src/EPSFile.h, src/EPSToSVG.h, src/EmSpecialHandler.h, src/EncFile.h,
5576 src/FileFinder.h, src/FilePath.h, src/FileSystem.h, src/Font.h,
5577 src/FontCache.h, src/FontEncoding.h, src/FontEngine.h, src/FontManager.h,
5578 src/FontMap.h, src/FontMetrics.h, src/GFGlyphTracer.h, src/GFReader.h,
5579 src/GFTracer.h, src/Ghostscript.h, src/Glyph.h,
5580 src/GlyphTracerMessages.h, src/GraphicPath.h, src/HtmlSpecialHandler.h,
5581 src/InputBuffer.h, src/InputReader.h, src/JFM.h, src/Length.h,
5582 src/MapLine.h, src/Matrix.h, src/Message.h, src/MessageException.h,
5583 src/MetafontWrapper.h, src/MiKTeXCom.h, src/NoPsSpecialHandler.h,
5584 src/PSFilter.h, src/PSInterpreter.h, src/PSPattern.h,
5585 src/PSPreviewFilter.h, src/PageRanges.h, src/PageSize.h, src/Pair.h,
5586 src/PdfSpecialHandler.h, src/Process.h, src/PsSpecialHandler.h,
5587 src/SVGOutputBase.h, src/SVGTree.h, src/SignalHandler.h,
5588 src/SpecialActions.h, src/SpecialHandler.h, src/SpecialManager.h,
5589 src/StreamReader.h, src/StreamWriter.h, src/Subfont.h, src/System.h,
5590 src/TFM.h, src/Terminal.h, src/TpicSpecialHandler.h, src/VFActions.h,
5591 src/VFReader.h, src/VectorStream.h, src/XMLDocument.h, src/XMLNode.h,
5592 src/XMLString.h, src/macros.h, src/types.h:
5593 prefixed include guards with DVISVGM_ to prevent ambiguities with
5594 external headers
5595
5596 2013-11-16 Martin Gieseking <mgieseki@users.sourceforge.net>
5597
5598 * src/DVIReader.cpp, src/SVGTree.cpp, src/SVGTree.h:
5599 don't let global font colors interfere with color specials
5600
5601 2013-10-29 Martin Gieseking <mgieseki@users.sourceforge.net>
5602
5603 * NEWS:
5604 updated NEWS
5605
5606 2013-10-28 Martin Gieseking <mgieseki@users.sourceforge.net>
5607
5608 * src/Bitmap.cpp, src/Color.cpp, src/JFM.cpp, src/Matrix.cpp:
5609 added missing #includes of header file <algorithm>
5610
5611 * src/FileSystem.cpp, src/MetafontWrapper.cpp:
5612 added explicit casts from ifstream to bool
5613
5614 * src/DVIReader.cpp:
5615 temporarily reactivated processing of font definitions located in the
5616 postamble
5617
5618 * configure.ac, src/Doxyfile:
5619 set version to 1.5.1
5620
5621 2013-10-27 Martin Gieseking <mgieseki@users.sourceforge.net>
5622
5623 * src/DVIToSVG.cpp:
5624 suppress output of logical page number if it equals physical page number
5625
5626 2013-10-16 Martin Gieseking <mgieseki@users.sourceforge.net>
5627
5628 * src/PSPreviewFilter.cpp, src/PsSpecialHandler.cpp:
5629 ensure proper evaluation of tightpage data if multiple pages are
5630 processed
5631
5632 2013-10-12 Martin Gieseking <mgieseki@users.sourceforge.net>
5633
5634 * src/InputBuffer.h:
5635 don't check unsigned variables for negative values
5636
5637 * src/Color.h, src/PsSpecialHandler.cpp, src/PsSpecialHandler.h:
5638 added 'const' to read-only methods
5639
5640 2013-09-21 Martin Gieseking <mgieseki@users.sourceforge.net>
5641
5642 * src/FontCache.cpp, src/FontCache.h:
5643 renamed FontCache::VERSION to FontCache::FORMAT_VERSION
5644
5645 * src/DVIToSVG.cpp, src/Ghostscript.h, src/dvisvgm.cpp:
5646 added missing guards and functions to prevent compilation errors if
5647 DISABLE_GS is set
5648
5649 * src/DVIToSVG.cpp:
5650 changed warning message that appears if PS support has been disabled
5651 permanently
5652
5653 2013-09-01 Martin Gieseking <martin.gieseking@uos.de>
5654
5655 * src/BgColorSpecialHandler.cpp, src/Bitmap.cpp, src/BoundingBox.cpp,
5656 src/CMap.cpp, src/CMapManager.cpp, src/CMapReader.cpp, src/CRC32.cpp,
5657 src/Calculator.cpp, src/CharMap.cpp, src/CmdLineParserBase.cpp,
5658 src/Color.cpp, src/ColorSpecialHandler.cpp, src/CommandLine.cpp,
5659 src/CommandLine.h, src/DLLoader.cpp, src/DVIActions.cpp,
5660 src/DVIReader.cpp, src/DVIToSVG.cpp, src/DVIToSVGActions.cpp,
5661 src/Directory.cpp, src/DvisvgmSpecialHandler.cpp, src/EPSFile.cpp,
5662 src/EPSToSVG.cpp, src/EmSpecialHandler.cpp, src/EncFile.cpp,
5663 src/FileFinder.cpp, src/FilePath.cpp, src/FileSystem.cpp, src/Font.cpp,
5664 src/FontCache.cpp, src/FontEncoding.cpp, src/FontEngine.cpp,
5665 src/FontManager.cpp, src/FontMap.cpp, src/FontMetrics.cpp,
5666 src/GFGlyphTracer.cpp, src/GFReader.cpp, src/GFTracer.cpp,
5667 src/Ghostscript.cpp, src/Ghostscript.h, src/HtmlSpecialHandler.cpp,
5668 src/InputBuffer.cpp, src/InputReader.cpp, src/JFM.cpp, src/Length.cpp,
5669 src/MapLine.cpp, src/Matrix.cpp, src/Message.cpp,
5670 src/MetafontWrapper.cpp, src/MiKTeXCom.cpp, src/NoPsSpecialHandler.cpp,
5671 src/PSInterpreter.cpp, src/PSPattern.cpp, src/PSPreviewFilter.cpp,
5672 src/PageRanges.cpp, src/PageSize.cpp, src/PdfSpecialHandler.cpp,
5673 src/Process.cpp, src/PsSpecialHandler.cpp, src/SVGTree.cpp,
5674 src/SignalHandler.cpp, src/SpecialManager.cpp, src/StreamReader.cpp,
5675 src/StreamWriter.cpp, src/Subfont.cpp, src/System.cpp, src/TFM.cpp,
5676 src/Terminal.cpp, src/TpicSpecialHandler.cpp, src/VFReader.cpp,
5677 src/XMLDocument.cpp, src/XMLNode.cpp, src/XMLString.cpp, src/dvisvgm.cpp:
5678 include config.h at the top of every translation unit
5679
5680 * src/DLLoader.h, src/Directory.h:
5681 moved #define NOMINMAX to Windows config.h
5682
5683 * configure.ac, src/Doxyfile:
5684 set version to 1.5
5685
5686 * NEWS:
5687 updated NEWS
5688
5689 2013-08-30 Martin Gieseking <mgieseki@users.sourceforge.net>
5690
5691 * src/FontMetrics.h, src/JFM.cpp, src/JFM.h, src/TFM.h:
5692 added retrieval of vertical mode flag to class FontMetrics
5693
5694 * src/DVIActions.h, src/DVIReader.cpp, src/DVIReader.h,
5695 src/DVIToSVGActions.cpp, src/DVIToSVGActions.h, src/Font.cpp, src/Font.h,
5696 src/FontEngine.cpp, src/FontEngine.h, src/FontMetrics.h, src/JFM.h,
5697 src/SVGTree.cpp, src/SVGTree.h, src/TFM.h, src/dvisvgm.cpp:
5698 added support for DVI format 3 (pTeX, vertical mode)
5699
5700 * src/DVIReader.cpp, src/DVIReader.h, src/Font.cpp, src/Font.h,
5701 src/FontEngine.cpp, src/FontEngine.h, src/FontManager.cpp,
5702 src/FontManager.h, src/FontStyle.h, src/SVGTree.cpp, src/dvisvgm.cpp:
5703 added support for XDV (DVI format 5) files
5704
5705 * src/Font.cpp, src/Font.h, src/XMLString.cpp:
5706 replaced entity references by corresponding UTF-8 characters; use
5707 correct unicode points rather than DVI charcodes
5708
5709 * doc/dvisvgm.txt.in:
5710 updated manpage
5711
5712 2013-08-29 Martin Gieseking <martin.gieseking@uos.de>
5713
5714 * src/CharMap.cpp, src/CharMap.h, src/Font.cpp, src/Font.h,
5715 src/FontEncoding.h, src/FontEngine.cpp, src/FontEngine.h,
5716 src/FontManager.cpp, src/Makefile.am:
5717 replaced local std::map tables used in Font classes with new class
5718 CharMap
5719
5720 2013-08-23 Martin Gieseking <mgieseki@users.sourceforge.net>
5721
5722 * src/SVGTree.cpp:
5723 appended px unit to font-size attributes in style section
5724
5725 2013-08-22 Martin Gieseking <mgieseki@users.sourceforge.net>
5726
5727 * src/XMLString.cpp:
5728 replace very small floating point numbers by 0
5729
5730 2013-08-20 Martin Gieseking <mgieseki@users.sourceforge.net>
5731
5732 * src/FileFinder.cpp:
5733 suppress error messages from makeFOO tools
5734
5735 2013-08-13 Martin Gieseking <mgieseki@users.sourceforge.net>
5736
5737 * src/CMap.cpp, src/CMap.h, src/CMapManager.cpp, src/CMapManager.h,
5738 src/EncFile.h, src/Font.cpp, src/Font.h, src/FontEncoding.cpp,
5739 src/FontEncoding.h, src/FontManager.cpp, src/FontMap.cpp, src/FontMap.h:
5740 derive EncodingPair from FontEncoding
5741
5742 * src/Font.cpp, src/Font.h, src/FontEncoding.cpp, src/FontEncoding.h,
5743 src/FontManager.cpp, src/FontMap.cpp, src/FontMap.h:
5744 moved assignment of base font map to Font class
5745
5746 2013-08-11 Martin Gieseking <mgieseki@users.sourceforge.net>
5747
5748 * configure.ac, src/FileFinder.cpp:
5749 check if the kpathsea library is C++-safe (patch by Peter Breitenlohner)
5750
5751 * src/dvisvgm.cpp:
5752 fix number of dashes printed by -V1
5753
5754 2013-08-08 Martin Gieseking <mgieseki@users.sourceforge.net>
5755
5756 * src/Matrix.cpp, src/Matrix.h:
5757 renamed Matrix skewing methods
5758
5759 2013-08-04 Martin Gieseking <mgieseki@users.sourceforge.net>
5760
5761 * src/Font.cpp, src/Font.h, src/FontEngine.cpp, src/FontManager.cpp,
5762 src/FontMap.cpp, src/FontMap.h, src/FontStyle.h, src/Makefile.am:
5763 store pointers to font map and encoding in Font objects to speed up
5764 looking them up
5765
5766 * src/Ghostscript.h, src/PSPreviewFilter.cpp, src/PsSpecialHandler.cpp:
5767 added missing variable initializations
5768
5769 2013-08-03 Martin Gieseking <mgieseki@users.sourceforge.net>
5770
5771 * src/CMapManager.cpp, src/CMapManager.h, src/FontManager.cpp:
5772 avoid const_cast in CMapManager
5773
5774 2013-08-02 Martin Gieseking <mgieseki@users.sourceforge.net>
5775
5776 * src/DVIActions.h, src/DVIReader.cpp, src/DVIToSVG.cpp:
5777 disable font processing while scanning PS header specials
5778
5779 * src/CMap.h, src/CMapManager.cpp:
5780 properly handle 'unicode' encoding entries set in font map
5781
5782 2013-08-01 Martin Gieseking <mgieseki@users.sourceforge.net>
5783
5784 * src/XMLDocument.cpp, src/XMLString.cpp:
5785 changed encoding of SVG files from ISO-8859-1 to UTF-8
5786
5787 * src/DVIToSVG.cpp, src/Makefile.am, src/SVGTree.cpp,
5788 src/XMLDocTypeNode.h:
5789 removed DOCTYPE declaration from generated files as suggested by the SVG
5790 specification
5791
5792 * src/DVIToSVG.cpp:
5793 removed redundant #include statements
5794
5795 * src/DVIToSVG.cpp, src/DVIToSVG.h, src/DVIToSVGActions.h, src/EPSToSVG.h,
5796 src/Matrix.cpp, src/Matrix.h, src/PsSpecialHandler.cpp,
5797 src/SpecialActions.h, src/dvisvgm.cpp:
5798 apply page transformations to width, height, and depth of preview bbox
5799
5800 * NEWS:
5801 updated NEWS
5802
5803 * configure.ac, src/Doxyfile:
5804 set version to 1.4
5805
5806 2013-07-31 Martin Gieseking <martin.gieseking@uos.de>
5807
5808 * src/CMap.cpp, src/CMap.h, src/CMapManager.cpp, src/CMapManager.h,
5809 src/CMapReader.cpp, src/CMapReader.h, src/FontManager.cpp,
5810 src/Makefile.am, tests/CMapTest.cpp, tests/Makefile.am:
5811 added classes to handle CMap files
5812
5813 * src/CMap.cpp, src/CMap.h, src/CMapManager.h, src/EncFile.cpp,
5814 src/EncFile.h, src/FileFinder.cpp, src/Font.cpp, src/Font.h,
5815 src/FontEncoding.cpp, src/FontEncoding.h, src/FontEngine.cpp,
5816 src/FontEngine.h, src/FontManager.cpp, src/Makefile.am,
5817 tests/CMapTest.cpp:
5818 derive .enc encoding vectors and CMaps from common base class
5819 FontEncoding
5820
5821 * src/CMap.cpp, src/CMap.h, src/Character.h, src/EncFile.h, src/Font.cpp,
5822 src/Font.h, src/FontEncoding.h, src/FontEngine.cpp, src/FontEngine.h,
5823 src/Makefile.am, tests/CMapTest.cpp:
5824 added Character class to handle character names, codes, and indexes
5825 consistently
5826
5827 * src/FileFinder.cpp, src/Font.cpp, src/Font.h, src/FontManager.cpp:
5828 added support for OTF fonts
5829
5830 * src/Font.cpp, src/Font.h, src/FontMetric.cpp, src/FontMetric.h,
5831 src/FontMetrics.cpp, src/FontMetrics.h, src/Makefile.am, src/TFM.h:
5832 renamed class FontMetric to FontMetrics
5833
5834 * src/CMap.cpp, src/CMap.h, src/CMapReader.cpp, src/CMapReader.h,
5835 tests/CMapReaderTest.cpp, tests/CMapTest.cpp, tests/Makefile.am:
5836 added evaluation of base font (bf) sections in CMap files
5837
5838 * src/CMap.h, src/CMapManager.cpp, src/CMapManager.h, src/CMapReader.cpp,
5839 src/CharMapID.cpp, src/CharMapID.h, src/Font.cpp, src/Font.h,
5840 src/FontEngine.cpp, src/FontEngine.h, src/FontManager.cpp,
5841 src/FontMap.cpp, src/FontMap.h, src/Makefile.am:
5842 try to decode characters of non-CID fonts that have a CMap assigned in
5843 the fontmap
5844
5845 2013-07-27 Martin Gieseking <mgieseki@users.sourceforge.net>
5846
5847 * src/Font.cpp, src/Font.h, src/FontEncoding.cpp, src/FontEncoding.h:
5848 moved lookup of the encoding of a font to the Font class
5849
5850 * src/JFM.cpp:
5851 fixed retrieval of char indexes if a JFM contains entries of chartype 0
5852 only
5853
5854 * src/BgColorSpecialHandler.h, src/DVIToSVG.cpp, src/PSInterpreter.cpp,
5855 src/PSInterpreter.h, src/PsSpecialHandler.cpp, src/PsSpecialHandler.h,
5856 src/SpecialManager.cpp, src/SpecialManager.h:
5857 ensure that PS header code is evaluated before the page/body code; also
5858 execute bop-hook and eop-hook
5859
5860 * src/PSInterpreter.cpp, src/PSInterpreter.h, src/PsSpecialHandler.cpp:
5861 added funtion to execute PS code snippets and retrieve their results
5862
5863 * doc/dvisvgm.txt.in, src/DVIActions.h, src/DVIReader.cpp,
5864 src/DVIToSVG.cpp, src/DVIToSVGActions.cpp, src/DVIToSVGActions.h,
5865 src/EPSToSVG.cpp, src/Makefile.am, src/PSFilter.h, src/PSInterpreter.cpp,
5866 src/PSInterpreter.h, src/PSPreviewFilter.cpp, src/PSPreviewFilter.h,
5867 src/PsSpecialHandler.cpp, src/PsSpecialHandler.h, src/SpecialActions.h,
5868 src/SpecialHandler.h, src/SpecialManager.cpp, src/SpecialManager.h:
5869 added evaluation of bounding box information created by preview package
5870
5871 2013-07-23 Martin Gieseking <mgieseki@users.sourceforge.net>
5872
5873 * src/EPSToSVG.cpp:
5874 print warning message if height or width of EPS bbox is 0
5875
5876 * src/psdefs.cpp:
5877 PS handler: call newpath before executing charpath in operator show
5878
5879 * src/FontMap.cpp:
5880 check for EOF prior to try to parse another mapline
5881
5882 2013-07-18 Martin Gieseking <martin.gieseking@uos.de>
5883
5884 * src/psdefs.cpp:
5885 replaced PS operator prval with =only in psdefs
5886
5887 2013-07-17 Martin Gieseking <mgieseki@users.sourceforge.net>
5888
5889 * src/DVIToSVG.cpp:
5890 ensure catching PSExceptions while processing PS header specials to
5891 prevent segfaults
5892
5893 * src/psdefs.cpp:
5894 properly store PS operator applyscalevals in systemdict
5895
5896 2013-07-14 Martin Gieseking <mgieseki@users.sourceforge.net>
5897
5898 * src/Process.cpp, src/Process.h:
5899 extended Process::run() to grab the output written to stdout
5900
5901 * src/FileFinder.cpp, src/FileFinder.h:
5902 FileFinder: added lookup of cmap files
5903
5904 2013-07-08 Martin Gieseking <martin.gieseking@uos.de>
5905
5906 * src/CmdLineParserBase.cpp, src/CmdLineParserBase.h, src/CommandLine.cpp:
5907 command-line parser: changed type of argument mode from char to enum
5908
5909 2013-06-17 Martin Gieseking <mgieseki@users.sourceforge.net>
5910
5911 * src/FileFinder.cpp:
5912 removed redundant 'using namespace std'
5913
5914 2013-06-03 Martin Gieseking <mgieseki@users.sourceforge.net>
5915
5916 * doc/dvisvgm.txt.in, src/HtmlSpecialHandler.cpp,
5917 src/HtmlSpecialHandler.h, src/dvisvgm.cpp:
5918 extend option --linkmark to highlight linked areas by a given background
5919 color
5920
5921 2013-06-01 Martin Gieseking <martin.gieseking@uos.de>
5922
5923 * src/Color.cpp, src/Color.h, src/ColorSpecialHandler.cpp,
5924 src/ColorSpecialHandler.h, src/SpecialActions.h,
5925 tests/ColorSpecialTest.cpp, tests/ColorTest.cpp, tests/Makefile.am:
5926 use Color class in ColorSpecialHandler rather than local code; added
5927 ColorTest
5928
5929 2013-05-22 Martin Gieseking <mgieseki@users.sourceforge.net>
5930
5931 * src/dvisvgm.cpp:
5932 added a missing (underlining) hyphen to the output of -V1
5933
5934 2013-05-17 Martin Gieseking <martin.gieseking@uos.de>
5935
5936 * src/NoPsSpecialHandler.cpp, src/NoPsSpecialHandler.h:
5937 added missing NoPsSpecialhandler files
5938
5939 2013-05-13 Martin Gieseking <martin.gieseking@uos.de>
5940
5941 * src/Font.cpp, src/Font.h, src/FontManager.h, src/FontMetric.cpp,
5942 src/FontMetric.h, src/Makefile.am, src/TFM.cpp, src/TFM.h:
5943 handle invalid TFM files properly
5944
5945 * src/Font.cpp, src/FontMetric.cpp, src/FontMetric.h, src/JFM.cpp,
5946 src/JFM.h, src/Makefile.am, src/StreamReader.h, src/TFM.cpp, src/TFM.h:
5947 added support for Japanese font metric (JFM) files
5948
5949 * src/FileFinder.cpp, src/MiKTeXCom.cpp, src/MiKTeXCom.h, src/dvisvgm.cpp:
5950 try to load the Ghostscript library that comes with MiKTeX
5951
5952 * doc/dvisvgm.txt.in, src/DVIToSVG.cpp, src/HtmlSpecialHandler.cpp,
5953 src/HtmlSpecialHandler.h, src/Makefile.am, src/SpecialManager.cpp:
5954 added support of hyperref specials
5955
5956 * doc/dvisvgm.txt.in, src/CommandLine.cpp, src/CommandLine.h,
5957 src/HtmlSpecialHandler.cpp, src/dvisvgm.cpp, src/options.xml:
5958 added option --linkmark to select the highlighing variant for hyperlinks
5959
5960 * configure.ac, src/Doxyfile:
5961 set version to 1.3
5962
5963 * NEWS:
5964 updated NEWS
5965
5966 2013-05-02 Martin Gieseking <martin.gieseking@uos.de>
5967
5968 * AUTHORS, Makefile.am, README, configure.ac, potracelib/Makefile.am,
5969 potracelib/auxiliary.h, potracelib/bitmap.h, potracelib/curve.c,
5970 potracelib/curve.h, potracelib/decompose.c, potracelib/decompose.h,
5971 potracelib/lists.h, potracelib/potracelib.c, potracelib/potracelib.h,
5972 potracelib/progress.h, potracelib/trace.c, potracelib/trace.h:
5973 removed bundled potrace library
5974
5975 * src/SVGTree.cpp, src/SVGTree.h:
5976 added methods to push and pop 'context elements' to a page that wrap
5977 parts of the page contents
5978
5979 * src/DVIToSVGActions.h, src/EPSToSVG.h, src/SpecialActions.h:
5980 provide the context push/pop methods of class SVGTree to special
5981 handlers
5982
5983 * src/InputReader.cpp, src/InputReader.h:
5984 added optional parameter 'quotechar' to InputReader::parseAttributes()
5985
5986 * src/EmSpecialHandler.h, src/NoPsSpecialHandler.h, src/SpecialHandler.h,
5987 src/SpecialManager.cpp, src/SpecialManager.h, src/TpicSpecialHandler.h:
5988 moved DVI listener methods to dedicated listener interface classes
5989
5990 * src/DVIActions.h, src/DVIReader.cpp, src/DVIReader.h, src/DVIToSVG.cpp,
5991 src/DVIToSVG.h, src/DVIToSVGActions.cpp, src/DVIToSVGActions.h,
5992 src/EmSpecialHandler.cpp, src/EmSpecialHandler.h,
5993 src/NoPsSpecialHandler.cpp, src/NoPsSpecialHandler.h,
5994 src/SpecialHandler.h, src/SpecialManager.cpp, src/SpecialManager.h,
5995 src/TpicSpecialHandler.cpp, src/TpicSpecialHandler.h:
5996 added page number parameter to DVIEndPageListener::dviEndPage()
5997
5998 2013-05-01 Martin Gieseking <mgieseki@users.sourceforge.net>
5999
6000 * src/DVIToSVGActions.cpp, src/Terminal.cpp, src/Terminal.h:
6001 disable cursor when showing the progress indicator (Windows only)
6002
6003 2013-04-26 Martin Gieseking <mgieseki@users.sourceforge.net>
6004
6005 * src/DVIToSVG.cpp:
6006 don't link NoPsSpecialHandler if HAVE_LIBGS
6007
6008 2013-04-25 Martin Gieseking <mgieseki@users.sourceforge.net>
6009
6010 * src/FontEncoding.cpp:
6011 fixed bracketing bug that prevented lookup of fontmap files
6012
6013 2013-04-24 Martin Gieseking <mgieseki@users.sourceforge.net>
6014
6015 * src/BoundingBox.cpp, src/BoundingBox.h, src/Calculator.cpp,
6016 src/Calculator.h, src/Matrix.cpp, src/Matrix.h, src/MessageException.h,
6017 src/PageSize.cpp, src/PageSize.h, src/StreamReader.cpp,
6018 src/StreamReader.h, src/VFReader.cpp, src/VFReader.h, src/VectorStream.h,
6019 src/XMLDocument.cpp, src/XMLDocument.h:
6020 added missing underscores to private member variables
6021
6022 * configure.ac, src/Doxyfile:
6023 set version to 1.2.2
6024
6025 * NEWS:
6026 updated NEWS
6027
6028 2013-04-23 Martin Gieseking <mgieseki@users.sourceforge.net>
6029
6030 * src/DVIToSVG.cpp, src/EPSToSVG.cpp, src/dvisvgm.cpp:
6031 avoid output of empty parentheses if TARGET_SYSTEM is not set
6032
6033 * doc/dvisvgm.txt.in, src/CmdLineParserBase.cpp, src/CommandLine.cpp,
6034 src/options.dtd, src/options.xml:
6035 added information about 'dvisvgm -E' to usage line
6036
6037 * src/BoundingBox.cpp, src/BoundingBox.h, src/Calculator.h,
6038 src/CmdLineParserBase.h, src/DVIToSVGActions.cpp, src/Message.cpp,
6039 src/VFReader.cpp:
6040 added missing member initializations to some classes
6041
6042 2013-04-20 Martin Gieseking <martin.gieseking@uos.de>
6043
6044 * src/DVIToSVG.cpp, src/Makefile.am, src/SpecialManager.cpp:
6045 print a warning message if PS specials are found but ignored
6046
6047 2013-04-15 Martin Gieseking <mgieseki@users.sourceforge.net>
6048
6049 * src/FileFinder.cpp, src/dvisvgm.cpp:
6050 catch MessageException if MiKTeX version can't be obtained
6051
6052 2013-04-09 Martin Gieseking <mgieseki@users.sourceforge.net>
6053
6054 * tests/Makefile.am, tests/create-makefile:
6055 updated tests/Makefile.am to honor system potracelib if present
6056
6057 * configure.ac, src/Doxyfile:
6058 set version to 1.2.1
6059
6060 * NEWS:
6061 updated NEWS
6062
6063 2013-04-08 Martin Gieseking <mgieseki@users.sourceforge.net>
6064
6065 * doc/dvisvgm.txt.in, src/Color.cpp, src/Color.h, src/DVIToSVGActions.cpp:
6066 allow the background color special to insert white rectancles
6067
6068 * src/PageRanges.h:
6069 dropped unused variable PageRanges::_max
6070
6071 2013-04-04 Martin Gieseking <mgieseki@users.sourceforge.net>
6072
6073 * src/XMLNode.cpp, src/XMLNode.h:
6074 unhide derived method XMLDeclarationNode::append
6075
6076 2013-03-10 Martin Gieseking <mgieseki@users.sourceforge.net>
6077
6078 * Makefile.am, configure.ac:
6079 don't build bundled potracelib if system library is used (patch by
6080 Alexis Ballier)
6081
6082 2013-03-03 Martin Gieseking <mgieseki@users.sourceforge.net>
6083
6084 * potracelib/auxiliary.h, potracelib/bitmap.h, potracelib/curve.c,
6085 potracelib/curve.h, potracelib/decompose.c, potracelib/decompose.h,
6086 potracelib/lists.h, potracelib/potracelib.c, potracelib/potracelib.h,
6087 potracelib/progress.h, potracelib/trace.c, potracelib/trace.h:
6088 updated bundled potrace library to version 1.11
6089
6090 2013-03-02 Martin Gieseking <martin.gieseking@uos.de>
6091
6092 * potracelib/auxiliary.h, potracelib/bitmap.h, potracelib/curve.c,
6093 potracelib/decompose.h, potracelib/lists.h, potracelib/progress.h,
6094 potracelib/trace.c, potracelib/trace.h, src/EPSFile.cpp,
6095 src/EPSToSVG.cpp, src/EPSToSVG.h, src/PSPattern.cpp, src/PSPattern.h,
6096 src/SVGOutputBase.h:
6097 converted DOS line endings
6098
6099 2013-02-28 Martin Gieseking <martin.gieseking@uos.de>
6100
6101 * src/Makefile.am, src/PSInterpreter.cpp, src/PSInterpreter.h,
6102 src/PSPattern.cpp, src/PSPattern.h, src/PsSpecialHandler.cpp,
6103 src/PsSpecialHandler.h, src/psdefs.psc, tests/PSInterpreterTest.cpp:
6104 PS handler: added support of tiling patterns
6105
6106 * src/Makefile.am, src/PSInterpreter.cpp, src/psdefs.cpp, src/psdefs.psc:
6107 make psdefs a separate compilation unit
6108
6109 * tests/MapLineTest.cpp:
6110 prevent MapLineTest from failing if file UGBK.sfd is not available
6111
6112 * src/psdefs.cpp:
6113 improved processing of PS operator 'show'
6114
6115 * configure.ac, src/Doxyfile:
6116 set version to 1.2
6117
6118 * NEWS:
6119 updated NEWS
6120
6121 2013-02-21 Martin Gieseking <mgieseki@users.sourceforge.net>
6122
6123 * src/XMLNode.cpp, src/XMLNode.h:
6124 added virtual constructor XMLNode::clone()
6125
6126 * src/XMLNode.cpp, src/XMLNode.h:
6127 added methods to lookup attribute values and selected descendant XML
6128 nodes
6129
6130 2013-02-19 Martin Gieseking <mgieseki@users.sourceforge.net>
6131
6132 * src/PSInterpreter.cpp, src/PSInterpreter.h:
6133 added PSInterpreter::limit() to limit the number of bytes to be
6134 processed
6135
6136 * doc/dvisvgm.txt.in, src/CommandLine.cpp, src/CommandLine.h,
6137 src/DVIToSVG.cpp, src/DVIToSVG.h, src/EPSFile.cpp, src/EPSFile.h,
6138 src/EPSToSVG.cpp, src/EPSToSVG.h, src/Makefile.am,
6139 src/PsSpecialHandler.cpp, src/SVGOutputBase.h, src/dvisvgm.cpp,
6140 src/options.xml:
6141 add option to directly convert EPS files to SVG
6142
6143 * src/FilePath.cpp:
6144 adapt path separators on Windows systems to get the correct output path
6145
6146 2013-02-11 Martin Gieseking <martin.gieseking@uos.de>
6147
6148 * src/CmdLineParserBase.cpp, src/CmdLineParserBase.h, src/CommandLine.cpp,
6149 src/CommandLine.h:
6150 applied a few refactorings to the command-line parser
6151
6152 2013-02-07 Martin Gieseking <martin.gieseking@uos.de>
6153
6154 * doc/dvisvgm.txt.in, src/CmdLineParserBase.cpp, src/CmdLineParserBase.h,
6155 src/CommandLine.cpp, src/CommandLine.h, src/dvisvgm.cpp, src/options.xml:
6156 added optional parameter to option --help to specify output format
6157
6158 2013-02-06 Martin Gieseking <mgieseki@users.sourceforge.net>
6159
6160 * doc/dvisvgm.txt.in, src/BoundingBox.cpp, src/CommandLine.cpp,
6161 src/CommandLine.h, src/EmSpecialHandler.cpp, src/GraphicPath.h,
6162 src/Matrix.cpp, src/PsSpecialHandler.cpp, src/TpicSpecialHandler.cpp,
6163 src/XMLString.cpp, src/XMLString.h, src/dvisvgm.cpp, src/options.xml:
6164 added option --precision to set the number of decimal places applied to
6165 attribute values
6166
6167 2013-01-30 Martin Gieseking <mgieseki@users.sourceforge.net>
6168
6169 * src/CommandLine.cpp:
6170 fixed alignment of --help text
6171
6172 2013-01-22 Martin Gieseking <martin.gieseking@uos.de>
6173
6174 * src/FileFinder.cpp, src/FontEngine.cpp, src/Makefile.am,
6175 src/MiKTeXCom.cpp, src/MiKTeXCom.h:
6176 moved MiKTeX COM code to separate class
6177
6178 2013-01-21 Martin Gieseking <martin.gieseking@uos.de>
6179
6180 * src/DVIReader.cpp, src/DVIToSVG.cpp, src/FileFinder.cpp, src/Font.cpp,
6181 src/Font.h, src/FontEncoding.cpp, src/FontEngine.cpp, src/FontEngine.h,
6182 src/FontManager.cpp, src/FontMap.cpp, src/FontMap.h, src/Makefile.am,
6183 src/MapLine.cpp, src/MapLine.h, src/Subfont.cpp, src/Subfont.h,
6184 tests/FontMapTest.cpp, tests/Makefile.am, tests/MapLineTest.cpp,
6185 tests/SubfontTest.cpp, tests/create-makefile, tests/sample.sfd:
6186 added support for subfont definitions and multi-font (.ttc) files
6187
6188 * src/FontManager.cpp, src/FontMap.cpp, src/FontMap.h, src/MapLine.h:
6189 replaced FontMap entries by pointers; initialize entries with MapLine
6190 objects
6191
6192 * src/CommandLine.cpp, src/Font.cpp, src/Font.h, src/FontEngine.cpp,
6193 src/FontEngine.h, src/FontManager.cpp, src/FontMap.cpp, src/FontMap.h,
6194 src/MapLine.cpp, src/MapLine.h, tests/MapLineTest.cpp:
6195 implemented evaluation of font style options given in a mapline
6196
6197 * configure.ac, src/Doxyfile:
6198 set version to 1.1
6199
6200 * NEWS, README:
6201 updated NEWS and README
6202
6203 2013-01-20 Martin Gieseking <mgieseki@users.sourceforge.net>
6204
6205 * src/FontEngine.cpp, src/FontEngine.h:
6206 removed unneeded code related to font sizes from class FontEngine
6207
6208 2013-01-16 Martin Gieseking <mgieseki@users.sourceforge.net>
6209
6210 * doc/dvisvgm.txt.in, src/CommandLine.cpp, src/CommandLine.h,
6211 src/FontMap.cpp, src/FontMap.h, src/dvisvgm.cpp, src/options.xml:
6212 renamed option --map-file to --fontmap; allow multiple mapfiles and
6213 modes
6214
6215 * doc/dvisvgm.txt.in, src/DVIToSVG.cpp, src/FontMap.cpp, src/FontMap.h,
6216 src/Makefile.am, src/PdfSpecialHandler.cpp, src/PdfSpecialHandler.h:
6217 added PdfSpecialHandler to evaluate pdf:mapline and pdf:mapfile specials
6218
6219 2013-01-10 Martin Gieseking <mgieseki@users.sourceforge.net>
6220
6221 * src/Font.cpp, src/FontEncoding.cpp:
6222 fixed a string exception that occurred when an encoding file or an entry
6223 in the encoding table is unavailable
6224
6225 2013-01-06 Martin Gieseking <mgieseki@users.sourceforge.net>
6226
6227 * src/FileFinder.cpp, src/FileFinder.h, src/FontEncoding.cpp,
6228 src/FontEncoding.h:
6229 removed font encoding methods from FileFinder
6230
6231 2013-01-02 Martin Gieseking <martin.gieseking@uos.de>
6232
6233 * Makefile.am, README, configure.ac, doc/Makefile.am, doc/dvisvgm.txt.in,
6234 src/BgColorSpecialHandler.cpp, src/BgColorSpecialHandler.h,
6235 src/Bitmap.cpp, src/Bitmap.h, src/BoundingBox.cpp, src/BoundingBox.h,
6236 src/CRC32.cpp, src/CRC32.h, src/Calculator.cpp, src/Calculator.h,
6237 src/CmdLineParserBase.cpp, src/CmdLineParserBase.h, src/Color.cpp,
6238 src/Color.h, src/ColorSpecialHandler.cpp, src/ColorSpecialHandler.h,
6239 src/CommandLine.cpp, src/CommandLine.h, src/DLLoader.cpp, src/DLLoader.h,
6240 src/DVIActions.cpp, src/DVIActions.h, src/DVIReader.cpp, src/DVIReader.h,
6241 src/DVIToSVG.cpp, src/DVIToSVG.h, src/DVIToSVGActions.cpp,
6242 src/DVIToSVGActions.h, src/Directory.cpp, src/Directory.h,
6243 src/DvisvgmSpecialHandler.cpp, src/DvisvgmSpecialHandler.h,
6244 src/EmSpecialHandler.cpp, src/EmSpecialHandler.h, src/FileFinder.cpp,
6245 src/FileFinder.h, src/FilePath.cpp, src/FilePath.h, src/FileSystem.cpp,
6246 src/FileSystem.h, src/Font.cpp, src/Font.h, src/FontCache.cpp,
6247 src/FontCache.h, src/FontEncoding.cpp, src/FontEncoding.h,
6248 src/FontEngine.cpp, src/FontEngine.h, src/FontManager.cpp,
6249 src/FontManager.h, src/FontMap.cpp, src/FontMap.h, src/GFGlyphTracer.cpp,
6250 src/GFGlyphTracer.h, src/GFReader.cpp, src/GFReader.h, src/GFTracer.cpp,
6251 src/GFTracer.h, src/Ghostscript.cpp, src/Ghostscript.h, src/Glyph.h,
6252 src/GlyphTracerMessages.h, src/GraphicPath.h, src/InputBuffer.cpp,
6253 src/InputBuffer.h, src/InputReader.cpp, src/InputReader.h,
6254 src/Length.cpp, src/Length.h, src/Makefile.am, src/Matrix.cpp,
6255 src/Matrix.h, src/Message.cpp, src/Message.h, src/MessageException.h,
6256 src/MetafontWrapper.cpp, src/MetafontWrapper.h, src/MiKTeXCom.cpp,
6257 src/MiKTeXCom.h, src/PSInterpreter.cpp, src/PSInterpreter.h,
6258 src/PageRanges.cpp, src/PageRanges.h, src/PageSize.cpp, src/PageSize.h,
6259 src/Pair.h, src/Process.cpp, src/Process.h, src/PsSpecialHandler.cpp,
6260 src/PsSpecialHandler.h, src/SVGTree.cpp, src/SVGTree.h,
6261 src/SignalHandler.cpp, src/SignalHandler.h, src/SpecialActions.h,
6262 src/SpecialHandler.h, src/SpecialManager.cpp, src/SpecialManager.h,
6263 src/StreamReader.cpp, src/StreamReader.h, src/StreamWriter.cpp,
6264 src/StreamWriter.h, src/System.cpp, src/System.h, src/TFM.cpp, src/TFM.h,
6265 src/Terminal.cpp, src/Terminal.h, src/TpicSpecialHandler.cpp,
6266 src/TpicSpecialHandler.h, src/VFActions.h, src/VFReader.cpp,
6267 src/VFReader.h, src/VectorStream.h, src/XMLDocTypeNode.h,
6268 src/XMLDocument.cpp, src/XMLDocument.h, src/XMLNode.cpp, src/XMLNode.h,
6269 src/XMLString.cpp, src/XMLString.h, src/dvisvgm.cpp, src/macros.h,
6270 src/options.dtd, src/options.xml, src/psdefs.psc, src/types.h,
6271 tests/BoundingBoxTest.cpp, tests/CRC32Test.cpp, tests/CalculatorTest.cpp,
6272 tests/ColorSpecialTest.cpp, tests/CommandLineTest.cpp,
6273 tests/DirectoryTest.cpp, tests/FileFinderTest.cpp,
6274 tests/FilePathTest.cpp, tests/FileSystemTest.cpp,
6275 tests/FontManagerTest.cpp, tests/FontMapTest.cpp, tests/GFReaderTest.cpp,
6276 tests/GraphicPathTest.cpp, tests/LengthTest.cpp, tests/Makefile.am,
6277 tests/MatrixTest.cpp, tests/MessageExceptionTest.cpp,
6278 tests/PSInterpreterTest.cpp, tests/PageRagesTest.cpp,
6279 tests/PageSizeTest.cpp, tests/PairTest.cpp,
6280 tests/SplittedCharInputBufferTest.cpp, tests/StreamInputBufferTest.cpp,
6281 tests/StreamReaderTest.cpp, tests/StreamWriterTest.cpp,
6282 tests/TypesTest.cpp, tests/VectorStreamTest.cpp, tests/create-makefile:
6283 updated year in copyright statements to 2013
6284
6285 2012-12-23 Martin Gieseking <mgieseki@users.sourceforge.net>
6286
6287 * src/FontCache.cpp, src/PsSpecialHandler.cpp, src/TpicSpecialHandler.cpp:
6288 check emptiness of containers with empty() instead of size()
6289
6290 * src/FileFinder.cpp, src/MiKTeXCom.cpp, src/Process.cpp:
6291 avoid creating copies of exception objects
6292
6293 * src/CmdLineParserBase.h, src/Directory.cpp, src/GFReader.cpp,
6294 src/PsSpecialHandler.cpp:
6295 initialize uninitialized member variables
6296
6297 * src/FileFinder.cpp, src/Message.cpp, src/dvisvgm.cpp:
6298 reduced scope of some variables
6299
6300 2012-12-12 Martin Gieseking <mgieseki@users.sourceforge.net>
6301
6302 * src/FontCache.cpp:
6303 replaced 'char' with 'glyph' in font cache listing
6304
6305 * src/SpecialManager.cpp:
6306 clear all corresponding containers when calling
6307 SpecialHandler::unregisterHandlers()
6308
6309 2012-12-03 Martin Gieseking <mgieseki@users.sourceforge.net>
6310
6311 * src/Ghostscript.cpp:
6312 added explicit cast to avoid signed/unsigned comparison warning
6313
6314 2012-12-02 Martin Gieseking <mgieseki@users.sourceforge.net>
6315
6316 * src/FilePath.cpp, tests/FilePathTest.cpp:
6317 strip drive letter if it's not set (Windows only)
6318
6319 * tests/FileSystemTest.cpp, tests/GFReaderTest.cpp:
6320 ensure that tests work properly on Windows
6321
6322 * src/macros.h:
6323 removed SHOW() from macros.h
6324
6325 * doc/dvisvgm.txt.in, src/Ghostscript.cpp:
6326 use gsdll64.dll for 64-bit builds; added info about gsdll64.dll to
6327 manpage
6328
6329 2012-11-24 Martin Gieseking <mgieseki@users.sourceforge.net>
6330
6331 * src/Message.cpp:
6332 don't wrap message lines explicitly on Windows
6333 * * *
6334
6335 2012-11-23 Martin Gieseking <mgieseki@users.sourceforge.net>
6336
6337 * src/Ghostscript.cpp, src/Ghostscript.h, src/PSInterpreter.cpp,
6338 src/PSInterpreter.h, src/dvisvgm.cpp:
6339 print an error message if the execution of PS code fails
6340
6341 * src/PSInterpreter.cpp, src/psdefs.psc:
6342 print operand stack in case of a PS error
6343
6344 2012-11-22 Martin Gieseking <mgieseki@users.sourceforge.net>
6345
6346 * src/Message.cpp:
6347 handle wrapping of messages containing newlines correctly
6348
6349 2012-11-21 Martin Gieseking <mgieseki@users.sourceforge.net>
6350
6351 * src/DLLoader.cpp, src/DLLoader.h, src/Ghostscript.cpp:
6352 renamed DLLoader::loadFunction() to DLLoader::loadSymbol()
6353
6354 2012-11-19 Martin Gieseking <mgieseki@users.sourceforge.net>
6355
6356 * src/FontEngine.cpp, src/FontEngine.h:
6357 renamed FontEngine::fname to FontEngine::_fontname
6358
6359 * src/Font.cpp, src/Font.h, src/FontManager.cpp:
6360 print warning if font checksums don't match
6361
6362 2012-11-16 Martin Gieseking <mgieseki@users.sourceforge.net>
6363
6364 * src/Directory.h:
6365 undefine macro max() to avoid compilation problems on Windows
6366
6367 2012-11-15 Martin Gieseking <mgieseki@users.sourceforge.net>
6368
6369 * src/FileFinder.cpp, src/FileFinder.h, src/FontMap.cpp, src/FontMap.h,
6370 tests/FontMapTest.cpp:
6371 made class FontMap a singleton
6372
6373 * src/FileFinder.cpp, src/FileFinder.h, src/dvisvgm.cpp:
6374 moved initialization of FontMap from FileFinder to dvisvgm.cpp
6375
6376 * src/Makefile.am, src/MapLine.cpp, src/MapLine.h, tests/Makefile.am,
6377 tests/MapLineTest.cpp:
6378 added new class MapLine to parse and evaluate a single line of a map
6379 file
6380
6381 * src/FileFinder.cpp, src/FontManager.cpp, src/FontMap.cpp, src/FontMap.h,
6382 tests/FontMapTest.cpp:
6383 adapted code to use new MapLine class; introduced support of map line
6384 modes
6385
6386 2012-11-14 Martin Gieseking <mgieseki@users.sourceforge.net>
6387
6388 * src/FileFinder.cpp:
6389 initialize Ghostscript when compiled for TeX Live Win32 (patch by Peter
6390 Breitenlohner)
6391
6392 * src/FileFinder.cpp, src/FileFinder.h, src/dvisvgm.cpp,
6393 tests/FileFinderTest.cpp, tests/FontManagerTest.cpp:
6394 initialize second parameter of kpse_set_program_name() correctly
6395
6396 * src/DVIToSVG.cpp:
6397 prevent compilation error when using a C++11 compiler (patch by Peter
6398 Breitenlohner)
6399
6400 2012-11-11 Martin Gieseking <mgieseki@users.sourceforge.net>
6401
6402 * src/InputBuffer.cpp, src/InputBuffer.h, src/InputReader.cpp,
6403 src/InputReader.h, src/PsSpecialHandler.cpp,
6404 tests/StreamInputBufferTest.cpp:
6405 some refactorings of class InputReader; added InputReader::find()
6406
6407 2012-10-24 Martin Gieseking <mgieseki@users.sourceforge.net>
6408
6409 * src/DVIToSVG.cpp, src/DVIToSVG.h, src/dvisvgm.cpp:
6410 don't show warning about disabled PS support in list of special handlers
6411
6412 2012-09-27 Martin Gieseking <martin.gieseking@uos.de>
6413
6414 * configure.ac, src/Doxyfile:
6415 set version to 1.0.12
6416
6417 * NEWS:
6418 updated NEWS
6419
6420 * src/options.ggo:
6421 removed deprecated file options.ggo
6422
6423 2012-09-20 Martin Gieseking <mgieseki@users.sourceforge.net>
6424
6425 * src/DVIToSVG.cpp:
6426 show warning if processing of PS specials is disabled
6427
6428 * src/PsSpecialHandler.cpp, src/PsSpecialHandler.h:
6429 removed Ghostscript info from ps entry in list of special handlers
6430
6431 2012-09-19 Martin Gieseking <martin.gieseking@uos.de>
6432
6433 * src/psdefs.psc:
6434 ignore dvips bop operators that might be present in PS specials
6435
6436 2012-09-17 Martin Gieseking <mgieseki@users.sourceforge.net>
6437
6438 * src/StreamReader.cpp:
6439 fixed reading invalid number of string characters
6440
6441 2012-04-17 Martin Gieseking <mgieseki@users.sourceforge.net>
6442
6443 * doc/Makefile.am:
6444 keep manpage when calling 'make clean'
6445
6446 2012-04-04 Martin Gieseking <mgieseki@users.sourceforge.net>
6447
6448 * src/DVIToSVGActions.cpp, src/SVGTree.cpp, src/SVGTree.h,
6449 tests/frktest-nf-cmp.svg, tests/frktest-wf-cmp.svg,
6450 tests/sample-nf-cmp.svg, tests/sample-wf-cmp.svg:
6451 scale point units in the SVG files to big points (bp)
6452
6453 2012-04-02 Martin Gieseking <mgieseki@users.sourceforge.net>
6454
6455 * src/Matrix.cpp, src/Matrix.h, tests/MatrixTest.cpp:
6456 added Matrix::invert() and det()
6457
6458 2012-03-29 Martin Gieseking <mgieseki@users.sourceforge.net>
6459
6460 * src/Matrix.cpp, src/Matrix.h, tests/MatrixTest.cpp:
6461 added start index parameter to Matrix::set(vector<>)
6462
6463 2012-03-21 Martin Gieseking <martin.gieseking@uos.de>
6464
6465 * src/psdefs.psc:
6466 evaluate PS operators rectclip, rectfill, and rectstroke
6467
6468 2012-03-09 Martin Gieseking <mgieseki@users.sourceforge.net>
6469
6470 * src/Ghostscript.cpp, src/Ghostscript.h:
6471 added optional parameter to Ghostscript::revision() to retrieve the
6472 revision number only
6473
6474 * src/dvisvgm.cpp:
6475 added Ghostscript to library list printed by --version=yes
6476
6477 * NEWS:
6478 updated NEWS
6479
6480 2012-03-08 Martin Gieseking <martin.gieseking@uos.de>
6481
6482 * configure.ac, src/Doxyfile:
6483 set version to 1.0.11
6484
6485 2012-03-07 Martin Gieseking <mgieseki@users.sourceforge.net>
6486
6487 * src/DVIToSVGActions.cpp:
6488 correct location of a rule's bounding box (lp bug #948713)
6489
6490 2012-02-24 Martin Gieseking <mgieseki@users.sourceforge.net>
6491
6492 * doc/dvisvgm.txt.in:
6493 fixed a couple of mistakes and formatting flaws in the manpage
6494
6495 2012-02-17 Martin Gieseking <mgieseki@users.sourceforge.net>
6496
6497 * README:
6498 updated information about bug reporting
6499
6500 2012-01-26 Martin Gieseking <mgieseki@users.sourceforge.net>
6501
6502 * src/CmdLineParserBase.h, src/DVIActions.h, src/DVIReader.h,
6503 src/DVIToSVGActions.h, src/FontEngine.h, src/FontManager.h,
6504 src/MetafontWrapper.h, src/SVGTree.h, src/SpecialActions.h,
6505 src/SpecialHandler.h, src/SpecialManager.h, src/TFM.h, src/VFReader.h:
6506 adapt forward declarations of classes and structs to their corresponding
6507 definition (SF bug #3480013)
6508
6509 2012-01-16 Martin Gieseking <martin.gieseking@uos.de>
6510
6511 * src/miktex-core.def, src/miktex-kps.def, src/miktex-kps.h:
6512 removed outdated files for old MiKTeX bindings
6513
6514 2012-01-09 Martin Gieseking <mgieseki@users.sourceforge.net>
6515
6516 * src/InputReader.cpp, tests/StreamInputBufferTest.cpp:
6517 fixed parsing of negative floating point numbers starting with '-0.' (SF
6518 bug #3471097)
6519
6520 * src/TpicSpecialHandler.cpp:
6521 added some more comments to methods of class TpicSpecialHandler
6522
6523 2012-01-06 Martin Gieseking <martin.gieseking@uos.de>
6524
6525 * Makefile.am, README, configure.ac, doc/Makefile.am, doc/dvisvgm.txt.in,
6526 src/BgColorSpecialHandler.cpp, src/BgColorSpecialHandler.h,
6527 src/Bitmap.cpp, src/Bitmap.h, src/BoundingBox.cpp, src/BoundingBox.h,
6528 src/CRC32.cpp, src/CRC32.h, src/Calculator.cpp, src/Calculator.h,
6529 src/CmdLineParserBase.cpp, src/CmdLineParserBase.h, src/Color.cpp,
6530 src/Color.h, src/ColorSpecialHandler.cpp, src/ColorSpecialHandler.h,
6531 src/CommandLine.cpp, src/CommandLine.h, src/DLLoader.cpp, src/DLLoader.h,
6532 src/DVIActions.cpp, src/DVIActions.h, src/DVIReader.cpp, src/DVIReader.h,
6533 src/DVIToSVG.cpp, src/DVIToSVG.h, src/DVIToSVGActions.cpp,
6534 src/DVIToSVGActions.h, src/Directory.cpp, src/Directory.h,
6535 src/DvisvgmSpecialHandler.cpp, src/DvisvgmSpecialHandler.h,
6536 src/EmSpecialHandler.cpp, src/EmSpecialHandler.h, src/FileFinder.cpp,
6537 src/FileFinder.h, src/FilePath.cpp, src/FilePath.h, src/FileSystem.cpp,
6538 src/FileSystem.h, src/Font.cpp, src/Font.h, src/FontCache.cpp,
6539 src/FontCache.h, src/FontEncoding.cpp, src/FontEncoding.h,
6540 src/FontEngine.cpp, src/FontEngine.h, src/FontManager.cpp,
6541 src/FontManager.h, src/FontMap.cpp, src/FontMap.h, src/GFGlyphTracer.cpp,
6542 src/GFGlyphTracer.h, src/GFReader.cpp, src/GFReader.h, src/GFTracer.cpp,
6543 src/GFTracer.h, src/Ghostscript.cpp, src/Ghostscript.h, src/Glyph.h,
6544 src/GlyphTracerMessages.h, src/GraphicPath.h, src/InputBuffer.cpp,
6545 src/InputBuffer.h, src/InputReader.cpp, src/InputReader.h,
6546 src/Length.cpp, src/Length.h, src/Makefile.am, src/Matrix.cpp,
6547 src/Matrix.h, src/Message.cpp, src/Message.h, src/MessageException.h,
6548 src/MetafontWrapper.cpp, src/MetafontWrapper.h, src/PSInterpreter.cpp,
6549 src/PSInterpreter.h, src/PageRanges.cpp, src/PageRanges.h,
6550 src/PageSize.cpp, src/PageSize.h, src/Pair.h, src/Process.cpp,
6551 src/Process.h, src/PsSpecialHandler.cpp, src/PsSpecialHandler.h,
6552 src/SVGTree.cpp, src/SVGTree.h, src/SignalHandler.cpp,
6553 src/SignalHandler.h, src/SpecialActions.h, src/SpecialHandler.h,
6554 src/SpecialManager.cpp, src/SpecialManager.h, src/StreamReader.cpp,
6555 src/StreamReader.h, src/StreamWriter.cpp, src/StreamWriter.h,
6556 src/System.cpp, src/System.h, src/TFM.cpp, src/TFM.h, src/Terminal.cpp,
6557 src/Terminal.h, src/TpicSpecialHandler.cpp, src/TpicSpecialHandler.h,
6558 src/VFActions.h, src/VFReader.cpp, src/VFReader.h, src/VectorStream.h,
6559 src/XMLDocTypeNode.h, src/XMLDocument.cpp, src/XMLDocument.h,
6560 src/XMLNode.cpp, src/XMLNode.h, src/XMLString.cpp, src/XMLString.h,
6561 src/dvisvgm.cpp, src/macros.h, src/options.dtd, src/options.xml,
6562 src/psdefs.psc, src/types.h, tests/BoundingBoxTest.cpp,
6563 tests/CRC32Test.cpp, tests/CalculatorTest.cpp,
6564 tests/ColorSpecialTest.cpp, tests/CommandLineTest.cpp,
6565 tests/DirectoryTest.cpp, tests/FileFinderTest.cpp,
6566 tests/FilePathTest.cpp, tests/FileSystemTest.cpp,
6567 tests/FontManagerTest.cpp, tests/FontMapTest.cpp, tests/GFReaderTest.cpp,
6568 tests/GraphicPathTest.cpp, tests/LengthTest.cpp, tests/Makefile.am,
6569 tests/MatrixTest.cpp, tests/MessageExceptionTest.cpp,
6570 tests/PSInterpreterTest.cpp, tests/PageRagesTest.cpp,
6571 tests/PageSizeTest.cpp, tests/PairTest.cpp,
6572 tests/SplittedCharInputBufferTest.cpp, tests/StreamInputBufferTest.cpp,
6573 tests/StreamReaderTest.cpp, tests/StreamWriterTest.cpp,
6574 tests/TypesTest.cpp, tests/VectorStreamTest.cpp, tests/check-conv,
6575 tests/create-makefile:
6576 updated year in copyright statements
6577
6578 2011-12-18 Martin Gieseking <mgieseki@users.sourceforge.net>
6579
6580 * tests/Makefile.am, tests/create-makefile:
6581 link tests with -lpthread (required by gtest on Ubuntu)
6582
6583 * configure.ac, src/Doxyfile:
6584 set version to 1.0.10
6585
6586 * NEWS:
6587 updated NEWS
6588
6589 2011-12-17 Martin Gieseking <mgieseki@users.sourceforge.net>
6590
6591 * src/DVIToSVG.cpp, src/DVIToSVGActions.cpp, src/GlyphTracerMessages.h,
6592 src/Message.cpp, src/Message.h, src/MetafontWrapper.cpp,
6593 src/Terminal.cpp, src/Terminal.h, src/dvisvgm.cpp:
6594 allow users to customize the message colors
6595
6596 * doc/dvisvgm.txt.in:
6597 added documentation on environment variable DVISVGM_COLORS to manpage
6598
6599 2011-11-22 Martin Gieseking <mgieseki@users.sourceforge.net>
6600
6601 * src/GraphicPath.h:
6602 added some more comments to the methods of GraphicPath
6603
6604 2011-11-18 Martin Gieseking <mgieseki@users.sourceforge.net>
6605
6606 * configure.ac:
6607 move linker flag -lfreetype from LDFLAGS to LIBS to avoid linking
6608 problems
6609
6610 2011-10-28 Martin Gieseking <mgieseki@users.sourceforge.net>
6611
6612 * src/FontMap.cpp:
6613 removed unused variable eval_prefix in helper function read_entry()
6614
6615 * src/SVGTree.cpp:
6616 avoid possible collisions of glyph IDs
6617
6618 2011-10-13 Martin Gieseking <martin.gieseking@uos.de>
6619
6620 * configure.ac, src/Doxyfile:
6621 set version to 1.0.9
6622
6623 * NEWS:
6624 updated NEWS
6625
6626 2011-10-09 Martin Gieseking <mgieseki@users.sourceforge.net>
6627
6628 * src/FilePath.cpp:
6629 added some missing comments to methods of class FilePath
6630
6631 * src/Directory.h:
6632 dropped method Directory::getEntry()
6633
6634 2011-10-07 Martin Gieseking <mgieseki@users.sourceforge.net>
6635
6636 * src/Process.cpp:
6637 added missing include <signal.h> to Process.cpp
6638
6639 * src/Process.cpp:
6640 exclude definition of split_paramstr() from Windows builds as it's not
6641 used there
6642
6643 2011-10-03 Martin Gieseking <mgieseki@users.sourceforge.net>
6644
6645 * doc/Makefile.am:
6646 add metadata/pdfmarks to pdf version of manpage
6647
6648 2011-09-06 Martin Gieseking <mgieseki@users.sourceforge.net>
6649
6650 * potracelib/auxiliary.h, potracelib/bitmap.h, potracelib/curve.c,
6651 potracelib/curve.h, potracelib/decompose.c, potracelib/decompose.h,
6652 potracelib/lists.h, potracelib/potracelib.c, potracelib/potracelib.h,
6653 potracelib/progress.h, potracelib/trace.c, potracelib/trace.h:
6654 updated bundled potrace library to version 1.10
6655
6656 2011-06-04 Martin Gieseking <martin.gieseking@uos.de>
6657
6658 * configure.ac, src/Doxyfile:
6659 set version to 1.0.9dev
6660
6661 * src/FileFinder.cpp, src/MetafontWrapper.cpp:
6662 fixed segfault occured in TeX Live Win32 caused by mf.exe being
6663 unavailable (SF bug #3308473)
6664
6665 2011-06-01 Martin Gieseking <mgieseki@users.sourceforge.net>
6666
6667 * configure.ac:
6668 added AC_LANG_SOURCE to avoid autoconf warnings
6669
6670 2011-05-31 Martin Gieseking <martin.gieseking@uos.de>
6671
6672 * NEWS, configure.ac, src/Doxyfile:
6673 set version to 1.0.8; updated NEWS
6674
6675 * src/PsSpecialHandler.cpp:
6676 explicitly cast double to int in call of ClippingStack::dup()/pop()
6677
6678 2011-05-27 Martin Gieseking <mgieseki@users.sourceforge.net>
6679
6680 * tests/check-conv, tests/sample-nf-cmp.svg, tests/sample-wf-cmp.svg:
6681 updated conversion tests
6682
6683 2011-05-23 Martin Gieseking <martin.gieseking@uos.de>
6684
6685 * src/Font.cpp, src/Makefile.am, src/MetafontWrapper.cpp,
6686 src/MetafontWrapper.h, src/Process.cpp, src/Process.h,
6687 src/SignalHandler.cpp:
6688 replaced call of system() with Process::run() and kill child process if
6689 necessary
6690
6691 2011-05-22 Martin Gieseking <mgieseki@users.sourceforge.net>
6692
6693 * src/FileFinder.cpp:
6694 MiKTeX: maketfm and makemf have been renamed to miktex-maketfm and
6695 miktex-makemf
6696
6697 * src/MetafontWrapper.cpp:
6698 dropped '--halt-on-error' in Metafont call to process buggy mf files
6699 completely
6700
6701 2011-05-19 Martin Gieseking <mgieseki@users.sourceforge.net>
6702
6703 * src/DLLoader.h:
6704 added #undef NOMINMAX before (re)defining it
6705
6706 2011-05-12 Martin Gieseking <martin.gieseking@uos.de>
6707
6708 * src/PSInterpreter.cpp, src/PSInterpreter.h, src/PsSpecialHandler.cpp,
6709 src/PsSpecialHandler.h, src/psdefs.psc, tests/PSInterpreterTest.cpp:
6710 PS handler: implemented evaluation of save, restore, and grestoreall
6711
6712 2011-05-07 Martin Gieseking <martin.gieseking@uos.de>
6713
6714 * configure.ac, src/Doxyfile:
6715 set version to 1.0.8dev
6716
6717 * src/DVIReader.cpp, src/DVIReader.h, src/DVIToSVGActions.h,
6718 src/PsSpecialHandler.cpp, src/PsSpecialHandler.h, src/SpecialActions.h:
6719 fixed interaction between PS and DVI drawing position
6720
6721 * src/PsSpecialHandler.cpp:
6722 add definitions in literal PS headers to dictionary TeXDict
6723
6724 * src/PsSpecialHandler.cpp:
6725 fixed potential segfault caused by invisible zero-length paths
6726
6727 2011-05-06 Martin Gieseking <martin.gieseking@uos.de>
6728
6729 * src/DVIToSVGActions.h, src/PsSpecialHandler.cpp, src/PsSpecialHandler.h,
6730 src/psdefs.psc:
6731 PS handler: added missing unit conversions (pt vs. bp)
6732
6733 * NEWS, README, configure.ac, src/Doxyfile:
6734 set version to 1.0.7; updated NEWS and README
6735
6736 2011-05-05 Martin Gieseking <mgieseki@users.sourceforge.net>
6737
6738 * src/PSInterpreter.cpp, src/PsSpecialHandler.cpp:
6739 separate PS snippets by newline characters to leave preceding comments
6740
6741 * src/PsSpecialHandler.h:
6742 corrected scaling formula applied to PS line properties
6743
6744 * doc/dvisvgm.txt.in:
6745 added info about dvips rounding issues to manpage
6746
6747 2011-05-04 Martin Gieseking <mgieseki@users.sourceforge.net>
6748
6749 * src/PsSpecialHandler.cpp:
6750 don't call Ghostscript::revision() in initialization of static variable
6751
6752 * src/Ghostscript.cpp, src/Ghostscript.h, src/PSInterpreter.cpp,
6753 src/PSInterpreter.h:
6754 avoid 'this' pointer in initialazation list of
6755 PSInterpreter::PSInterpreter()
6756
6757 * src/Length.h:
6758 undefine macro IN
6759
6760 2011-05-03 Martin Gieseking <mgieseki@users.sourceforge.net>
6761
6762 * configure.ac, src/Doxyfile:
6763 set version to 1.0.7dev
6764
6765 * src/psdefs.psc:
6766 catch PS error /nocurrentpoint in operator 'setpos' properly
6767
6768 * src/psdefs.psc:
6769 PS handler: recognize save/restore operators
6770
6771 * src/DVIReader.cpp, src/DVIReader.h, src/DVIToSVGActions.cpp,
6772 src/DVIToSVGActions.h, src/EmSpecialHandler.cpp, src/EmSpecialHandler.h,
6773 src/PSInterpreter.h, src/PsSpecialHandler.cpp, src/PsSpecialHandler.h,
6774 src/SpecialActions.h, src/SpecialHandler.h, src/SpecialManager.cpp,
6775 src/SpecialManager.h, src/TpicSpecialHandler.cpp,
6776 src/TpicSpecialHandler.h:
6777 replaced methods for DVI position alterations with translation semantics
6778
6779 * src/PSInterpreter.cpp, src/PSInterpreter.h, src/PsSpecialHandler.cpp,
6780 src/PsSpecialHandler.h, src/macros.h, src/psdefs.psc,
6781 tests/PSInterpreterTest.cpp:
6782 improved handling of pure PostScript specials
6783
6784 * src/TpicSpecialHandler.cpp, src/TpicSpecialHandler.h:
6785 tpic special 'ip' must not draw the outline of the polygon but only fill
6786 its interior
6787
6788 * src/DLLoader.cpp, src/DLLoader.h:
6789 don't define min/max macros in windows.h
6790
6791 2011-04-30 Martin Gieseking <mgieseki@users.sourceforge.net>
6792
6793 * src/SpecialManager.cpp:
6794 register special prefix ps:: properly
6795
6796 2011-04-18 Martin Gieseking <mgieseki@users.sourceforge.net>
6797
6798 * src/FileFinder.cpp, src/FileFinder.h, src/dvisvgm.cpp,
6799 tests/FileFinderTest.cpp:
6800 dropped class FileFinder::Impl and simplified FileFinder interface
6801
6802 * src/DVIReader.cpp, src/Font.cpp, src/GFReader.cpp, src/Makefile.am,
6803 src/MetafontWrapper.cpp, src/PSInterpreter.cpp, src/SignalHandler.cpp,
6804 src/SignalHandler.h, src/TFM.cpp, src/dvisvgm.cpp:
6805 added class SignalHandler for CTRL-C signals
6806
6807 * NEWS, README, configure.ac, src/Doxyfile:
6808 set version to 1.0.6; updated NEWS and README
6809
6810 2011-04-14 Martin Gieseking <mgieseki@users.sourceforge.net>
6811
6812 * src/DVIToSVGActions.cpp, src/MessageException.h, src/dvisvgm.cpp,
6813 tests/Makefile.am, tests/MessageExceptionTest.cpp:
6814 derived MessageException from std::exception and replaced getMessage()
6815 with what()
6816
6817 2011-04-13 Martin Gieseking <mgieseki@users.sourceforge.net>
6818
6819 * src/XMLNode.cpp, src/XMLNode.h:
6820 prepended member variables of the XMLNode classes with underscore
6821
6822 2011-03-15 Martin Gieseking <mgieseki@users.sourceforge.net>
6823
6824 * src/DVIReader.cpp:
6825 throw DVI exception if set_char/put_char is executed without preceding
6826 font selection
6827
6828 2011-03-04 Martin Gieseking <mgieseki@users.sourceforge.net>
6829
6830 * configure.ac, src/Doxyfile:
6831 set version to 1.0.6dev
6832
6833 * potracelib/potracelib.c, potracelib/potracelib.h:
6834 changed return type of potrace_version() to 'const char *' in order to
6835 avoid compiler warning
6836
6837 2011-03-01 Martin Gieseking <mgieseki@users.sourceforge.net>
6838
6839 * NEWS, configure.ac, src/Doxyfile:
6840 set version to 1.0.5, updated NEWS
6841
6842 2011-02-28 Martin Gieseking <mgieseki@users.sourceforge.net>
6843
6844 * doc/dvisvgm.txt.in, src/FontCache.cpp, src/FontCache.h, src/dvisvgm.cpp:
6845 added code to remove outdated and corrupted cache files
6846
6847 * src/Ghostscript.cpp:
6848 fixed formatting of GS version number
6849
6850 2011-02-21 Martin Gieseking <mgieseki@users.sourceforge.net>
6851
6852 * configure.ac, src/Doxyfile:
6853 set version to 1.0.5dev
6854
6855 * doc/dvisvgm.txt.in, src/CommandLine.cpp, src/CommandLine.h,
6856 src/GraphicPath.h, src/SVGTree.cpp, src/SVGTree.h, src/dvisvgm.cpp,
6857 src/options.xml, tests/CommandLineTest.cpp:
6858 added option to replace use elements with paths
6859
6860 * src/SVGTree.cpp:
6861 added missing unit in height/width attribute of svg root element
6862
6863 * tests/frktest-nf-cmp.svg, tests/frktest-wf-cmp.svg,
6864 tests/sample-nf-cmp.svg, tests/sample-wf-cmp.svg:
6865 updated conversion test files
6866
6867 2011-02-16 Martin Gieseking <mgieseki@users.sourceforge.net>
6868
6869 * src/InputBuffer.h:
6870 reference to scanned string in StringInputBuffer is constant now
6871
6872 2011-02-10 Martin Gieseking <mgieseki@users.sourceforge.net>
6873
6874 * src/FileSystem.cpp, src/FileSystem.h, src/dvisvgm.cpp,
6875 tests/FileSystemTest.cpp:
6876 merged FileSystem::move() into FileSystem::copy()
6877
6878 * src/CRC32.cpp, src/CRC32.h, src/Makefile.am, tests/CRC32Test.cpp,
6879 tests/Makefile.am:
6880 added class CRC32 and corresponding tests
6881
6882 * src/StreamReader.cpp, src/StreamReader.h, src/StreamWriter.cpp,
6883 src/StreamWriter.h, tests/Makefile.am, tests/StreamReaderTest.cpp,
6884 tests/StreamWriterTest.cpp:
6885 added CRC32 computation methods to StreamReader and StreamWriter
6886
6887 * src/FontCache.cpp, src/FontCache.h:
6888 added CRC32 checks to cache files
6889
6890 2011-01-31 Martin Gieseking <mgieseki@users.sourceforge.net>
6891
6892 * src/CmdLineParserBase.cpp:
6893 print character instead of ascii value in message of command-line parser
6894
6895 2011-01-30 Martin Gieseking <mgieseki@users.sourceforge.net>
6896
6897 * doc/dvisvgm.txt.in, src/CommandLine.cpp, src/CommandLine.h,
6898 src/FileFinder.cpp, src/FileFinder.h, src/FontEngine.cpp,
6899 src/FontEngine.h, src/dvisvgm.cpp, src/options.xml:
6900 added optional argument to --version
6901
6902 2011-01-28 Martin Gieseking <mgieseki@users.sourceforge.net>
6903
6904 * potracelib/auxiliary.h, potracelib/bitmap.h, potracelib/curve.c,
6905 potracelib/curve.h, potracelib/decompose.c, potracelib/decompose.h,
6906 potracelib/lists.h, potracelib/potracelib.c, potracelib/potracelib.h,
6907 potracelib/progress.h, potracelib/trace.c, potracelib/trace.h:
6908 updated bundled potrace library to version 1.9
6909
6910 2011-01-17 Martin Gieseking <mgieseki@users.sourceforge.net>
6911
6912 * src/FileSystem.cpp, src/FileSystem.h, tests/FileSystemTest.cpp,
6913 tests/Makefile.am:
6914 added FileSystem::copy and FileSystem::move; added FileSystemTest
6915
6916 * doc/dvisvgm.txt.in, src/dvisvgm.cpp:
6917 moved cache files to subfolder ($HOME/.dvisvgm/cache)
6918
6919 2011-01-04 Martin Gieseking <mgieseki@users.sourceforge.net>
6920
6921 * Makefile.am, README, configure.ac, doc/Makefile.am, doc/dvisvgm.txt.in,
6922 src/BgColorSpecialHandler.cpp, src/BgColorSpecialHandler.h,
6923 src/Bitmap.cpp, src/Bitmap.h, src/BoundingBox.cpp, src/BoundingBox.h,
6924 src/Calculator.cpp, src/Calculator.h, src/CmdLineParserBase.cpp,
6925 src/CmdLineParserBase.h, src/Color.cpp, src/Color.h,
6926 src/ColorSpecialHandler.cpp, src/ColorSpecialHandler.h,
6927 src/CommandLine.cpp, src/CommandLine.h, src/DLLoader.cpp, src/DLLoader.h,
6928 src/DVIActions.cpp, src/DVIActions.h, src/DVIReader.cpp, src/DVIReader.h,
6929 src/DVIToSVG.cpp, src/DVIToSVG.h, src/DVIToSVGActions.cpp,
6930 src/DVIToSVGActions.h, src/Directory.cpp, src/Directory.h,
6931 src/DvisvgmSpecialHandler.cpp, src/DvisvgmSpecialHandler.h,
6932 src/EmSpecialHandler.cpp, src/EmSpecialHandler.h, src/FileFinder.cpp,
6933 src/FileFinder.h, src/FilePath.cpp, src/FilePath.h, src/FileSystem.cpp,
6934 src/FileSystem.h, src/Font.cpp, src/Font.h, src/FontCache.cpp,
6935 src/FontCache.h, src/FontEncoding.cpp, src/FontEncoding.h,
6936 src/FontEngine.cpp, src/FontEngine.h, src/FontManager.cpp,
6937 src/FontManager.h, src/FontMap.cpp, src/FontMap.h, src/GFGlyphTracer.cpp,
6938 src/GFGlyphTracer.h, src/GFReader.cpp, src/GFReader.h, src/GFTracer.cpp,
6939 src/GFTracer.h, src/Ghostscript.cpp, src/Ghostscript.h, src/Glyph.h,
6940 src/GlyphTracerMessages.h, src/GraphicPath.h, src/InputBuffer.cpp,
6941 src/InputBuffer.h, src/InputReader.cpp, src/InputReader.h,
6942 src/Length.cpp, src/Length.h, src/Makefile.am, src/Matrix.cpp,
6943 src/Matrix.h, src/Message.cpp, src/Message.h, src/MessageException.h,
6944 src/MetafontWrapper.cpp, src/MetafontWrapper.h, src/PSInterpreter.cpp,
6945 src/PSInterpreter.h, src/PageRanges.cpp, src/PageRanges.h,
6946 src/PageSize.cpp, src/PageSize.h, src/Pair.h, src/PsSpecialHandler.cpp,
6947 src/PsSpecialHandler.h, src/SVGTree.cpp, src/SVGTree.h,
6948 src/SpecialActions.h, src/SpecialHandler.h, src/SpecialManager.cpp,
6949 src/SpecialManager.h, src/StreamReader.cpp, src/StreamReader.h,
6950 src/StreamWriter.cpp, src/StreamWriter.h, src/System.cpp, src/System.h,
6951 src/TFM.cpp, src/TFM.h, src/Terminal.cpp, src/Terminal.h,
6952 src/TpicSpecialHandler.cpp, src/TpicSpecialHandler.h, src/VFActions.h,
6953 src/VFReader.cpp, src/VFReader.h, src/VectorStream.h,
6954 src/XMLDocTypeNode.h, src/XMLDocument.cpp, src/XMLDocument.h,
6955 src/XMLNode.cpp, src/XMLNode.h, src/XMLString.cpp, src/XMLString.h,
6956 src/dvisvgm.cpp, src/macros.h, src/options.dtd, src/options.xml,
6957 src/psdefs.psc, src/types.h, tests/BoundingBoxTest.cpp,
6958 tests/CalculatorTest.cpp, tests/ColorSpecialTest.cpp,
6959 tests/CommandLineTest.cpp, tests/DirectoryTest.cpp,
6960 tests/FileFinderTest.cpp, tests/FilePathTest.cpp,
6961 tests/FontManagerTest.cpp, tests/FontMapTest.cpp, tests/GFReaderTest.cpp,
6962 tests/GraphicPathTest.cpp, tests/LengthTest.cpp, tests/Makefile.am,
6963 tests/MatrixTest.cpp, tests/PageRagesTest.cpp, tests/PageSizeTest.cpp,
6964 tests/PairTest.cpp, tests/SplittedCharInputBufferTest.cpp,
6965 tests/StreamInputBufferTest.cpp, tests/TypesTest.cpp,
6966 tests/VectorStreamTest.cpp, tests/check-conv, tests/create-makefile:
6967 updated year in copyright info
6968
6969 * tests/Makefile.am, tests/PSInterpreterTest.cpp:
6970 added basic tests for class PSInterpreter
6971
6972 2010-12-18 Martin Gieseking <mgieseki@users.sourceforge.net>
6973
6974 * src/FileFinder.cpp:
6975 updated to MiKTeX 2.8 SDK
6976
6977 * src/PsSpecialHandler.cpp:
6978 fixed scaling issue in PS positioning
6979
6980 * src/PSInterpreter.cpp, src/PSInterpreter.h, src/PsSpecialHandler.cpp,
6981 src/PsSpecialHandler.h, src/psdefs.psc:
6982 PS handler: added missing scaling of linewidths and dash distances
6983
6984 * NEWS, configure.ac, src/Doxyfile:
6985 set version to 1.0.4; updated NEWS
6986
6987 * doc/dvisvgm.txt.in:
6988 minor update to the manpage
6989
6990 2010-08-18 Martin Gieseking <mgieseki@users.sourceforge.net>
6991
6992 * src/FontEngine.cpp:
6993 fixed FreeType version check (patch by Paul Vojta)
6994
6995 2010-08-11 Martin Gieseking <mgieseki@users.sourceforge.net>
6996
6997 * tests/Makefile.am, tests/PairTest.cpp:
6998 added PairTest
6999
7000 2010-08-06 Martin Gieseking <mgieseki@users.sourceforge.net>
7001
7002 * configure.ac, src/Doxyfile:
7003 set version to 1.0.3
7004
7005 2010-08-05 Martin Gieseking <mgieseki@users.sourceforge.net>
7006
7007 * NEWS, doc/dvisvgm.txt.in:
7008 updated manpage and NEWS
7009
7010 2010-08-04 Martin Gieseking <mgieseki@users.sourceforge.net>
7011
7012 * src/BoundingBox.cpp, src/BoundingBox.h, src/Matrix.cpp, src/Matrix.h,
7013 src/PsSpecialHandler.cpp:
7014 revamped PsSpecialHandler::psfile() to fix a transformation issue (SF
7015 bug #3037372)
7016
7017 2010-07-28 Martin Gieseking <mgieseki@users.sourceforge.net>
7018
7019 * src/DVIReader.cpp, src/DVIReader.h, src/DVIToSVG.cpp:
7020 added check of DVI format version
7021
7022 2010-07-26 Martin Gieseking <mgieseki@users.sourceforge.net>
7023
7024 * src/PsSpecialHandler.cpp, src/PsSpecialHandler.h:
7025 restore transformation matrix after execution of psfile
7026
7027 2010-07-13 Martin Gieseking <mgieseki@users.sourceforge.net>
7028
7029 * configure.ac, src/Doxyfile:
7030 set version to 1.0.3dev
7031
7032 * src/InputBuffer.h:
7033 added missing namespace prefix
7034
7035 * src/Terminal.cpp:
7036 replaced \e with \x1B
7037
7038 * src/GraphicPath.h, src/PsSpecialHandler.h:
7039 fixed missing initialization of GraphicPath iterator
7040
7041 * src/Directory.cpp, src/Directory.h, src/GFReader.cpp, src/GFReader.h:
7042 added leading underscore to variables of GFReader
7043
7044 2010-06-22 Martin Gieseking <mgieseki@users.sourceforge.net>
7045
7046 * src/gzstream.cpp, src/gzstream.h:
7047 fixed class variable issue introduced by previous AIX patch
7048
7049 * NEWS, configure.ac, src/Doxyfile:
7050 set version to 1.0.2
7051
7052 2010-06-18 Martin Gieseking <mgieseki@users.sourceforge.net>
7053
7054 * src/Bitmap.cpp, tests/DirectoryTest.cpp, tests/GFReaderTest.cpp,
7055 tests/Makefile.am, tests/cmr10.600gf, tests/create-makefile:
7056 added GFReaderTest; updated DirectoryTest
7057
7058 2010-06-17 Martin Gieseking <mgieseki@users.sourceforge.net>
7059
7060 * src/Bitmap.cpp, src/Calculator.cpp, src/CmdLineParserBase.cpp,
7061 src/Color.cpp, src/ColorSpecialHandler.cpp, src/DVIReader.cpp,
7062 src/DVIReader.h, src/DVIToSVGActions.cpp, src/DvisvgmSpecialHandler.cpp,
7063 src/EmSpecialHandler.cpp, src/FontCache.cpp, src/FontEncoding.cpp,
7064 src/GFGlyphTracer.cpp, src/Pair.h, src/PsSpecialHandler.cpp,
7065 src/PsSpecialHandler.h, src/TFM.cpp, src/TFM.h:
7066 fixed some type conversion warnings
7067
7068 * src/Message.cpp, src/Message.h:
7069 renamed MessageStream::putchar() to MessageStream::putChar() to avoid
7070 name clashes
7071
7072 * src/types.h, tests/Makefile.am, tests/TypesTest.cpp:
7073 added TypesTest
7074
7075 2010-06-16 Martin Gieseking <mgieseki@users.sourceforge.net>
7076
7077 * potracelib/curve.c, potracelib/curve.h, potracelib/decompose.c:
7078 renamed internal potrace functions path_new() and path_free() to prevent
7079 linker conflicts on OS X
7080
7081 2010-06-14 Martin Gieseking <mgieseki@users.sourceforge.net>
7082
7083 * configure.ac, src/Doxyfile:
7084 set version to 1.0.2dev
7085
7086 * configure.ac, src/CmdLineParserBase.h, src/FileFinder.h,
7087 src/FontCache.cpp, src/FontCache.h, src/FontEncoding.cpp,
7088 src/FontEngine.cpp, src/GFGlyphTracer.h, src/MetafontWrapper.cpp,
7089 src/gzstream.cpp:
7090 applied latest TL patches from Peter Breitenlohner and Karl Berry
7091
7092 2010-06-11 Martin Gieseking <mgieseki@users.sourceforge.net>
7093
7094 * src/Message.cpp:
7095 suppress ANSI color code by default
7096
7097 * NEWS, configure.ac, src/Doxyfile:
7098 set version to 1.0.1
7099
7100 2010-06-09 Martin Gieseking <mgieseki@users.sourceforge.net>
7101
7102 * configure.ac, src/Doxyfile:
7103 set version to 1.0.1dev
7104
7105 * src/psdefs.psc:
7106 fixed recursion issue in PS operator charpath
7107
7108 2010-06-08 Martin Gieseking <mgieseki@users.sourceforge.net>
7109
7110 * configure.ac, doc/Makefile.am, src/Makefile.am:
7111 cleaned up configuration scripts
7112
7113 * configure.ac, src/Doxyfile:
7114 set version to 1.0dev
7115
7116 * doc/dvisvgm.txt.in, src/BoundingBox.cpp, src/DVIToSVGActions.cpp,
7117 src/DVIToSVGActions.h, src/DvisvgmSpecialHandler.cpp,
7118 src/EmSpecialHandler.cpp, src/PsSpecialHandler.cpp, src/SpecialActions.h,
7119 src/SpecialManager.cpp, src/TpicSpecialHandler.cpp:
7120 added special for creating local bounding boxes
7121
7122 * src/FilePath.cpp, src/FilePath.h, src/FileSystem.cpp, src/FileSystem.h,
7123 src/Makefile.am, tests/FilePathTest.cpp, tests/Makefile.am:
7124 added class FilePath
7125
7126 * src/InputBuffer.h, tests/ColorSpecialTest.cpp,
7127 tests/StreamInputBufferTest.cpp:
7128 added InputBuffer::invalidate()
7129
7130 * doc/dvisvgm.txt.in, src/CommandLine.cpp, src/CommandLine.h,
7131 src/DVIReader.cpp, src/DVIReader.h, src/DVIToSVG.cpp, src/DVIToSVG.h,
7132 src/DVIToSVGActions.cpp, src/DVIToSVGActions.h, src/Makefile.am,
7133 src/PageRanges.cpp, src/PageRanges.h, src/StreamCounter.h,
7134 src/dvisvgm.cpp, src/options.xml, tests/BoundingBoxTest.cpp,
7135 tests/CommandLineTest.cpp, tests/Makefile.am, tests/PageRagesTest.cpp,
7136 tests/StreamCounterTest.cpp:
7137 added conversion of multiple pages
7138
7139 * configure.ac, doc/Makefile.am, doc/dvisvgm.txt.in, src/CommandLine.cpp,
7140 src/CommandLine.h, src/DVIActions.h, src/DVIToSVG.cpp, src/GFTracer.cpp,
7141 src/GlyphTracerMessages.h, src/Makefile.am, src/Message.cpp,
7142 src/Message.h, src/MetafontWrapper.cpp, src/Terminal.cpp, src/Terminal.h,
7143 src/dvisvgm.cpp, src/options.xml:
7144 improved output of messages including optional colorization
7145
7146 * src/Font.cpp:
7147 print error message if Metafont failed
7148
7149 * src/PSInterpreter.cpp, src/PSInterpreter.h, src/PsSpecialHandler.cpp,
7150 src/PsSpecialHandler.h, src/psdefs.psc:
7151 evaluate Ghostscript operator .setopacityalpha
7152
7153 * src/DVIActions.h, src/DVIReader.cpp, src/DVIReader.h:
7154 added method to compute length of DVI command
7155
7156 * doc/dvisvgm.txt.in, src/CommandLine.cpp, src/CommandLine.h,
7157 src/DVIActions.h, src/DVIToSVGActions.cpp, src/DVIToSVGActions.h,
7158 src/Makefile.am, src/Message.cpp, src/Message.h, src/PSInterpreter.cpp,
7159 src/PSInterpreter.h, src/PsSpecialHandler.cpp, src/PsSpecialHandler.h,
7160 src/SpecialActions.h, src/System.cpp, src/System.h, src/dvisvgm.cpp,
7161 src/options.xml:
7162 added percentage-based progress indicator
7163
7164 * doc/Makefile.am, doc/dvisvgm.txt.in:
7165 documented option --help and --version in manpage
7166
7167 * NEWS, configure.ac, src/Doxyfile:
7168 set version to 1.0
7169
7170 * src/PSInterpreter.cpp, src/PSInterpreter.h, src/PsSpecialHandler.cpp,
7171 src/PsSpecialHandler.h:
7172 fixed PS destructor issue (SF bug #3013392)
7173
7174 2010-05-09 Martin Gieseking <mgieseki@users.sourceforge.net>
7175
7176 * configure.ac:
7177 fixed whitespace issue in CPPFLAGS and LDFLAGS
7178
7179 2010-05-04 Martin Gieseking <mgieseki@users.sourceforge.net>
7180
7181 * configure.ac:
7182 fixed kpathsea check; use pkg-config to check freetype availability
7183
7184 * tests/FileFinderTest.cpp, tests/FontManagerTest.cpp, tests/check-conv:
7185 fixed segfaults in tests
7186
7187 2010-04-23 Martin Gieseking <mgieseki@users.sourceforge.net>
7188
7189 * NEWS, configure.ac, src/Doxyfile:
7190 set version to 0.9.1
7191
7192 2010-04-22 Martin Gieseking <mgieseki@users.sourceforge.net>
7193
7194 * src/CommandLine.cpp, src/options.xml:
7195 output of option --help: replaced '(default: FOO)' by '[FOO]'
7196
7197 * src/DVIToSVG.cpp, src/DVIToSVGActions.cpp, src/DVIToSVGActions.h,
7198 src/SVGTree.cpp, src/SVGTree.h, src/XMLNode.cpp, src/XMLNode.h:
7199 ignore unused fonts in CSS styles list
7200
7201 * src/SVGTree.cpp:
7202 fixed broken validity when using SVG fonts
7203
7204 * src/DVIActions.h, src/DVIReader.cpp, src/DVIReader.h, src/DVIToSVG.cpp,
7205 src/DVIToSVG.h, src/DVIToSVGActions.cpp, src/DVIToSVGActions.h:
7206 print page count and page number of DVI page being processed
7207
7208 * tests/check-conv, tests/frktest-wf-cmp.svg, tests/sample-wf-cmp.svg:
7209 adapted conversion tests to new output format
7210
7211 2010-04-20 Martin Gieseking <mgieseki@users.sourceforge.net>
7212
7213 * src/FontEncoding.cpp:
7214 fixed memory bug in FontEncoding::encoding()
7215
7216 2010-04-11 Martin Gieseking <mgieseki@users.sourceforge.net>
7217
7218 * configure.ac, src/Doxyfile:
7219 set version to 0.9.1dev
7220
7221 * src/DVIToSVGActions.cpp:
7222 replaced wrong font pointer that could lead to segfaults
7223
7224 2010-03-24 Martin Gieseking <mgieseki@users.sourceforge.net>
7225
7226 * src/Font.cpp, src/Font.h, src/dvisvgm.cpp:
7227 moved some methods from PhysicalFontImpl to PysicalFont
7228
7229 * doc/dvisvgm.txt.in, src/BoundingBox.cpp, src/BoundingBox.h,
7230 src/CommandLine.cpp, src/CommandLine.h, src/DVIToSVG.cpp,
7231 src/DVIToSVGActions.cpp, src/DVIToSVGActions.h, src/Font.cpp, src/Font.h,
7232 src/GlyphTracerMessages.h, src/Makefile.am, src/dvisvgm.cpp,
7233 src/options.xml:
7234 added command-line option --exact
7235
7236 * src/FontCache.cpp, src/Makefile.am, src/StreamWriter.cpp,
7237 src/StreamWriter.h, src/TFM.cpp:
7238 replaced local stream IO functions by StreamReader/StreamWriter methods
7239
7240 * src/CmdLineParserBase.cpp, src/DVIToSVG.cpp, src/DVIToSVGActions.cpp,
7241 src/FontEngine.cpp, src/GlyphTracerMessages.h, src/Message.cpp,
7242 src/Message.h, src/MetafontWrapper.cpp, src/dvisvgm.cpp:
7243 added class MessageStream, updated message output
7244
7245 * src/FontCache.cpp, src/GFGlyphTracer.cpp, src/GFReader.cpp:
7246 variable _fontname is now correctly set in class FontCache
7247
7248 * NEWS, configure.ac, src/Doxyfile:
7249 set version to 0.9
7250
7251 * tests/frktest-nf-cmp.svg, tests/frktest-wf-cmp.svg,
7252 tests/sample-nf-cmp.svg, tests/sample-wf-cmp.svg:
7253 updated conversion tests
7254
7255 2010-03-18 Martin Gieseking <mgieseki@users.sourceforge.net>
7256
7257 * src/DVIToSVG.cpp, src/SVGTree.cpp:
7258 moved creation of SVG 'use' elements from class DVIToSVG to class
7259 SVGTree
7260
7261 * src/DVIToSVG.cpp, src/Font.cpp, src/Font.h, src/GFGlyphTracer.cpp,
7262 src/GFGlyphTracer.h, src/SVGTree.cpp, src/SVGTree.h:
7263 added class GFGlyphTracer::Callback providing an interface used to print
7264 status information about the tracer
7265
7266 * src/CmdLineParserBase.cpp, src/CmdLineParserBase.h:
7267 added evaluation of boolean and char arguments to the command-line
7268 parser
7269
7270 * doc/dvisvgm.txt.in, src/CommandLine.cpp, src/CommandLine.h,
7271 src/DVIToSVG.cpp, src/DVIToSVG.h, src/Font.cpp, src/Font.h,
7272 src/dvisvgm.cpp, src/options.xml, tests/CommandLineTest.cpp:
7273 reactivated option --trace-all, and added optional argument 'retrace' to
7274 it
7275
7276 * doc/dvisvgm.txt.in, src/CommandLine.cpp, src/CommandLine.h,
7277 src/Font.cpp, src/Font.h, src/dvisvgm.cpp, src/options.xml:
7278 added command-line option --keep
7279
7280 2010-03-17 Martin Gieseking <mgieseki@users.sourceforge.net>
7281
7282 * src/GFReader.cpp, src/GFReader.h:
7283 replaced GFReader messages by exceptions
7284
7285 * src/CharmapTranslator.cpp, src/CharmapTranslator.h, src/DVIToSVG.cpp,
7286 src/DVIToSVGActions.cpp, src/DVIToSVGActions.h, src/Font.cpp, src/Font.h,
7287 src/Makefile.am, src/SVGFontEmitter.cpp, src/SVGFontEmitter.h,
7288 src/SVGFontTraceEmitter.cpp, src/SVGFontTraceEmitter.h, src/SVGTree.cpp,
7289 src/SVGTree.h:
7290 removed class CharmapTranslator
7291
7292 * src/DVIReader.cpp, src/DVIReader.h, src/DVIToSVG.cpp,
7293 src/DVIToSVGActions.cpp, src/FontManager.cpp, src/FontManager.h,
7294 src/SVGFontEmitter.cpp, src/SVGFontEmitter.h,
7295 src/SVGFontTraceEmitter.cpp, src/SVGFontTraceEmitter.h, src/SVGTree.cpp,
7296 src/SVGTree.h, src/VFReader.h, tests/FontManagerTest.cpp:
7297 made FontManager a singleton
7298
7299 * src/FontCache.cpp, src/FontCache.h:
7300 added method FontCache::write(const char *dir) that updates the cache
7301 file of the current font
7302
7303 * src/DVIToSVG.cpp, src/DVIToSVG.h, src/DVIToSVGActions.cpp, src/Font.cpp,
7304 src/Font.h, src/FontEmitter.h, src/GFGlyphTracer.h, src/Makefile.am,
7305 src/SVGFontEmitter.cpp, src/SVGFontEmitter.h,
7306 src/SVGFontTraceEmitter.cpp, src/SVGFontTraceEmitter.h, src/SVGTree.cpp,
7307 src/SVGTree.h, src/dvisvgm.cpp, tests/Makefile.am, tests/check-conv,
7308 tests/create-makefile:
7309 removed emitter classes; incorporated their functionality into SVGTree
7310 and PhysicalFontImpl
7311
7312 * src/BoundingBox.cpp, src/Calculator.cpp, src/Matrix.cpp,
7313 src/PSInterpreter.cpp, src/PSInterpreter.h:
7314 fixed a couple of comments
7315
7316 2010-02-26 Martin Gieseking <mgieseki@users.sourceforge.net>
7317
7318 * src/Font.cpp, src/FontCache.cpp, src/FontCache.h, src/GFGlyphTracer.cpp,
7319 src/GFGlyphTracer.h, src/GFReader.cpp, src/GFReader.h, src/GFTracer.h,
7320 src/SVGFontTraceEmitter.cpp, src/SVGFontTraceEmitter.h:
7321 refactorings of GF tracer class; removed transferGlyph()
7322
7323 2010-02-21 Martin Gieseking <mgieseki@users.sourceforge.net>
7324
7325 * src/Font.h, src/FontEncoding.cpp, src/FontEncoding.h,
7326 src/FontManager.cpp, src/FontManager.h, src/SVGFontEmitter.cpp:
7327 moved method encoding() from class FontManager to class FontEncoding
7328
7329 * src/CharmapTranslator.cpp, src/CharmapTranslator.h, src/Font.cpp,
7330 src/Font.h, src/FontCache.cpp, src/FontCache.h, src/FontEngine.cpp,
7331 src/FontEngine.h, src/Glyph.cpp, src/Glyph.h, src/Makefile.am,
7332 src/SVGFontEmitter.cpp, src/SVGFontEmitter.h:
7333 removed class Glyph and incorporated its functionality into Font class
7334
7335 2010-02-05 Martin Gieseking <mgieseki@users.sourceforge.net>
7336
7337 * configure.ac, src/Doxyfile:
7338 set version to 0.8.9dev
7339
7340 * src/psdefs.psc:
7341 removed PS error handler nocurrentpoint
7342
7343 * src/DVIToSVG.cpp:
7344 added evaluation of literal PS headers to PSHeaderActions
7345
7346 2010-02-02 Martin Gieseking <mgieseki@users.sourceforge.net>
7347
7348 * NEWS, configure.ac, src/Doxyfile:
7349 version updated to 0.8.8
7350
7351 2010-02-01 Martin Gieseking <mgieseki@users.sourceforge.net>
7352
7353 * tests/check-conv:
7354 skip conversion checks by default
7355
7356 2010-01-31 Martin Gieseking <mgieseki@users.sourceforge.net>
7357
7358 * tests/Makefile.am, tests/check-conv, tests/create-makefile,
7359 tests/frktest-nf-cmp.svg, tests/frktest-wf-cmp.svg, tests/frktest.dvi,
7360 tests/normalize.xsl, tests/sample-nf-cmp.svg, tests/sample-wf-cmp.svg,
7361 tests/sample.dvi:
7362 added tests to check conversion results
7363
7364 * tests/normalize.xsl:
7365 some improvements to normalize.xsl
7366
7367 2010-01-29 Martin Gieseking <mgieseki@users.sourceforge.net>
7368
7369 * src/CmdLineParserBase.cpp, src/CmdLineParserBase.h, src/CommandLine.cpp,
7370 src/CommandLine.h:
7371 removed CmdLineParserBase::numOptions()
7372
7373 * src/GraphicPath.h:
7374 fixed scaling bug in computation of glyph paths when using -n
7375
7376 2010-01-24 Martin Gieseking <mgieseki@users.sourceforge.net>
7377
7378 * doc/dvisvgm.txt.in, src/CommandLine.cpp, src/CommandLine.h,
7379 src/FontCache.h, src/dvisvgm.cpp, src/options.dtd, src/options.xml:
7380 added command-line option --libgs
7381
7382 2010-01-18 Martin Gieseking <mgieseki@users.sourceforge.net>
7383
7384 * src/CommandLine.cpp, src/options.dtd, src/options.xml:
7385 added DTD for options.xml
7386
7387 2010-01-17 Martin Gieseking <mgieseki@users.sourceforge.net>
7388
7389 * configure.ac:
7390 updated type of kpathsea_version_string (patch by lomov_vl)
7391
7392 * fedora/dvisvgm-gs.patch, fedora/dvisvgm-potrace.patch,
7393 fedora/dvisvgm.spec:
7394 removed fedora directory
7395
7396 * doc/dvisvgm.txt.in, src/BoundingBox.cpp, src/BoundingBox.h,
7397 src/DVIToSVG.cpp, tests/BoundingBoxTest.cpp, tests/Makefile.am:
7398 added support for enlarging the minimal bbox by a given amount.
7399
7400 * Makefile.am, README, configure.ac, doc/dvisvgm.txt.in,
7401 src/BgColorSpecialHandler.cpp, src/BgColorSpecialHandler.h,
7402 src/Bitmap.cpp, src/Bitmap.h, src/BoundingBox.cpp, src/BoundingBox.h,
7403 src/Calculator.cpp, src/Calculator.h, src/CharmapTranslator.cpp,
7404 src/CharmapTranslator.h, src/CmdLineParserBase.cpp,
7405 src/CmdLineParserBase.h, src/Color.cpp, src/Color.h,
7406 src/ColorSpecialHandler.cpp, src/ColorSpecialHandler.h,
7407 src/CommandLine.cpp, src/CommandLine.h, src/DLLoader.cpp, src/DLLoader.h,
7408 src/DVIActions.cpp, src/DVIActions.h, src/DVIReader.cpp, src/DVIReader.h,
7409 src/DVIToSVG.cpp, src/DVIToSVG.h, src/DVIToSVGActions.cpp,
7410 src/DVIToSVGActions.h, src/Directory.cpp, src/Directory.h,
7411 src/DvisvgmSpecialHandler.cpp, src/DvisvgmSpecialHandler.h,
7412 src/EmSpecialHandler.cpp, src/EmSpecialHandler.h, src/FileFinder.cpp,
7413 src/FileFinder.h, src/FileSystem.cpp, src/FileSystem.h, src/Font.cpp,
7414 src/Font.h, src/FontCache.cpp, src/FontCache.h, src/FontEmitter.h,
7415 src/FontEncoding.cpp, src/FontEncoding.h, src/FontEngine.cpp,
7416 src/FontEngine.h, src/FontManager.cpp, src/FontManager.h,
7417 src/FontMap.cpp, src/FontMap.h, src/GFGlyphTracer.cpp,
7418 src/GFGlyphTracer.h, src/GFReader.cpp, src/GFReader.h, src/GFTracer.cpp,
7419 src/GFTracer.h, src/Ghostscript.cpp, src/Ghostscript.h, src/Glyph.cpp,
7420 src/Glyph.h, src/GraphicPath.h, src/InputBuffer.cpp, src/InputBuffer.h,
7421 src/InputReader.cpp, src/InputReader.h, src/Length.cpp, src/Length.h,
7422 src/Makefile.am, src/Matrix.cpp, src/Matrix.h, src/Message.cpp,
7423 src/Message.h, src/MessageException.h, src/MetafontWrapper.cpp,
7424 src/MetafontWrapper.h, src/PSInterpreter.cpp, src/PSInterpreter.h,
7425 src/PageSize.cpp, src/PageSize.h, src/Pair.h, src/PsSpecialHandler.cpp,
7426 src/PsSpecialHandler.h, src/SVGFontEmitter.cpp, src/SVGFontEmitter.h,
7427 src/SVGFontTraceEmitter.cpp, src/SVGFontTraceEmitter.h, src/SVGTree.cpp,
7428 src/SVGTree.h, src/SpecialActions.h, src/SpecialHandler.h,
7429 src/SpecialManager.cpp, src/SpecialManager.h, src/StreamCounter.h,
7430 src/StreamReader.cpp, src/StreamReader.h, src/TFM.cpp, src/TFM.h,
7431 src/TpicSpecialHandler.cpp, src/TpicSpecialHandler.h, src/VFActions.h,
7432 src/VFReader.cpp, src/VFReader.h, src/VectorStream.h,
7433 src/XMLDocTypeNode.h, src/XMLDocument.cpp, src/XMLDocument.h,
7434 src/XMLNode.cpp, src/XMLNode.h, src/XMLString.cpp, src/XMLString.h,
7435 src/dvisvgm.cpp, src/macros.h, src/options.xml, src/psdefs.psc,
7436 src/types.h, tests/BoundingBoxTest.cpp, tests/CalculatorTest.cpp,
7437 tests/ColorSpecialTest.cpp, tests/CommandLineTest.cpp,
7438 tests/DirectoryTest.cpp, tests/FileFinderTest.cpp,
7439 tests/FontManagerTest.cpp, tests/FontMapTest.cpp,
7440 tests/GraphicPathTest.cpp, tests/LengthTest.cpp, tests/Makefile.am,
7441 tests/MatrixTest.cpp, tests/PageSizeTest.cpp,
7442 tests/SplittedCharInputBufferTest.cpp, tests/StreamCounterTest.cpp,
7443 tests/StreamInputBufferTest.cpp, tests/VectorStreamTest.cpp,
7444 tests/create-makefile:
7445 updated boilerplates
7446
7447 * doc/dvisvgm.txt.in, src/FileFinder.cpp, src/Ghostscript.cpp,
7448 src/Ghostscript.h, src/dvisvgm.cpp:
7449 environment variable LIBGS can now be used to set the name of the GS
7450 shared library
7451
7452 * NEWS:
7453 updated NEWS
7454
7455 * src/Ghostscript.cpp:
7456 fixed typo in variable name
7457
7458 2009-12-16 Martin Gieseking <mgieseki@users.sourceforge.net>
7459
7460 * src/InputReader.cpp:
7461 fixed bug in InputReader::parseUInt()
7462
7463 2009-12-15 Martin Gieseking <mgieseki@users.sourceforge.net>
7464
7465 * configure.ac, src/dvisvgm.cpp:
7466 appied get_time patch sent by Peter Breitenlohner
7467
7468 2009-12-02 Martin Gieseking <mgieseki@users.sourceforge.net>
7469
7470 * src/BoundingBox.h, src/Calculator.h, src/CharmapTranslator.h,
7471 src/DVIReader.h, src/DVIToSVG.h, src/DVIToSVGActions.h, src/Font.h,
7472 src/FontEngine.h, src/FontManager.h, src/FontMap.h, src/GFGlyphTracer.h,
7473 src/GFReader.h, src/MessageException.h, src/MetafontWrapper.h,
7474 src/PageSize.h, src/SVGTree.cpp, src/SVGTree.h, src/StreamReader.h,
7475 src/VFActions.h, src/VFReader.h, src/XMLDocTypeNode.h, src/XMLDocument.h,
7476 src/XMLNode.h, src/XMLString.h:
7477 removed using statements from header files
7478
7479 2009-11-25 Martin Gieseking <mgieseki@users.sourceforge.net>
7480
7481 * src/FontCache.cpp, src/FontCache.h, src/FontEngine.cpp,
7482 src/FontEngine.h, src/FontGlyph.cpp, src/FontGlyph.h,
7483 src/GFGlyphTracer.cpp, src/GFGlyphTracer.h, src/GFTracer.cpp,
7484 src/Glyph.cpp, src/Glyph.h, src/GraphicPath.h, src/Makefile.am,
7485 src/Pair.h, src/SVGFontEmitter.cpp, src/SVGFontTraceEmitter.cpp,
7486 tests/GraphicPathTest.cpp:
7487 removed FEGlyphCommands and replaced separate glyph class implementation
7488 by class GraphicPath
7489
7490 2009-11-18 Martin Gieseking <mgieseki@users.sourceforge.net>
7491
7492 * src/DVIToSVG.cpp, src/Ghostscript.cpp, src/Ghostscript.h:
7493 replaced #if !DISABLE_GS by #if !defined(DISABLE_GS) (Peter
7494 Breitenlohner)
7495
7496 * src/Ghostscript.cpp, src/Ghostscript.h:
7497 replaced #if HAVE_LIBGS by #if defined(HAVE_LIBGS)
7498
7499 * src/DLLoader.cpp, src/DLLoader.h:
7500 fixed line endings
7501
7502 2009-11-17 Martin Gieseking <mgieseki@users.sourceforge.net>
7503
7504 * configure.ac, fedora/dvisvgm.spec, src/Doxyfile:
7505 set version number to 0.8.8dev
7506
7507 * potracelib/potracelib.c, potracelib/potracelib.h:
7508 replaced outdated string constant type char* by const char* in
7509 potrace_version()
7510
7511 * src/Color.cpp, src/ColorSpecialHandler.cpp, src/FontManager.cpp,
7512 src/PsSpecialHandler.cpp, src/PsSpecialHandler.h,
7513 src/TpicSpecialHandler.cpp:
7514 added explicit casts to avoid compiler warnings (Peter Breitenlohner)
7515
7516 * src/InputReader.cpp:
7517 added missing initialization value (Peter Breitenlohner)
7518
7519 * src/CmdLineParserBase.h, src/GraphicPath.h, src/InputReader.h,
7520 src/Makefile.am, src/PSInterpreter.h, src/SpecialManager.h:
7521 added missing virtual destructors to avoid warnings
7522
7523 * src/dvisvgm.cpp:
7524 don't use email adress PACKAGE_BUGREPORT for copyright notice
7525
7526 * NEWS:
7527 updated NEWS
7528
7529 2009-11-09 Martin Gieseking <mgieseki@users.sourceforge.net>
7530
7531 * src/DVIToSVG.cpp, src/dvisvgm.cpp:
7532 added total number of pages to message text
7533
7534 * NEWS, src/Color.cpp, src/Color.h, src/PsSpecialHandler.cpp,
7535 src/PsSpecialHandler.h, src/SVGTree.cpp:
7536 PS handler: colors set by color specials are now considered properly
7537
7538 * configure.ac, fedora/dvisvgm.spec, src/Doxyfile:
7539 set version to 0.8.7
7540
7541 2009-11-06 Martin Gieseking <mgieseki@users.sourceforge.net>
7542
7543 * src/GraphicPath.h, src/PsSpecialHandler.cpp:
7544 PS handler: replace zero-length paths by dots
7545
7546 * NEWS, doc/dvisvgm.txt.in:
7547 updated NEWS and manpage
7548
7549 * NEWS, src/PsSpecialHandler.cpp:
7550 fixed path scaling issue in PS handler
7551
7552 2009-10-29 Martin Gieseking <mgieseki@users.sourceforge.net>
7553
7554 * src/DVIToSVGActions.cpp, src/Font.cpp, src/Font.h:
7555 fixed positioning of italic characters
7556
7557 2009-10-25 Martin Gieseking <mgieseki@users.sourceforge.net>
7558
7559 * src/DvisvgmSpecialHandler.cpp:
7560 added macro {?nl} to dvisvgm:raw evaluator
7561
7562 2009-10-18 Martin Gieseking <mgieseki@users.sourceforge.net>
7563
7564 * src/Font.cpp, src/TFM.cpp, src/TFM.h:
7565 added italic correction values to character widths
7566
7567 2009-10-16 Martin Gieseking <mgieseki@users.sourceforge.net>
7568
7569 * tests/Makefile.am, tests/create-makefile:
7570 added script to create tests/Makefile.am
7571
7572 * configure.ac, src/Doxyfile:
7573 increased version to 0.8.7dev
7574
7575 2009-10-13 Martin Gieseking <mgieseki@users.sourceforge.net>
7576
7577 * doc/Makefile.am, doc/dvisvgm.txt.in:
7578 removed outdated post-processing of manpage
7579
7580 * fedora/dvisvgm.spec:
7581 updated spec file
7582
7583 * doc/Makefile.am:
7584 added missing dvi suffix in Makefile target dvi-pdf
7585
7586 * README, tests/CalculatorTest.cpp, tests/CalculatorTest.h,
7587 tests/ColorSpecialTest.cpp, tests/ColorSpecialTest.h,
7588 tests/CommandLineTest.cpp, tests/CommandLineTest.h,
7589 tests/DirectoryTest.cpp, tests/DirectoryTest.h, tests/FileFinderTest.cpp,
7590 tests/FileFinderTest.h, tests/FontManagerTest.cpp,
7591 tests/FontManagerTest.h, tests/FontMapTest.cpp, tests/FontMapTest.h,
7592 tests/GraphicPathTest.cpp, tests/GraphicPathTest.h, tests/LengthTest.cpp,
7593 tests/LengthTest.h, tests/Makefile.am, tests/MatrixTest.cpp,
7594 tests/MatrixTest.h, tests/PageSizeTest.cpp, tests/PageSizeTest.h,
7595 tests/SplittedCharInputBufferTest.cpp,
7596 tests/SplittedCharInputBufferTest.h, tests/StreamCounterTest.cpp,
7597 tests/StreamCounterTest.h, tests/StreamInputBufferTest.cpp,
7598 tests/StreamInputBufferTest.h, tests/VectorStreamTest.cpp,
7599 tests/VectorStreamTest.h:
7600 replaced cxxtest by googletest
7601
7602 2009-10-12 Martin Gieseking <mgieseki@users.sourceforge.net>
7603
7604 * src/BgColorSpecialHandler.cpp, src/BgColorSpecialHandler.h,
7605 src/Bitmap.cpp, src/Bitmap.h, src/BoundingBox.cpp, src/BoundingBox.h,
7606 src/Calculator.cpp, src/Calculator.h, src/CharmapTranslator.cpp,
7607 src/CharmapTranslator.h, src/CmdLineParserBase.cpp,
7608 src/CmdLineParserBase.h, src/Color.cpp, src/Color.h,
7609 src/ColorSpecialHandler.cpp, src/ColorSpecialHandler.h, src/DLLoader.cpp,
7610 src/DLLoader.h, src/DVIActions.cpp, src/DVIActions.h, src/DVIReader.cpp,
7611 src/DVIReader.h, src/DVIToSVG.h, src/DVIToSVGActions.cpp,
7612 src/DVIToSVGActions.h, src/Directory.cpp, src/Directory.h,
7613 src/DvisvgmSpecialHandler.h, src/EmSpecialHandler.cpp,
7614 src/EmSpecialHandler.h, src/FileFinder.cpp, src/FileFinder.h,
7615 src/FileSystem.cpp, src/FileSystem.h, src/Font.cpp, src/Font.h,
7616 src/FontCache.cpp, src/FontCache.h, src/FontEmitter.h,
7617 src/FontEncoding.cpp, src/FontEncoding.h, src/FontEngine.cpp,
7618 src/FontEngine.h, src/FontGlyph.cpp, src/FontGlyph.h,
7619 src/FontManager.cpp, src/FontManager.h, src/FontMap.cpp, src/FontMap.h,
7620 src/GFGlyphTracer.cpp, src/GFGlyphTracer.h, src/GFReader.cpp,
7621 src/GFReader.h, src/GFTracer.cpp, src/GFTracer.h, src/Ghostscript.cpp,
7622 src/Ghostscript.h, src/GraphicPath.h, src/InputBuffer.cpp,
7623 src/InputBuffer.h, src/InputReader.cpp, src/InputReader.h,
7624 src/Matrix.cpp, src/Matrix.h, src/Message.cpp, src/Message.h,
7625 src/MessageException.h, src/MetafontWrapper.cpp, src/MetafontWrapper.h,
7626 src/PSInterpreter.cpp, src/PSInterpreter.h, src/PageSize.cpp,
7627 src/PageSize.h, src/Pair.h, src/SVGFontEmitter.cpp, src/SVGFontEmitter.h,
7628 src/SVGFontTraceEmitter.cpp, src/SVGFontTraceEmitter.h,
7629 src/SpecialActions.h, src/SpecialHandler.h, src/SpecialManager.cpp,
7630 src/SpecialManager.h, src/StreamCounter.h, src/StreamReader.cpp,
7631 src/StreamReader.h, src/TFM.cpp, src/TFM.h, src/TpicSpecialHandler.cpp,
7632 src/TpicSpecialHandler.h, src/VFActions.h, src/VFReader.cpp,
7633 src/VFReader.h, src/VectorStream.h, src/XMLDocTypeNode.h,
7634 src/XMLDocument.cpp, src/XMLDocument.h, src/XMLNode.cpp, src/XMLNode.h,
7635 src/XMLString.cpp, src/XMLString.h, src/macros.h, src/types.h:
7636 code cleanup
7637
7638 2009-10-11 Martin Gieseking <mgieseki@users.sourceforge.net>
7639
7640 * autogen.sh:
7641 fixed file permissions of autogen.sh
7642
7643 * src/DVIToSVG.cpp, src/DvisvgmSpecialHandler.cpp,
7644 src/PsSpecialHandler.cpp, src/PsSpecialHandler.h, src/SVGTree.cpp,
7645 src/SVGTree.h:
7646 suppress empty style and transformation elements
7647
7648 * NEWS:
7649 NEWS updated
7650
7651 2009-10-10 Martin Gieseking <martin.gieseking@uos.de>
7652
7653 * src/PsSpecialHandler.cpp:
7654 scale clipping paths by 72.27/72
7655
7656 2009-10-09 Martin Gieseking <martin.gieseking@uos.de>
7657
7658 * src/Bitmap.h:
7659 fixed bit shift overflow in Bitmap class occured on 64-bit systems
7660
7661 * autogen.sh, prepare:
7662 prepare script replaced by autogen.sh
7663
7664 * doc/dvisvgm.txt.in:
7665 fixed formatting of manual page
7666
7667 * src/Length.cpp, src/Length.h, tests/LengthTest.h:
7668 fixed unit conversion bug
7669
7670 * src/Makefile.am:
7671 fixed Makefile
7672
7673 2009-10-08 Martin Gieseking <martin.gieseking@uos.de>
7674
7675 * NEWS, doc/dvisvgm.txt.in, src/BoundingBox.cpp, src/CommandLine.cpp,
7676 src/CommandLine.h, src/DVIToSVG.cpp, src/DVIToSVG.h, src/dvisvgm.cpp,
7677 src/options.xml, tests/CommandLineTest.h, tests/Makefile.am:
7678 cmdline parameter --bbox can now be used to set the absolute bounding
7679 box
7680
7681 * NEWS, src/GraphicPath.h, src/PsSpecialHandler.cpp,
7682 src/PsSpecialHandler.h:
7683 PS clipping path sequences and intersections are now handled correctly
7684
7685 * src/MetafontWrapper.cpp:
7686 fixed file permissions
7687
7688 * src/dvisvgm.cpp:
7689 fixed uncaught PageSizeException
7690
7691 2009-10-07 Martin Gieseking <martin.gieseking@uos.de>
7692
7693 * NEWS, doc/dvisvgm.txt.in, src/BoundingBox.cpp, src/BoundingBox.h,
7694 src/DvisvgmSpecialHandler.cpp:
7695 added the special variant 'dvisvgm:bbox abs' and 'dvisvgm:bbox fix'
7696
7697 * src/BoundingBox.cpp, src/BoundingBox.h, src/Length.cpp, src/Length.h,
7698 src/Makefile.am, tests/LengthTest.h:
7699 class Length provides length unit calculations
7700
7701 2009-10-06 Martin Gieseking <martin.gieseking@uos.de>
7702
7703 * src/BoundingBox.cpp, src/BoundingBox.h, src/GraphicPath.h,
7704 src/PSInterpreter.cpp, src/PSInterpreter.h, src/PsSpecialHandler.cpp,
7705 src/PsSpecialHandler.h, src/psdefs.psc:
7706 fixed some PS bounding box and positioning issues introduced by previous
7707 changesets
7708
7709 * NEWS, configure.ac, fedora/dvisvgm.spec, src/Doxyfile:
7710 set version to 0.8.6
7711
7712 2009-10-05 Martin Gieseking <martin.gieseking@uos.de>
7713
7714 * src/PsSpecialHandler.cpp:
7715 convert PS path coordinated to TeX point units
7716
7717 * NEWS, src/PsSpecialHandler.cpp:
7718 fixed another positioning bug reported by John Bowman
7719
7720 2009-10-04 Martin Gieseking <martin.gieseking@uos.de>
7721
7722 * src/GraphicPath.h, src/PsSpecialHandler.cpp, src/PsSpecialHandler.h:
7723 corrected positioning bug introduced with previous PS positioning fix
7724
7725 2009-10-02 Martin Gieseking <martin.gieseking@uos.de>
7726
7727 * doc/Makefile.am, doc/dvisvgm.txt.in:
7728 generate pdf manpage directly with groff; adapted manpage source to work
7729 with latest asciidoc
7730
7731 2009-10-01 Martin Gieseking <martin.gieseking@uos.de>
7732
7733 * doc/Makefile.am, doc/dvisvgm.txt.in:
7734 replaced backticks in manpage by apostrophes; updated date on homepage
7735
7736 2009-09-30 Martin Gieseking <martin.gieseking@uos.de>
7737
7738 * src/DvisvgmSpecialHandler.cpp:
7739 added optional depth parameter to special dvisvgm:raw
7740
7741 * doc/dvisvgm.txt.in:
7742 added dvisvgm:raw example to man page
7743
7744 * LGPL-2.1.txt, NEWS, README:
7745 updated README and NEWS, and added file with LGPL license text
7746
7747 * Makefile.am, configure.ac, fedora/dvisvgm.spec, src/Doxyfile:
7748 increased version number to 0.8.5
7749
7750 2009-09-17 Martin Gieseking <martin.gieseking@uos.de>
7751
7752 * NEWS:
7753 added cretdit to John Bowman for sending a patch for the already fixed
7754 clipping bug
7755
7756 * src/PsSpecialHandler.h:
7757 increased the default linewidth to 0.5
7758
7759 * fedora/dvisvgm.spec:
7760 updated spec file and fixed typo on website
7761
7762 * doc/dvisvgm.txt.in:
7763 minor changes of the documentation
7764
7765 2009-09-11 Martin Gieseking <martin.gieseking@uos.de>
7766
7767 * NEWS, src/CmdLineParserBase.cpp, src/FontCache.cpp,
7768 src/SVGFontTraceEmitter.cpp:
7769 fixed memory bug in tracer module (issue #21)
7770
7771 * NEWS, doc/dvisvgm.txt.in, src/CommandLine.cpp, src/CommandLine.h,
7772 src/DVIToSVGActions.cpp, src/DVIToSVGActions.h, src/SpecialManager.cpp,
7773 src/SpecialManager.h, src/dvisvgm.cpp, src/options.xml:
7774 added option --progress for enabling a progress indicator (feature #22)
7775
7776 * src/FileSystem.cpp, src/MetafontWrapper.cpp:
7777 Windows: Metafont is now called via CreateProcess()
7778
7779 2009-09-10 Martin Gieseking <martin.gieseking@uos.de>
7780
7781 * src/BgColorSpecialHandler.cpp, src/BgColorSpecialHandler.h,
7782 src/ColorSpecialHandler.cpp, src/ColorSpecialHandler.h, src/DVIToSVG.cpp,
7783 src/DvisvgmSpecialHandler.cpp, src/DvisvgmSpecialHandler.h,
7784 src/EmSpecialHandler.cpp, src/EmSpecialHandler.h,
7785 src/PsSpecialHandler.cpp, src/PsSpecialHandler.h, src/SpecialHandler.h,
7786 src/SpecialManager.cpp, src/TpicSpecialHandler.cpp,
7787 src/TpicSpecialHandler.h:
7788 refactored prefixes methods of the SpecialHandlers (ticket #20)
7789
7790 * NEWS, doc/dvisvgm.txt.in, src/FileSystem.cpp, src/FileSystem.h,
7791 src/FontCache.cpp, src/FontCache.h, src/dvisvgm.cpp:
7792 option --cache prints additional information about the cached fonts
7793 (feature #7)
7794
7795 * src/FileSystem.cpp, src/FontCache.cpp:
7796 fixed Windows-related bug in FileSystem::collect
7797
7798 2009-09-06 Martin Gieseking <martin.gieseking@uos.de>
7799
7800 * NEWS, README:
7801 updated NEWS and README
7802
7803 2009-09-04 Martin Gieseking <martin.gieseking@uos.de>
7804
7805 * configure.ac, fedora/dvisvgm.spec, src/Doxyfile:
7806 increased version number to 0.8.4
7807
7808 * src/BoundingBox.cpp, src/BoundingBox.h, src/PsSpecialHandler.cpp:
7809 linewidths are now considered properly in computation of bounding box
7810 (issue #13)
7811
7812 * src/dvisvgm.cpp:
7813 fixed evaluation of option --help
7814
7815 * src/CmdLineParserBase.cpp, src/CmdLineParserBase.h, src/CommandLine.cpp,
7816 src/InputBuffer.h, src/InputReader.h, src/psdefs.psc,
7817 tests/CommandLineTest.h:
7818 improved the command line parser to make it more POSIX-compliant
7819 (feature #17)
7820
7821 2009-09-01 Martin Gieseking <martin.gieseking@uos.de>
7822
7823 * src/PsSpecialHandler.cpp, src/psdefs.psc:
7824 fixed flattened clipping path bug (issue #11)
7825
7826 2009-08-31 Martin Gieseking <martin.gieseking@uos.de>
7827
7828 * src/Makefile.am:
7829 added error checks; disallow numeric optional arguments w/o default
7830 value
7831
7832 2009-08-28 Martin Gieseking <martin.gieseking@uos.de>
7833
7834 * NEWS, src/PSInterpreter.cpp, src/PsSpecialHandler.cpp, src/dvisvgm.cpp,
7835 src/psdefs.psc:
7836 added evaluation of PS 'show' operator in order to evaluate PSTricks
7837 Type 3 fonts properly
7838
7839 * fedora/dvisvgm.spec:
7840 updated spec file and homepage to latest release
7841
7842 2009-08-27 Martin Gieseking <martin.gieseking@uos.de>
7843
7844 * NEWS, configure.ac, doc/dvisvgm.txt.in, src/CmdLineParserBase.cpp,
7845 src/CommandLine.cpp, src/Doxyfile, src/dvisvgm.cpp, src/getopt.c,
7846 src/getopt.h, src/getopt1.c, src/options.xml:
7847 replaced option --cache=? by --cache; increased version number to 0.8.3
7848
7849 2009-08-26 Martin Gieseking <martin.gieseking@uos.de>
7850
7851 * fedora/dvisvgm-0.8.1-potrace.patch, fedora/dvisvgm-gs.patch,
7852 fedora/dvisvgm-potrace.patch, fedora/dvisvgm.spec:
7853 updated Fedora files
7854
7855 * configure.ac, fedora/dvisvgm.spec, src/Ghostscript.cpp,
7856 src/Ghostscript.h, src/Makefile.am:
7857 improved Ghostscript and potrace linking checks to simplify usage of
7858 external devel files
7859
7860 * NEWS, configure.ac, src/DVIToSVG.cpp, src/DVIToSVG.h,
7861 src/DVIToSVGActions.cpp, src/DVIToSVGActions.h, src/PsSpecialHandler.cpp,
7862 src/SpecialManager.cpp, src/SpecialManager.h:
7863 PS prologue files referenced in first page are now always loaded
7864
7865 2009-08-24 Martin Gieseking <martin.gieseking@uos.de>
7866
7867 * src/CommandLine.cpp, src/CommandLine.h:
7868 speed up printing help by using puts() instead of C++ streams
7869
7870 2009-08-21 Martin Gieseking <martin.gieseking@uos.de>
7871
7872 * src/FontMap.cpp:
7873 fixed memory bug in FontMap
7874
7875 * src/CmdLineParserBase.cpp, src/CmdLineParserBase.h, src/Makefile.am,
7876 src/dvisvgm.cpp, src/options.xml, tests/CommandLineTest.h,
7877 tests/Makefile.am:
7878 improved CmdLineParserBase and replaced gengetopt-based parser
7879
7880 * NEWS, configure.ac, src/CmdLineParserBase.cpp, src/CmdLineParserBase.h,
7881 src/Doxyfile:
7882 increased version number to 0.8.2
7883
7884 2009-08-20 Martin Gieseking <martin.gieseking@uos.de>
7885
7886 * src/InputReader.cpp, src/InputReader.h:
7887 added method parseUInt()
7888
7889 * src/CmdLineParserBase.cpp, src/CmdLineParserBase.h, src/options.xml:
7890 added files for replacement of gengetopt (not active yet)
7891
7892 * src/CmdLineParserBase.cpp, src/CmdLineParserBase.h:
7893 finished cmdline parser
7894
7895 * COPYING:
7896 added copy of file COPYING
7897
7898 2009-08-17 Martin Gieseking <martin.gieseking@uos.de>
7899
7900 * tests/Makefile.am:
7901 added include path to fix broken distcheck
7902
7903 * COPYING, LICENSE, Makefile.am, README, doc/dvisvgm.txt.in,
7904 src/BgColorSpecialHandler.cpp, src/BgColorSpecialHandler.h,
7905 src/Bitmap.cpp, src/Bitmap.h, src/BoundingBox.cpp, src/BoundingBox.h,
7906 src/Calculator.cpp, src/Calculator.h, src/CharmapTranslator.cpp,
7907 src/CharmapTranslator.h, src/Color.cpp, src/Color.h,
7908 src/ColorSpecialHandler.cpp, src/ColorSpecialHandler.h, src/DLLoader.cpp,
7909 src/DLLoader.h, src/DVIActions.cpp, src/DVIActions.h, src/DVIReader.cpp,
7910 src/DVIReader.h, src/DVIToSVG.cpp, src/DVIToSVG.h,
7911 src/DVIToSVGActions.cpp, src/DVIToSVGActions.h, src/Directory.cpp,
7912 src/Directory.h, src/DvisvgmSpecialHandler.cpp,
7913 src/DvisvgmSpecialHandler.h, src/EmSpecialHandler.cpp,
7914 src/EmSpecialHandler.h, src/FileFinder.cpp, src/FileFinder.h,
7915 src/FileSystem.cpp, src/FileSystem.h, src/Font.cpp, src/Font.h,
7916 src/FontCache.cpp, src/FontCache.h, src/FontEmitter.h,
7917 src/FontEncoding.cpp, src/FontEncoding.h, src/FontEngine.cpp,
7918 src/FontEngine.h, src/FontGlyph.cpp, src/FontGlyph.h,
7919 src/FontManager.cpp, src/FontManager.h, src/FontMap.cpp, src/FontMap.h,
7920 src/GFGlyphTracer.cpp, src/GFGlyphTracer.h, src/GFReader.cpp,
7921 src/GFReader.h, src/GFTracer.cpp, src/GFTracer.h, src/Ghostscript.cpp,
7922 src/Ghostscript.h, src/GraphicPath.h, src/InputBuffer.cpp,
7923 src/InputBuffer.h, src/InputReader.cpp, src/InputReader.h,
7924 src/Matrix.cpp, src/Matrix.h, src/Message.cpp, src/Message.h,
7925 src/MessageException.h, src/MetafontWrapper.cpp, src/MetafontWrapper.h,
7926 src/PSInterpreter.cpp, src/PSInterpreter.h, src/PageSize.cpp,
7927 src/PageSize.h, src/Pair.h, src/PsSpecialHandler.cpp,
7928 src/PsSpecialHandler.h, src/SVGFontEmitter.cpp, src/SVGFontEmitter.h,
7929 src/SVGFontTraceEmitter.cpp, src/SVGFontTraceEmitter.h, src/SVGTree.cpp,
7930 src/SVGTree.h, src/SpecialActions.h, src/SpecialHandler.h,
7931 src/SpecialManager.cpp, src/SpecialManager.h, src/StreamCounter.h,
7932 src/StreamReader.cpp, src/StreamReader.h, src/TFM.cpp, src/TFM.h,
7933 src/TpicSpecialHandler.cpp, src/TpicSpecialHandler.h, src/VFActions.h,
7934 src/VFReader.cpp, src/VFReader.h, src/VectorStream.h,
7935 src/XMLDocTypeNode.h, src/XMLDocument.cpp, src/XMLDocument.h,
7936 src/XMLNode.cpp, src/XMLNode.h, src/XMLString.cpp, src/XMLString.h,
7937 src/dvisvgm.cpp, src/inttypes.h, src/macros.h, src/psdefs.psc,
7938 src/types.h, tests/CalculatorTest.h, tests/ColorSpecialTest.h,
7939 tests/DirectoryTest.h, tests/FileFinderTest.h, tests/FontManagerTest.h,
7940 tests/FontMapTest.h, tests/GraphicPathTest.h, tests/MatrixTest.h,
7941 tests/PageSizeTest.h, tests/SplittedCharInputBufferTest.h,
7942 tests/StreamCounterTest.h, tests/StreamInputBufferTest.h,
7943 tests/VectorStreamTest.h:
7944 changed license to GPL version 3 or later
7945
7946 2009-08-10 Martin Gieseking <martin.gieseking@uos.de>
7947
7948 * fedora/dvisvgm-0.8.1-potrace.patch, fedora/dvisvgm.spec:
7949 added spec file and patch for Fedora builds
7950
7951 * Makefile.am, configure.ac, src/Makefile.am, src/tests/CalculatorTest.h,
7952 src/tests/ColorSpecialTest.h, src/tests/DirectoryTest.h,
7953 src/tests/FileFinderTest.h, src/tests/FontManagerTest.h,
7954 src/tests/FontMapTest.h, src/tests/GraphicPathTest.h,
7955 src/tests/MatrixTest.h, src/tests/PageSizeTest.h,
7956 src/tests/SplittedCharInputBufferTest.h, src/tests/StreamCounterTest.h,
7957 src/tests/StreamInputBufferTest.h, src/tests/VectorStreamTest.h,
7958 src/tests/dvipdfm_test.map, src/tests/dvips_test.map,
7959 tests/CalculatorTest.h, tests/ColorSpecialTest.h, tests/DirectoryTest.h,
7960 tests/FileFinderTest.h, tests/FontManagerTest.h, tests/FontMapTest.h,
7961 tests/GraphicPathTest.h, tests/Makefile.am, tests/MatrixTest.h,
7962 tests/PageSizeTest.h, tests/SplittedCharInputBufferTest.h,
7963 tests/StreamCounterTest.h, tests/StreamInputBufferTest.h,
7964 tests/VectorStreamTest.h, tests/dvipdfm_test.map, tests/dvips_test.map:
7965 moved tests from src/tests to ./tests
7966
7967 * tests/Makefile.am:
7968 added generated file test-all.cpp to CLEANFILES
7969
7970 2009-08-02 Martin Gieseking <martin.gieseking@uos.de>
7971
7972 * LICENSE, Makefile.am, src/Ghostscript.cpp:
7973 modified package to be compatible with prerequisites of Fedora
7974
7975 2009-07-30 Martin Gieseking <martin.gieseking@uos.de>
7976
7977 * configure.ac, src/DVIToSVG.cpp:
7978 added target triplet to version string in SVG output
7979
7980 * src/DVIToSVGActions.cpp, src/Ghostscript.cpp, src/Ghostscript.h,
7981 src/PsSpecialHandler.cpp, src/PsSpecialHandler.h:
7982 added Ghostscript revision info to output of dvisvgm -l
7983
7984 2009-07-29 Martin Gieseking <martin.gieseking@uos.de>
7985
7986 * src/psdefs.psc:
7987 added vim tag to psdefs.psc
7988
7989 2009-07-28 Martin Gieseking <martin.gieseking@uos.de>
7990
7991 * src/PsSpecialHandler.cpp:
7992 added evaluation of more psfile parameters; fixed psfile bounding box
7993 bug
7994
7995 * NEWS, configure.ac, src/Doxyfile:
7996 updated version number to 0.8.1
7997
7998 * NEWS, src/FileSystem.cpp, src/FontEngine.cpp, src/FontManager.cpp,
7999 src/Ghostscript.cpp, src/PageSize.cpp, src/dvisvgm.cpp:
8000 fixed bug related to unsigned/size_t mismatch on x64 systems
8001
8002 * src/psdefs.psc:
8003 cleaned up VC++ build files; added batch file to generate cmdline.c;
8004 added generated file psdefs.psc for convenience
8005
8006 2009-07-27 Martin Gieseking <martin.gieseking@uos.de>
8007
8008 * src/DLLoader.cpp, src/InputReader.cpp, src/PSInterpreter.cpp:
8009 changes to make VC happy; fixed potential memory bug
8010
8011 * NEWS, README:
8012 fixed typos; updated homepage/manpage
8013
8014 * src/DVIReader.h, src/InputBuffer.cpp, src/InputBuffer.h,
8015 src/InputReader.cpp, src/InputReader.h, src/Matrix.cpp, src/Matrix.h,
8016 src/PSInterpreter.h:
8017 replaced size_t parameters by unsigned
8018
8019 2009-07-23 Martin Gieseking <martin.gieseking@uos.de>
8020
8021 * src/PSInterpreter.cpp:
8022 some clean-ups
8023
8024 2009-07-22 Martin Gieseking <martin.gieseking@uos.de>
8025
8026 * NEWS, README, doc/dvisvgm.txt.in, src/BoundingBox.cpp,
8027 src/BoundingBox.h, src/GraphicPath.h, src/PSInterpreter.cpp,
8028 src/PsSpecialHandler.cpp, src/PsSpecialHandler.h:
8029 fixed clipping bug; updated homepage, README, NEWS
8030
8031 * src/TpicSpecialHandler.cpp:
8032 fixed reintroduced bug in TPIC handler
8033
8034 2009-07-20 Martin Gieseking <martin.gieseking@uos.de>
8035
8036 * src/DvisvgmSpecialHandler.cpp, src/InputBuffer.cpp, src/InputReader.cpp,
8037 src/InputReader.h, src/PsSpecialHandler.cpp, src/PsSpecialHandler.h,
8038 src/tests/StreamInputBufferTest.h:
8039 implemented psfile special; fixed some bugs
8040
8041 * src/PsSpecialHandler.cpp, src/SVGTree.cpp:
8042 fixed bbox bug; added missing file
8043
8044 2009-07-19 Martin Gieseking <martin.gieseking@uos.de>
8045
8046 * configure.ac, doc/dvisvgm.txt.in, src/BoundingBox.cpp,
8047 src/BoundingBox.h, src/Color.cpp, src/Color.h, src/DLLoader.cpp,
8048 src/DLLoader.h, src/DVIToSVG.cpp, src/DVIToSVG.h,
8049 src/DVIToSVGActions.cpp, src/DVIToSVGActions.h, src/Doxyfile,
8050 src/DvisvgmSpecialHandler.cpp, src/EmSpecialHandler.cpp,
8051 src/FileFinder.cpp, src/FontEncoding.cpp, src/Ghostscript.cpp,
8052 src/Ghostscript.h, src/GraphicPath.h, src/InputBuffer.cpp,
8053 src/InputBuffer.h, src/InputReader.cpp, src/InputReader.h,
8054 src/Makefile.am, src/Matrix.cpp, src/Matrix.h, src/PSInterpreter.cpp,
8055 src/PSInterpreter.h, src/PsSpecialHandler.cpp, src/PsSpecialHandler.h,
8056 src/SVGFontEmitter.cpp, src/SVGFontEmitter.h,
8057 src/SVGFontTraceEmitter.cpp, src/SVGFontTraceEmitter.h, src/SVGTree.h,
8058 src/SpecialActions.h, src/TpicSpecialHandler.cpp,
8059 src/TransformationMatrix.cpp, src/TransformationMatrix.h,
8060 src/XMLDocument.cpp, src/XMLDocument.h, src/XMLNode.cpp, src/XMLNode.h,
8061 src/iapi.h, src/ierrors.h, src/tests/GraphicPathTest.h,
8062 src/tests/MatrixTest.h, src/tests/SplittedCharInputBufferTest.h,
8063 src/tests/StreamInputBufferTest.h:
8064 transplanted PS functionality to default branch
8065
8066 2009-06-01 Martin Gieseking <martin.gieseking@uos.de>
8067
8068 * src/GFReader.cpp, src/GFReader.h:
8069 removed error method, use Message::estream instead
8070
8071 * src/InputBuffer.cpp, src/InputBuffer.h, src/Makefile.am:
8072 transplanted changes to InputBuffer from branch 'pages'
8073
8074 * src/Bitmap.cpp, src/Bitmap.h:
8075 transplanted changes to Bitmap from branch 'pages'
8076
8077 * src/DVIReader.cpp, src/DVIReader.h:
8078 transplanted changes to DVIReader from branch 'pages'
8079
8080 * src/FileSystem.cpp, src/FileSystem.h:
8081 transplanted changes to FileSystem from branch 'pages'
8082
8083 * src/VFReader.cpp:
8084 transplanted changes to VFReader from branch 'pages'
8085
8086 * src/GFTracer.cpp:
8087 transplanted changes to GFTracer from branch 'pages'
8088
8089 * src/BgColorSpecialHandler.cpp, src/BgColorSpecialHandler.h,
8090 src/ColorSpecialHandler.cpp, src/ColorSpecialHandler.h,
8091 src/DvisvgmSpecialHandler.cpp, src/DvisvgmSpecialHandler.h,
8092 src/EmSpecialHandler.cpp, src/EmSpecialHandler.h, src/SpecialHandler.h,
8093 src/SpecialManager.cpp, src/SpecialManager.h, src/TpicSpecialHandler.cpp,
8094 src/TpicSpecialHandler.h:
8095 transplanted changes to SpecialHandlers from branch 'pages'
8096
8097 2009-04-24 Martin Gieseking <martin.gieseking@uos.de>
8098
8099 * src/TpicSpecialHandler.cpp:
8100 fixed TPIC handler bug that could caused unwanted color fills of
8101 ellipses due to a missing call of reset()
8102
8103 * NEWS, configure.ac, src/Doxyfile:
8104 increased version number to 0.7.3
8105
8106 * src/FontCache.h:
8107 increased version of font cache files to ensure their recreation due to
8108 the previously fixed shorthand path command bug
8109
8110 2009-04-23 Martin Gieseking <martin.gieseking@uos.de>
8111
8112 * src/FontGlyph.cpp:
8113 fixed bug in computation of shorthand path command
8114
8115 2009-04-06 Martin Gieseking <martin.gieseking@uos.de>
8116
8117 * src/FontMap.cpp:
8118 fixed bug in FontMap that causes a segfault if extension in given font
8119 file is missing (reported by Armin Geisse)
8120
8121 2009-04-02 Martin Gieseking <martin.gieseking@uos.de>
8122
8123 * configure.ac, doc/dvisvgm.txt.in, src/MetafontWrapper.cpp,
8124 src/dvisvgm.cpp:
8125 prepared release 0.7.2 (removed inclusions of debug.h, adapted homepage
8126 and manpage)
8127
8128 2009-03-31 Martin Gieseking <martin.gieseking@uos.de>
8129
8130 * src/MetafontWrapper.cpp, src/MetafontWrapper.h:
8131 ported fix in MetafontWrapper back to default branch
8132
8133 2009-03-25 Martin Gieseking <martin.gieseking@uos.de>
8134
8135 * src/DVIToSVG.cpp, src/DVIToSVG.h, src/FontGlyph.cpp,
8136 src/SVGFontTraceEmitter.cpp, src/SVGFontTraceEmitter.h, src/dvisvgm.cpp:
8137 replaced Metafont magnification variable and its setters by a public
8138 class variable
8139
8140 * src/Doxyfile:
8141 added doxygen files
8142
8143 * src/SVGFontTraceEmitter.cpp:
8144 fixed closing bracket "bug" when writing the currently traced character
8145 to the terminal
8146
8147 2009-03-24 Martin Gieseking <martin.gieseking@uos.de>
8148
8149 * NEWS, src/FontCache.cpp, src/FontGlyph.cpp, src/FontGlyph.h,
8150 src/GFGlyphTracer.cpp, src/Pair.h, src/SVGFontEmitter.cpp:
8151 use of shorthand path commands has been implemented
8152
8153 * src/FontGlyph.cpp:
8154 fixed potential bug in Glyph::optimizeCommands()
8155
8156 * src/FontGlyph.cpp:
8157 fixed memory bug in Glyph::optimizeCommands()
8158
8159 2009-03-20 Martin Gieseking <martin.gieseking@uos.de>
8160
8161 * src/FontCache.cpp:
8162 cache files are being compressed now to reduce the file size
8163
8164 2009-03-19 Martin Gieseking <martin.gieseking@uos.de>
8165
8166 * NEWS, doc/dvisvgm.txt.in, src/FontEmitter.h, src/GFGlyphTracer.cpp,
8167 src/SVGFontEmitter.cpp, src/SVGFontEmitter.h,
8168 src/SVGFontTraceEmitter.cpp, src/SVGFontTraceEmitter.h, src/dvisvgm.cpp,
8169 src/options.ggo:
8170 added option --trace-all that forces tracing of all glyphs of all
8171 currently used bitmap fonts
8172
8173 * src/FontCache.cpp, src/SVGFontTraceEmitter.cpp:
8174 don't read existing cache file if --trace-all is given (trace complete
8175 font and then write cache file instead)
8176
8177 2009-03-18 Martin Gieseking <martin.gieseking@uos.de>
8178
8179 * src/FontCache.cpp:
8180 fixed bug in read/write functions of FontCache
8181
8182 * src/DVIToSVG.cpp, src/TFM.cpp, src/TFM.h:
8183 added firstChar()/lastChar() to TFM class, removed unnecessary mag
8184 member variable and its setter
8185
8186 2009-03-17 Martin Gieseking <martin.gieseking@uos.de>
8187
8188 * doc/dvisvgm.txt.in, src/DVIToSVG.cpp, src/FileSystem.cpp,
8189 src/FileSystem.h, src/FontCache.cpp, src/FontCache.h, src/FontGlyph.h,
8190 src/GFGlyphTracer.cpp, src/GFGlyphTracer.h, src/Makefile.am,
8191 src/SVGFontTraceEmitter.cpp, src/SVGFontTraceEmitter.h, src/dvisvgm.cpp:
8192 completed font caching support
8193
8194 * doc/dvisvgm.txt.in, src/dvisvgm.cpp:
8195 added option variant --cache=? to display the default cache directory
8196
8197 * src/FontCache.cpp:
8198 reduced size of cache file format by using variable integer sizes
8199
8200 2009-03-16 Martin Gieseking <martin.gieseking@uos.de>
8201
8202 * NEWS, configure.ac, doc/dvisvgm.txt.in, src/DVIToSVG.cpp,
8203 src/FileSystem.cpp, src/FileSystem.h, src/FontCache.cpp, src/FontCache.h,
8204 src/FontGlyph.cpp, src/FontGlyph.h, src/GFGlyphTracer.cpp,
8205 src/GFGlyphTracer.h, src/GFTracer.cpp, src/options.ggo:
8206 first additions to support font caching; not working yet
8207
8208 2009-03-11 Martin Gieseking <martin.gieseking@uos.de>
8209
8210 * src/DVIReader.h, src/DVIToSVG.cpp, src/DVIToSVGActions.cpp,
8211 src/DVIToSVGActions.h, src/FontEmitter.h, src/SVGFontEmitter.cpp,
8212 src/SVGFontEmitter.h, src/SVGFontTraceEmitter.cpp,
8213 src/SVGFontTraceEmitter.h:
8214 improved font embedding algorithm in case of --no-fonts (identical
8215 glyphs in different sizes are now referenced rather than duplicated)
8216
8217 2009-03-10 Martin Gieseking <martin.gieseking@uos.de>
8218
8219 * NEWS, src/DVIToSVG.cpp, src/DVIToSVGActions.cpp, src/Font.h,
8220 src/SVGFontEmitter.cpp, src/SVGFontTraceEmitter.cpp:
8221 all glyph sizes are now computed correctly in conjuction with option
8222 --no-fonts
8223
8224 2009-03-09 Martin Gieseking <martin.gieseking@uos.de>
8225
8226 * src/BgColorSpecialHandler.cpp, src/SpecialManager.cpp,
8227 src/TpicSpecialHandler.cpp:
8228 adapted Code to make VC happy
8229
8230 * src/types.h:
8231 minor changes to homepage and .hgignore
8232
8233 * src/DVIReader.cpp, src/DVIReader.h, src/DVIToSVG.cpp, src/DVIToSVG.h,
8234 src/DVIToSVGActions.cpp:
8235 fixed transformation bug (transformations are now applied properly to
8236 the page)
8237
8238 2009-03-08 Martin Gieseking <martin.gieseking@uos.de>
8239
8240 * NEWS, README, src/Color.cpp, src/Color.h, src/ColorSpecialHandler.cpp,
8241 src/DVIToSVGActions.cpp, src/DVIToSVGActions.h,
8242 src/DvisvgmSpecialHandler.cpp, src/EmSpecialHandler.cpp, src/Makefile.am,
8243 src/TpicSpecialHandler.cpp:
8244 added bgcolor support, updated homepage, fixed color handler bug
8245
8246 * src/BgColorSpecialHandler.cpp, src/BgColorSpecialHandler.h:
8247 added missing background color handler
8248
8249 2009-03-06 Martin Gieseking <martin.gieseking@uos.de>
8250
8251 * src/TpicSpecialHandler.cpp, src/TpicSpecialHandler.h:
8252 implemented arc drawing of tpic special set
8253
8254 * src/TpicSpecialHandler.cpp, src/TpicSpecialHandler.h:
8255 implemented splines of tpic specials
8256
8257 2009-03-03 Martin Gieseking <martin.gieseking@uos.de>
8258
8259 * src/BoundingBox.cpp, src/BoundingBox.h, src/Color.cpp,
8260 src/ColorSpecialHandler.cpp, src/ColorSpecialHandler.h, src/DVIActions.h,
8261 src/DVIBBoxActions.h, src/DVIToSVG.cpp, src/DVIToSVG.h,
8262 src/DVIToSVGActions.cpp, src/DVIToSVGActions.h, src/EmSpecialHandler.cpp,
8263 src/Makefile.am, src/SpecialActions.h, src/SpecialHandler.h,
8264 src/TpicSpecialHandler.cpp:
8265 improved computation of the bounding box (works with specials now);
8266 added dummy function for background color assignments
8267
8268 * doc/Makefile.am, doc/dvisvgm.txt.in, src/DVIToSVGActions.cpp,
8269 src/DVIToSVGActions.h, src/DvisvgmSpecialHandler.cpp,
8270 src/DvisvgmSpecialHandler.h, src/InputBuffer.cpp, src/InputBuffer.h,
8271 src/SpecialActions.h:
8272 implemented the dvisvgm specials raw, image, and bbox
8273
8274 * doc/dvisvgm.txt.in, src/DvisvgmSpecialHandler.cpp,
8275 src/DvisvgmSpecialHandler.h:
8276 minor code improvements; comments added
8277
8278 2009-02-26 Martin Gieseking <martin.gieseking@uos.de>
8279
8280 * doc/Makefile.am, doc/dvisvgm.txt, doc/dvisvgm.txt.in:
8281 removed generated file, added dvisvgm.txt.in
8282
8283 * doc/Makefile.am, doc/dvisvgm.txt.in:
8284 improved manpage
8285
8286 2009-02-25 Martin Gieseking <martin.gieseking@uos.de>
8287
8288 * src/DVIToSVGActions.cpp, src/DVIToSVGActions.h,
8289 src/DvisvgmSpecialHandler.cpp, src/EmSpecialHandler.cpp,
8290 src/SpecialActions.h, src/TpicSpecialHandler.cpp:
8291 renamed appendInPage() to appendToPage
8292
8293 2009-02-24 Martin Gieseking <martin.gieseking@uos.de>
8294
8295 * src/ColorSpecialHandler.cpp, src/ColorSpecialHandler.h,
8296 src/DVIToSVGActions.cpp, src/DvisvgmSpecialHandler.cpp,
8297 src/DvisvgmSpecialHandler.h, src/EmSpecialHandler.cpp,
8298 src/EmSpecialHandler.h, src/Makefile.am, src/SpecialColorHandler.cpp,
8299 src/SpecialColorHandler.h, src/SpecialDvisvgmHandler.cpp,
8300 src/SpecialDvisvgmHandler.h, src/SpecialEmHandler.cpp,
8301 src/SpecialEmHandler.h, src/SpecialHandler.h, src/SpecialHtmlHandler.h,
8302 src/SpecialManager.cpp, src/SpecialManager.h,
8303 src/tests/ColorSpecialTest.h:
8304 improved SpecialHandler is now able to handle unprefixed specials
8305
8306 * NEWS, src/Color.cpp, src/Color.h, src/DVIToSVGActions.cpp,
8307 src/Makefile.am, src/Pair.h, src/SpecialHandler.h,
8308 src/SpecialManager.cpp, src/SpecialManager.h, src/TpicSpecialHandler.cpp,
8309 src/TpicSpecialHandler.h:
8310 first tpic implementations; not complete yet
8311
8312 * NEWS, doc/dvisvgm.1.in, src/TpicSpecialHandler.cpp:
8313 few additions to tpic handler
8314
8315 2009-02-23 Martin Gieseking <martin.gieseking@uos.de>
8316
8317 * NEWS, configure.ac, doc/dvisvgm.1.in, src/DVIBBoxActions.h,
8318 src/DVIReader.h, src/DVIToSVG.cpp, src/DVIToSVG.h,
8319 src/DVIToSVGActions.cpp, src/FontEmitter.h, src/FontEngine.cpp,
8320 src/FontEngine.h, src/FontGlyph.cpp, src/FontGlyph.h,
8321 src/SVGFontEmitter.cpp, src/SVGFontEmitter.h,
8322 src/SVGFontTraceEmitter.cpp, src/SVGFontTraceEmitter.h, src/XMLNode.cpp,
8323 src/XMLNode.h, src/dvisvgm.cpp, src/options.ggo,
8324 src/tests/ColorSpecialTest.h:
8325 added option --no-fonts wich uses path elements instead of fonts
8326
8327 2009-02-20 Martin Gieseking <martin.gieseking@uos.de>
8328
8329 * NEWS, doc/dvisvgm.1.in, src/Color.cpp, src/Color.h,
8330 src/DVIToSVGActions.cpp, src/DVIToSVGActions.h, src/Makefile.am,
8331 src/SpecialActions.h, src/SpecialColorHandler.cpp,
8332 src/SpecialDvisvgmHandler.cpp, src/SpecialDvisvgmHandler.h,
8333 src/SpecialEmHandler.cpp, src/SpecialEmHandler.h,
8334 src/SpecialHtmlHandler.h, src/VerbSpecialHandler.cpp,
8335 src/VerbSpecialHandler.h:
8336 fixed bug in color handler, added skeletons of dvisvgm/hyperref special
8337 handlers
8338
8339 2009-02-18 Martin Gieseking <martin.gieseking@uos.de>
8340
8341 * src/Color.h, src/DVIToSVGActions.cpp, src/DVIToSVGActions.h,
8342 src/Makefile.am, src/SpecialActions.h, src/SpecialColorHandler.cpp,
8343 src/SpecialEmHandler.cpp:
8344 added color support to emTeX specials, removed Color class
8345
8346 * NEWS, src/SpecialActions.h, src/tests/ColorSpecialTest.h:
8347 adapted color test to new interface, added emtex info
8348
8349 2009-02-17 Martin Gieseking <martin.gieseking@uos.de>
8350
8351 * src/DVIReader.cpp:
8352 made DVICommand local to executeCommand, removed unnecessary if
8353 statement
8354
8355 2009-02-14 Martin Gieseking <martin.gieseking@uos.de>
8356
8357 * src/Color.h, src/DVIToSVGActions.cpp, src/DVIToSVGActions.h:
8358 finished color support
8359
8360 * src/dvisvgm.cpp:
8361 fixed incorrect behavior of option -V/--version
8362
8363 * NEWS, configure.ac:
8364 increased version number to 0.6.2, updated NEWS
8365
8366 * doc/dvisvgm.1.in, src/DVIToSVG.cpp, src/DVIToSVG.h,
8367 src/DVIToSVGActions.cpp, src/dvisvgm.cpp, src/options.ggo:
8368 added option --no-style
8369
8370 * NEWS, configure.ac:
8371 prepared release of version 0.7
8372
8373 2009-02-13 Martin Gieseking <martin.gieseking@uos.de>
8374
8375 * Makefile.am, configure.ac, src/tests/DirectoryTest.h:
8376 removed rpm support
8377
8378 * prepare:
8379 added administrative files
8380
8381 * src/ColorSpecialHandler.cpp, src/ColorSpecialHandler.h:
8382 reverted to previous version, removed dependency on Color class
8383
8384 * src/DVIToSVGActions.cpp, src/DVIToSVGActions.h, src/Makefile.am,
8385 src/SpecialActions.h, src/SpecialHandler.h, src/SpecialManager.cpp,
8386 src/SpecialManager.h:
8387 color specials are now processed by DVIToSVGActions, but don't create
8388 any results yet
8389
8390 * prepare:
8391 updated administrative files
8392
8393 * src/ColorSpecialHandler.cpp, src/Makefile.am,
8394 src/tests/ColorSpecialTest.h:
8395 added tests for ColorSpecialHandler
8396
8397 2009-02-12 martin@xps <martin@xps>
8398
8399 * src/inttypes.h:
8400 added rudimentary files for writing of SWF files; not ready yet
8401
8402 2009-02-10 Martin Gieseking <martin.gieseking@uos.de>
8403
8404 * src/Color.h, src/ColorSpecialHandler.cpp, src/ColorSpecialHandler.h,
8405 src/Makefile.am:
8406 replaced RGB arrays by Color class
8407
8408 2009-02-09 Martin Gieseking <martin.gieseking@uos.de>
8409
8410 * src/TransformationMatrix.cpp:
8411 made y-coordinate of cmdline-option -t optional
8412
8413 2009-02-06 Martin Gieseking <martin.gieseking@uos.de>
8414
8415 * doc/dvisvgm.1.in, src/ColorSpecialHandler.h, src/DVIToSVG.cpp,
8416 src/DVIToSVG.h, src/DVIToSVGActions.cpp, src/DVIToSVGActions.h,
8417 src/SpecialHandler.h, src/SpecialManager.cpp, src/SpecialManager.h,
8418 src/dvisvgm.cpp, src/options.ggo:
8419 added option --list-specials that lists all registered special handlers
8420
8421 * src/FileFinder.cpp:
8422 changed lookup order of font maps
8423
8424 2009-02-05 Martin Gieseking <martin.gieseking@uos.de>
8425
8426 * src/DVIToSVG.cpp, src/DVIToSVG.h, src/DVIToSVGActions.cpp,
8427 src/DVIToSVGActions.h, src/dvisvgm.cpp, src/options.ggo:
8428 added optional prefix list to commandline option --no-specials
8429
8430 * src/DVIToSVGActions.cpp:
8431 replaced special ignore list evaluation algorithm
8432
8433 2009-02-04 Martin Gieseking <martin.gieseking@uos.de>
8434
8435 * src/FileFinder.cpp:
8436 added option for additional loading of user maps
8437
8438 * src/FontMap.cpp:
8439 added output of font encoding in write method
8440
8441 2009-02-03 Martin Gieseking <martin.gieseking@uos.de>
8442
8443 * src/ColorSpecialHandler.cpp, src/ColorSpecialHandler.h,
8444 src/DVIToSVGActions.cpp, src/DVIToSVGActions.h, src/SpecialHandler.h,
8445 src/SpecialManager.cpp, src/SpecialManager.h, src/options.ggo:
8446 more color special implementation (color constants), still not ready
8447
8448 * src/FileFinder.cpp, src/FileFinder.h, src/dvisvgm.cpp:
8449 option -m/--map-file is now evaluated properly
8450
8451 * map/cork-lm.map:
8452 removed deprecated map subdirectory
8453
8454 2009-02-02 Martin Gieseking <martin.gieseking@uos.de>
8455
8456 * NEWS, src/FileFinder.cpp:
8457 fixed buggy call of maketfm/makemf in Windows version
8458
8459 * src/ColorSpecialHandler.cpp, src/ColorSpecialHandler.h, src/Makefile.am,
8460 src/SpecialHandler.h, src/SpecialManager.cpp, src/SpecialManager.h:
8461 added special support skeletons; not working yet
8462
8463 * src/ColorSpecialHandler.cpp, src/ColorSpecialHandler.h:
8464 some refactorings in color handler
8465
8466 2009-01-30 Martin Gieseking <martin.gieseking@uos.de>
8467
8468 * src/dvisvgm.cpp:
8469 prevented writing zero-length svg files; simplified main code by using
8470 auto pointers
8471
8472 * NEWS, src/DVIReader.cpp, src/DVIReader.h:
8473 fixed magnification bug
8474
8475 2009-01-29 Martin Gieseking <martin.gieseking@uos.de>
8476
8477 * src/FileFinder.cpp:
8478 adapted Windows version to new release
8479
8480 2009-01-28 Martin Gieseking <martin.gieseking@uos.de>
8481
8482 * src/FileFinder.cpp, src/FileFinder.h, src/Makefile.am,
8483 src/tests/DirectoryTest.h, src/tests/FileFinderTest.h,
8484 src/tests/FontManagerTest.h, src/tests/KPSFileFinderTest.h:
8485 refactored FileFinder (implementation as singleton)
8486
8487 * src/dvisvgm.cpp:
8488 use new initialisation of FileFinder
8489
8490 * src/GFReader.h, src/GFTracer.cpp, src/GFTracer.h:
8491 improved GFTracer to support unscaled results
8492
8493 * src/FontMap.cpp, src/Makefile.am, src/tests/FontMapTest.h,
8494 src/tests/dvipdfm_test.map, src/tests/dvips_test.map:
8495 extensions to FontMap almost complete but not finished yet
8496
8497 * src/Calculator.cpp, src/DVIToSVG.cpp, src/FontEncoding.cpp,
8498 src/FontMap.cpp, src/SVGFontEmitter.cpp, src/SVGFontTraceEmitter.cpp:
8499 replaced comparisions with "" with calls of empty()
8500
8501 * src/FileFinder.cpp, src/FontMap.cpp, src/FontMap.h,
8502 src/tests/FontMapTest.h, src/tests/dvips_test.map:
8503 FontMap now supports dvips and dvipdfm maps
8504
8505 * NEWS, configure.ac, doc/dvisvgm.1.in:
8506 adapted configuration and documentation to new dvips map file support
8507
8508 2009-01-27 Martin Gieseking <martin.gieseking@uos.de>
8509
8510 * src/GFGlyphTracer.cpp, src/GFGlyphTracer.h, src/GFTracer.cpp,
8511 src/GFTracer.h, src/Makefile.am, src/SVGFontTraceEmitter.cpp,
8512 src/SVGFontTraceEmitter.h:
8513 made GFTracer a generic class with template methods
8514
8515 2009-01-26 Martin Gieseking <martin.gieseking@uos.de>
8516
8517 * src/Bitmap.cpp, src/Bitmap.h, src/GFReader.cpp, src/GFReader.h,
8518 src/GFTracer.cpp, src/Makefile.am:
8519 improvements to GF handling, first skeletton of gf->metapost (gfprint)
8520
8521 * src/InputBuffer.h:
8522 fixed incompatible types bug
8523
8524 2009-01-25 Martin Gieseking <martin.gieseking@uos.de>
8525
8526 * src/InputBuffer.cpp, src/InputBuffer.h:
8527 added missing include
8528
8529 * src/FontMap.cpp, src/FontMap.h:
8530 started redesign of FontMap, not complete yet
8531
8532 * src/CharmapTranslator.cpp, src/DVIToSVG.cpp, src/FileFinder.cpp,
8533 src/FileFinder.h, src/Font.cpp, src/FontEncoding.cpp,
8534 src/FontManager.cpp, src/KPSFileFinder.cpp, src/KPSFileFinder.h,
8535 src/Makefile.am, src/MetafontWrapper.cpp, src/TFM.cpp, src/dvisvgm.cpp:
8536 renamed KPSFileFinder to FileFinder
8537
8538 * src/FontMap.cpp:
8539 basic dvips font map support, not complete yet
8540
8541 2009-01-23 Martin Gieseking <martin.gieseking@uos.de>
8542
8543 * doc/Makefile.am, doc/dvisvgm.1.in:
8544 manpage updates
8545
8546 2009-01-22 Martin Gieseking <martin.gieseking@uos.de>
8547
8548 * src/FontMap.cpp:
8549 forgot to remove address operator
8550
8551 * src/KPSFileFinder.cpp, src/KPSFileFinder.h, src/dvisvgm.cpp:
8552 added support for MiKTeX' new COM interface
8553
8554 * src/DVIReader.cpp, src/FontManager.cpp, src/KPSFileFinder.cpp:
8555 memory leak fixed
8556
8557 * src/KPSFileFinder.cpp:
8558 fixed throwing of COM exception
8559
8560 * Makefile.am, NEWS, README, configure.ac, potracelib/Makefile.am:
8561 updated version info to 0.6
8562
8563 * src/tests/CalculatorTest.h, src/tests/DirectoryTest.h,
8564 src/tests/FontManagerTest.h, src/tests/FontMapTest.h,
8565 src/tests/KPSFileFinderTest.h, src/tests/PageSizeTest.h,
8566 src/tests/StreamCounterTest.h, src/tests/VectorStreamTest.h:
8567 updated tests
8568
8569 * doc/dvisvgm.1.in, src/Bitmap.cpp, src/Bitmap.h, src/BoundingBox.cpp,
8570 src/BoundingBox.h, src/Calculator.cpp, src/Calculator.h,
8571 src/CharmapTranslator.cpp, src/CharmapTranslator.h, src/DVIActions.cpp,
8572 src/DVIActions.h, src/DVIBBoxActions.h, src/DVIReader.cpp,
8573 src/DVIReader.h, src/DVIToSVG.cpp, src/DVIToSVG.h,
8574 src/DVIToSVGActions.cpp, src/DVIToSVGActions.h, src/Directory.cpp,
8575 src/Directory.h, src/FileFinder.cpp, src/FileFinder.h,
8576 src/FileSystem.cpp, src/FileSystem.h, src/Font.cpp, src/Font.h,
8577 src/FontEmitter.h, src/FontEncoding.cpp, src/FontEncoding.h,
8578 src/FontEngine.cpp, src/FontEngine.h, src/FontGlyph.cpp, src/FontGlyph.h,
8579 src/FontManager.cpp, src/FontManager.h, src/FontMap.cpp, src/FontMap.h,
8580 src/GFReader.cpp, src/GFReader.h, src/GFTracer.cpp, src/GFTracer.h,
8581 src/InputBuffer.cpp, src/InputBuffer.h, src/KPSFileFinder.cpp,
8582 src/KPSFileFinder.h, src/Makefile.am, src/Matrix.cpp, src/Matrix.h,
8583 src/Message.cpp, src/Message.h, src/MessageException.h,
8584 src/MetafontWrapper.cpp, src/MetafontWrapper.h, src/PSInterpreter.cpp,
8585 src/PSInterpreter.h, src/PageSize.cpp, src/PageSize.h, src/Pair.h,
8586 src/SVGFontEmitter.cpp, src/SVGFontEmitter.h,
8587 src/SVGFontTraceEmitter.cpp, src/SVGFontTraceEmitter.h,
8588 src/StreamCounter.h, src/StreamReader.cpp, src/StreamReader.h,
8589 src/TFM.cpp, src/TFM.h, src/TransformationMatrix.cpp,
8590 src/TransformationMatrix.h, src/VFActions.h, src/VFReader.cpp,
8591 src/VFReader.h, src/VectorStream.h, src/XMLDocTypeNode.h,
8592 src/XMLDocument.cpp, src/XMLDocument.h, src/XMLNode.cpp, src/XMLNode.h,
8593 src/XMLString.cpp, src/XMLString.h, src/dvisvgm.cpp, src/macros.h,
8594 src/options.ggo, src/types.h:
8595 updated file header comments
8596
8597 * configure.ac:
8598 added test whether dvipdfm.map is available
8599
8600 2009-01-21 Martin Gieseking <martin.gieseking@uos.de>
8601
8602 * src/DVIReader.cpp, src/DVIReader.h, src/DVIToSVG.cpp,
8603 src/FontEncoding.cpp, src/FontGlyph.cpp:
8604 fixed bugs in handling of font encodings and virtual fonts
8605
8606 * src/Calculator.cpp, src/DVIReader.cpp, src/DVIToSVGActions.cpp,
8607 src/Directory.cpp, src/FontEncoding.cpp, src/FontEngine.cpp,
8608 src/FontManager.cpp, src/FontMap.cpp, src/KPSFileFinder.cpp,
8609 src/MetafontWrapper.cpp, src/PageSize.cpp, src/StreamReader.cpp,
8610 src/TFM.cpp, src/TransformationMatrix.cpp, src/VFReader.cpp,
8611 src/XMLDocument.cpp, src/XMLNode.cpp:
8612 added in/out attributes to parameter documentation
8613
8614 2009-01-20 Martin Gieseking <martin.gieseking@uos.de>
8615
8616 * src/DVIReader.cpp, src/DVIToSVG.cpp, src/Font.h, src/FontEncoding.cpp,
8617 src/FontEncoding.h, src/FontEngine.cpp, src/FontEngine.h,
8618 src/FontGlyph.cpp, src/FontGlyph.h, src/FontManager.cpp,
8619 src/FontManager.h, src/InputBuffer.cpp, src/InputBuffer.h,
8620 src/SVGFontEmitter.cpp, src/SVGFontEmitter.h:
8621 first working version with font encoding support
8622
8623 * src/FontEngine.cpp, src/FontEngine.h, src/SVGFontEmitter.cpp:
8624 fixed glyph positioning bug occured in conjunction with font encoding
8625
8626 * src/SVGFontEmitter.cpp:
8627 fixed memory bug
8628
8629 2009-01-19 Martin Gieseking <martin.gieseking@uos.de>
8630
8631 * src/FontEncoding.cpp, src/FontEncoding.h, src/FontEngine.cpp,
8632 src/FontEngine.h, src/FontManager.cpp, src/FontManager.h,
8633 src/FontMap.cpp, src/FontMap.h, src/KPSFileFinder.cpp,
8634 src/KPSFileFinder.h:
8635 more encoding implementations, not complete yet
8636
8637 * src/DVIReader.cpp, src/FontEncoding.cpp, src/FontEncoding.h,
8638 src/FontEngine.cpp, src/FontEngine.h, src/FontManager.cpp,
8639 src/FontManager.h, src/FontMap.cpp:
8640 partly working mapping support, but yet too slow
8641
8642 2009-01-16 Martin Gieseking <martin.gieseking@uos.de>
8643
8644 * src/TransformationMatrix.cpp:
8645 fixed bug in argument assignment of transformation command M
8646
8647 2009-01-15 Martin Gieseking <martin.gieseking@uos.de>
8648
8649 * src/TransformationMatrix.cpp:
8650 removed a dangerous loop remained from previous code
8651
8652 2009-01-14 Martin Gieseking <martin.gieseking@uos.de>
8653
8654 * potracelib/auxiliary.h, potracelib/bitmap.h, potracelib/curve.c,
8655 potracelib/curve.h, potracelib/decompose.c, potracelib/decompose.h,
8656 potracelib/lists.h, potracelib/potracelib.c, potracelib/potracelib.h,
8657 potracelib/progress.h, potracelib/trace.c, potracelib/trace.h:
8658 updated libpotrace to version 1.8
8659
8660 * src/FontEncoding.cpp, src/FontEncoding.h, src/InputBuffer.cpp,
8661 src/InputBuffer.h, src/Makefile.am:
8662 added basic skeleton for handling of font encodings
8663
8664 * src/FileSystem.cpp, src/FileSystem.h:
8665 const string parameters
8666
8667 * src/dvisvgm.cpp:
8668 updated copyright string
8669
8670 * src/KPSFileFinder.cpp:
8671 added enc-file support
8672
8673 2009-01-13 Martin Gieseking <martin.gieseking@uos.de>
8674
8675 * src/CharmapTranslator.cpp:
8676 fixed crash on loading corrupt pfb-files
8677
8678 2008-06-18 Martin Gieseking <martin.gieseking@uos.de>
8679
8680 * src/Makefile.am:
8681 adapted to latest gengetopt version
8682
8683 2008-04-07 Martin Gieseking <martin.gieseking@uos.de>
8684
8685 * src/Makefile.am:
8686 added missing include path
8687
8688 * src/DVIReader.cpp:
8689 minor change
8690
8691 2007-03-26 Martin Gieseking <martin.gieseking@uos.de>
8692
8693 * NEWS, src/CharmapTranslator.cpp, src/CharmapTranslator.h,
8694 src/DVIActions.h, src/DVIReader.cpp, src/DVIToSVG.cpp,
8695 src/DVIToSVGActions.cpp, src/DVIToSVGActions.h, src/Font.h,
8696 src/FontManager.cpp, src/Makefile.am, src/SVGFontTraceEmitter.cpp,
8697 src/SVGFontTraceEmitter.h:
8698 redesigned DVIActions and CharmapTranslator
8699
8700 * src/DVIActions.cpp, src/DVIReader.cpp, src/DVIReader.h,
8701 src/FontManager.cpp, src/tests/FontManagerTest.h:
8702 few minor changes
8703
8704 2007-03-25 Martin Gieseking <martin.gieseking@uos.de>
8705
8706 * src/DVIActions.cpp, src/DVIActions.h, src/DVIBBoxActions.h,
8707 src/DVIReader.cpp, src/DVIReader.h, src/DVIToSVG.cpp,
8708 src/DVIToSVGActions.cpp, src/DVIToSVGActions.h, src/Font.cpp, src/Font.h,
8709 src/FontManager.cpp, src/FontManager.h, src/StreamReader.cpp,
8710 src/StreamReader.h, src/VFActions.h, src/VFReader.cpp, src/VFReader.h,
8711 src/VectorStream.h:
8712 first working version 0.5, release candidate 1
8713
8714 * src/DVIReader.cpp, src/DVIReader.h, src/VFActions.h:
8715 minor fixes
8716
8717 2007-03-23 Martin Gieseking <martin.gieseking@uos.de>
8718
8719 * src/DVIReader.cpp, src/FontManager.cpp, src/FontManager.h,
8720 src/KPSFileFinder.cpp, src/KPSFileFinder.h, src/VFReader.cpp:
8721 more vf implementations, not complete yet
8722
8723 2007-03-22 Martin Gieseking <martin.gieseking@uos.de>
8724
8725 * NEWS, doc/Makefile.in, src/DVIReader.cpp, src/DVIReader.h,
8726 src/DVIToSVG.cpp, src/DVIToSVG.h, src/FileSystem.cpp, src/FileSystem.h,
8727 src/KPSFileFinder.cpp, src/KPSFileFinder.h, src/Makefile.am,
8728 src/dvisvgm.cpp, src/tests/DirectoryTest.h, src/tests/FontManagerTest.h:
8729 reintegrated font map initialization into KPSFileFinderm adapted some
8730 tests
8731
8732 * src/DVIReader.cpp, src/Font.cpp, src/Font.h, src/FontManager.cpp,
8733 src/VFActions.h, src/VFReader.cpp, src/VFReader.h:
8734 more vf implementations
8735
8736 2007-03-21 Martin Gieseking <martin.gieseking@uos.de>
8737
8738 * AUTHORS, Makefile.am, README, potracelib/Makefile.am, src/Directory.cpp,
8739 src/Directory.h, src/KPSFileFinder.cpp, src/Makefile, src/Makefile.am,
8740 src/Makefile.in, src/SVGFontTraceEmitter.cpp, src/test-all.cpp,
8741 src/tests/DirectoryTest.h:
8742 implemented Directory class for Linux, added DirectoryTest
8743
8744 * src/Calculator.cpp, src/DVIReader.cpp, src/Directory.cpp, src/Font.h,
8745 src/FontManager.cpp, src/Makefile, src/Makefile.am, src/Makefile.in,
8746 src/MetafontWrapper.cpp, src/VFReader.cpp, src/VectorStream.h,
8747 src/test-all.cpp, src/tests/VectorStreamTest.h:
8748 removed redundant code and commented code fragments, added
8749 VectorInputStream class
8750
8751 * src/Directory.cpp, src/Directory.h, src/KPSFileFinder.cpp,
8752 src/KPSFileFinder.h, src/dvisvgm.cpp:
8753 completed MiKTeX font map file look-up, fixed bug in Directory class
8754
8755 * src/KPSFileFinder.cpp, src/KPSFileFinder.h, src/dvisvgm.cpp:
8756 implemented options -n and -m
8757
8758 2007-03-20 Martin Gieseking <martin.gieseking@uos.de>
8759
8760 * NEWS, doc/Makefile, doc/Makefile.in, doc/dvisvgm.1.in,
8761 src/DVIReader.cpp, src/DVIToSVG.cpp, src/Font.cpp, src/Font.h,
8762 src/FontManager.cpp, src/KPSFileFinder.cpp, src/Makefile,
8763 src/Makefile.am, src/Makefile.in, src/VFReader.cpp, src/dvisvgm.cpp,
8764 src/test-all.cpp, src/tests/KPSFileFinderTest.h:
8765 added KPSFileFinderTest, added EmptyFont, fixed compilation error
8766
8767 * src/Directory.cpp, src/Directory.h, src/FileSystem.cpp, src/FontMap.cpp,
8768 src/FontMap.h, src/KPSFileFinder.cpp:
8769 more changes for MiKTeX support
8770
8771 2007-03-19 Martin Gieseking <martin.gieseking@uos.de>
8772
8773 * src/CharmapTranslator.cpp, src/DVIToSVG.cpp, src/FontManager.cpp,
8774 src/KPSFileFinder.cpp, src/KPSFileFinder.h, src/Makefile,
8775 src/Makefile.am, src/Makefile.in, src/MetafontWrapper.cpp, src/TFM.cpp:
8776 added mktexFOO support and font map lookups to KPSFileFinder
8777
8778 * src/KPSFileFinder.cpp:
8779 bug fixed, font maps work now
8780
8781 * src/Font.cpp, src/Font.h, src/FontManager.cpp, src/FontMap.cpp,
8782 src/FontMap.h, src/KPSFileFinder.cpp:
8783 made sources comaptible with MikTeX
8784
8785 2007-03-16 Martin Gieseking <martin.gieseking@uos.de>
8786
8787 * src/Font.cpp, src/Font.h, src/FontManager.cpp, src/FontMap.cpp,
8788 src/FontMap.h, src/KPSFileFinder.cpp, src/Makefile, src/Makefile.am,
8789 src/Makefile.in, src/StreamReader.cpp, src/TFM.cpp, src/options.ggo,
8790 src/tests/FontMapTest.h:
8791 more coding in the font department, not finished yet
8792
8793 2007-03-09 Martin Gieseking <martin.gieseking@uos.de>
8794
8795 * src/CharmapTranslator.cpp, src/CharmapTranslator.h, src/DVIReader.cpp,
8796 src/DVIReader.h, src/DVIToSVG.cpp, src/DVIToSVGActions.cpp, src/Font.cpp,
8797 src/FontManager.cpp, src/GFTracer.cpp, src/KPSFileFinder.cpp,
8798 src/KPSFileFinder.h, src/Makefile, src/Makefile.am, src/Makefile.in,
8799 src/MetafontWrapper.cpp, src/MetafontWrapper.h,
8800 src/SVGFontTraceEmitter.cpp, src/SVGFontTraceEmitter.h,
8801 src/StreamReader.cpp, src/StreamReader.h, src/TFM.cpp, src/TFM.h,
8802 src/VFReader.cpp, src/VFReader.h, src/dvisvgm.cpp, src/options.ggo,
8803 src/test-all.cpp:
8804 refactorings: extracted StreamReader class, replaced generic FileFinder
8805 support by KPSFileFinder calls
8806
8807 2007-03-08 Martin Gieseking <martin.gieseking@uos.de>
8808
8809 * src/DVIActions.h, src/DVIBBoxActions.h, src/DVIReader.cpp,
8810 src/DVIReader.h, src/DVIToSVG.cpp, src/DVIToSVGActions.cpp,
8811 src/DVIToSVGActions.h, src/Font.cpp, src/Font.h, src/FontManager.cpp,
8812 src/FontManager.h, src/KPSFileFinder.cpp, src/KPSFileFinder.h,
8813 src/Makefile, src/Makefile.am, src/Makefile.in, src/Message.cpp,
8814 src/dvisvgm.cpp, src/macros.h, src/test-all.cpp:
8815 first unstable version with redesigned font handling
8816
8817 * COPYING, Makefile, Makefile.am, Makefile.in, Martins_svg_neu.svg, NEWS,
8818 aclocal.m4, cmdline.c, config.guess, config.h, config.h.in,
8819 config.status, config.sub, configure.ac, depcomp, doc/Makefile,
8820 doc/dvisvgm.1, doc/dvisvgm.1.in, gpl.txt, install-sh, missing,
8821 src/FontManager.cpp, src/FontManager.h, src/Makefile.am,
8822 src/VFReader.cpp, src/tests/FontManagerTest.h, stamp-h1, table.txt:
8823 removed some garbage from the repository, added initial FontManagerTest
8824
8825 * doc/dvisvgm.1, src/FontEngine.h, src/dvisvgm.cpp,
8826 src/tests/FontManagerTest.h:
8827 minor changes
8828
8829 * src/DVIBBoxReader.cpp, src/DVIBBoxReader.h, src/Font.cpp, src/Font.h,
8830 src/StreamCounter.h, src/dvisvgm.cpp:
8831 fixed memory bug
8832
8833 * src/DVIReader.cpp, src/DVIToSVGActions.cpp, src/Font.h, src/Makefile,
8834 src/Makefile.am, src/Makefile.in, src/VFActions.h, src/VFReader.cpp,
8835 src/VFReader.h, src/dvisvgm.cpp:
8836 plugged VFReader and its actions into the code (not usable yet)
8837
8838 2007-03-07 Martin Gieseking <martin.gieseking@uos.de>
8839
8840 * src/Font.cpp, src/Font.h:
8841 added Font classes (not yet error-free)
8842
8843 2007-03-06 Martin Gieseking <martin.gieseking@uos.de>
8844
8845 * src/DVIReader.h, src/DVIToSVG.cpp, src/FontManager.cpp,
8846 src/FontManager.h:
8847 added FontManager skeleton, fixed bug in makehead
8848
8849 2007-03-03 Martin Gieseking <martin.gieseking@uos.de>
8850
8851 * src/DVIReader.cpp, src/FontManager.cpp, src/VFReader.cpp:
8852 added some more skeleton code
8853
8854 2007-03-02 Martin Gieseking <martin.gieseking@uos.de>
8855
8856 * src/DVIReader.cpp, src/Makefile, src/Makefile.in, src/VFReader.cpp,
8857 src/VFReader.h, src/options.ggo:
8858 added skeleton of VFReader
8859
8860 2007-01-10 Martin Gieseking <martin.gieseking@uos.de>
8861
8862 * src/Bitmap.cpp, src/Bitmap.h, src/BoundingBox.cpp, src/BoundingBox.h,
8863 src/Calculator.cpp, src/Calculator.h, src/CharmapTranslator.cpp,
8864 src/CharmapTranslator.h, src/DVIActions.h, src/DVIBBoxActions.h,
8865 src/DVIBBoxReader.cpp, src/DVIBBoxReader.h, src/DVIReader.cpp,
8866 src/DVIReader.h, src/DVIToSVG.cpp, src/DVIToSVG.h,
8867 src/DVIToSVGActions.cpp, src/DVIToSVGActions.h, src/FileFinder.cpp,
8868 src/FileFinder.h, src/FileSystem.cpp, src/FileSystem.h,
8869 src/FontEmitter.h, src/FontEngine.cpp, src/FontEngine.h,
8870 src/FontGlyph.cpp, src/FontGlyph.h, src/FontMap.cpp, src/FontMap.h,
8871 src/GFReader.cpp, src/GFReader.h, src/GFTracer.cpp, src/GFTracer.h,
8872 src/KPSFileFinder.cpp, src/KPSFileFinder.h, src/Makefile,
8873 src/Makefile.am, src/Makefile.in, src/Matrix.cpp, src/Matrix.h,
8874 src/Message.cpp, src/Message.h, src/MessageException.h,
8875 src/MetafontWrapper.cpp, src/MetafontWrapper.h, src/PSInterpreter.cpp,
8876 src/PSInterpreter.h, src/PageSize.cpp, src/PageSize.h, src/Pair.h,
8877 src/SVGFontEmitter.cpp, src/SVGFontEmitter.h,
8878 src/SVGFontTraceEmitter.cpp, src/SVGFontTraceEmitter.h,
8879 src/StreamCounter.h, src/TFM.cpp, src/TFM.h,
8880 src/TransformationMatrix.cpp, src/TransformationMatrix.h,
8881 src/XMLDocTypeNode.h, src/XMLDocument.cpp, src/XMLDocument.h,
8882 src/XMLNode.cpp, src/XMLNode.h, src/XMLString.cpp, src/XMLString.h,
8883 src/cmdline.c, src/cmdline.h, src/dvisvgm.cpp, src/getopt.c,
8884 src/getopt.h, src/getopt1.c, src/gzstream.cpp, src/gzstream.h,
8885 src/macros.h, src/miktex-core.def, src/miktex-kps.def, src/miktex-kps.h,
8886 src/options.ggo, src/test-all.cpp, src/tests/CalculatorTest.h,
8887 src/tests/PageSizeTest.h, src/tests/StreamCounterTest.h, src/types.h:
8888 moved dir
8889
8890 * INSTALL, Makefile.am, NEWS, README, configure.ac, doc/Makefile,
8891 doc/Makefile.am, doc/Makefile.in, doc/dvisvgm.1, doc/dvisvgm.1.in,
8892 gzstream/COPYING.LIB, gzstream/Makefile, gzstream/README,
8893 gzstream/gzstream.cpp, gzstream/gzstream.h, gzstream/index.html,
8894 gzstream/logo.gif, gzstream/test_gunzip.C, gzstream/test_gzip.C,
8895 gzstream/version, map/cork-lm.map, potracelib/Makefile.am,
8896 potracelib/auxiliary.h, potracelib/bitmap.h, potracelib/curve.c,
8897 potracelib/curve.h, potracelib/decompose.c, potracelib/decompose.h,
8898 potracelib/lists.h, potracelib/potracelib.c, potracelib/potracelib.h,
8899 potracelib/progress.h, potracelib/trace.c, potracelib/trace.h:
8900 moved sources
8901
8902 * src/cmdline.c, src/cmdline.h:
8903 remove unnecessary files
8904
8905 2007-01-09 Martin Gieseking <martin.gieseking@uos.de>
8906
8907 * INSTALL, Makefile.am, NEWS, README, configure.ac, doc/Makefile,
8908 doc/Makefile.am, doc/Makefile.in, doc/dvisvgm.1, doc/dvisvgm.1.in,
8909 gzstream/COPYING.LIB, gzstream/Makefile, gzstream/README,
8910 gzstream/gzstream.cpp, gzstream/gzstream.h, gzstream/index.html,
8911 gzstream/logo.gif, gzstream/test_gunzip.C, gzstream/test_gzip.C,
8912 gzstream/version, potracelib/Makefile.am, potracelib/auxiliary.h,
8913 potracelib/bitmap.h, potracelib/curve.c, potracelib/curve.h,
8914 potracelib/decompose.c, potracelib/decompose.h, potracelib/lists.h,
8915 potracelib/potracelib.c, potracelib/potracelib.h, potracelib/progress.h,
8916 potracelib/trace.c, potracelib/trace.h, src/Bitmap.cpp, src/Bitmap.h,
8917 src/BoundingBox.cpp, src/BoundingBox.h, src/Calculator.cpp,
8918 src/Calculator.h, src/CharmapTranslator.cpp, src/CharmapTranslator.h,
8919 src/DVIActions.h, src/DVIBBoxActions.h, src/DVIBBoxReader.cpp,
8920 src/DVIBBoxReader.h, src/DVIReader.cpp, src/DVIReader.h,
8921 src/DVIToSVG.cpp, src/DVIToSVG.h, src/DVIToSVGActions.cpp,
8922 src/DVIToSVGActions.h, src/FileFinder.cpp, src/FileFinder.h,
8923 src/FileSystem.cpp, src/FileSystem.h, src/FontEmitter.h,
8924 src/FontEngine.cpp, src/FontEngine.h, src/FontGlyph.cpp, src/FontGlyph.h,
8925 src/FontMap.cpp, src/FontMap.h, src/GFReader.cpp, src/GFReader.h,
8926 src/GFTracer.cpp, src/GFTracer.h, src/KPSFileFinder.cpp,
8927 src/KPSFileFinder.h, src/Makefile, src/Makefile.am, src/Makefile.in,
8928 src/Matrix.cpp, src/Matrix.h, src/Message.cpp, src/Message.h,
8929 src/MessageException.h, src/MetafontWrapper.cpp, src/MetafontWrapper.h,
8930 src/PSInterpreter.cpp, src/PSInterpreter.h, src/PageSize.cpp,
8931 src/PageSize.h, src/Pair.h, src/SVGFontEmitter.cpp, src/SVGFontEmitter.h,
8932 src/SVGFontTraceEmitter.cpp, src/SVGFontTraceEmitter.h,
8933 src/StreamCounter.h, src/TFM.cpp, src/TFM.h,
8934 src/TransformationMatrix.cpp, src/TransformationMatrix.h,
8935 src/XMLDocTypeNode.h, src/XMLDocument.cpp, src/XMLDocument.h,
8936 src/XMLNode.cpp, src/XMLNode.h, src/XMLString.cpp, src/XMLString.h,
8937 src/cmdline.c, src/cmdline.h, src/dvisvgm.cpp, src/getopt.c,
8938 src/getopt.h, src/getopt1.c, src/gzstream.cpp, src/gzstream.h,
8939 src/macros.h, src/miktex-core.def, src/miktex-kps.def, src/miktex-kps.h,
8940 src/options.ggo, src/test-all.cpp, src/tests/CalculatorTest.h,
8941 src/tests/PageSizeTest.h, src/tests/StreamCounterTest.h, src/types.h:
8942 moved files to trunk subfolder
8943
8944 * map/cork-lm.map:
8945 moved files to trunk
8946
8947 2007-01-05 Martin Gieseking <martin.gieseking@uos.de>
8948
8949 * Makefile, Makefile.am, Makefile.in, README, config.status, configure.ac,
8950 potracelib/Makefile.am, potracelib/bitops.h, potracelib/flate.c,
8951 potracelib/flate.h, src/Bitmap.cpp, src/Bitmap.h, src/BoundingBox.cpp,
8952 src/BoundingBox.h, src/Calculator.cpp, src/Calculator.h,
8953 src/CharmapTranslator.cpp, src/CharmapTranslator.h, src/DVIActions.h,
8954 src/DVIBBoxActions.h, src/DVIBBoxReader.cpp, src/DVIBBoxReader.h,
8955 src/DVIReader.cpp, src/DVIReader.h, src/DVIToSVG.cpp, src/DVIToSVG.h,
8956 src/DVIToSVGActions.cpp, src/DVIToSVGActions.h, src/FileFinder.cpp,
8957 src/FileFinder.h, src/FileSystem.cpp, src/FileSystem.h,
8958 src/FontEmitter.h, src/FontEngine.cpp, src/FontEngine.h,
8959 src/FontGlyph.cpp, src/FontGlyph.h, src/FontMap.cpp, src/FontMap.h,
8960 src/GFReader.cpp, src/GFReader.h, src/GFTracer.cpp, src/GFTracer.h,
8961 src/KPSFileFinder.cpp, src/KPSFileFinder.h, src/Makefile.am,
8962 src/Matrix.cpp, src/Matrix.h, src/Message.cpp, src/Message.h,
8963 src/MessageException.h, src/MetafontWrapper.cpp, src/MetafontWrapper.h,
8964 src/PSInterpreter.cpp, src/PSInterpreter.h, src/PageSize.cpp,
8965 src/PageSize.h, src/Pair.h, src/SVGFontEmitter.cpp, src/SVGFontEmitter.h,
8966 src/SVGFontTraceEmitter.cpp, src/SVGFontTraceEmitter.h,
8967 src/StreamCounter.h, src/TFM.cpp, src/TFM.h,
8968 src/TransformationMatrix.cpp, src/TransformationMatrix.h,
8969 src/XMLDocTypeNode.h, src/XMLDocument.cpp, src/XMLDocument.h,
8970 src/XMLNode.cpp, src/XMLNode.h, src/XMLString.cpp, src/XMLString.h,
8971 src/dvisvgm.cpp, src/macros.h, src/test-all.cpp, src/types.h:
8972 minor modifications
8973
8974 2007-01-03 Martin Gieseking <martin.gieseking@uos.de>
8975
8976 * NEWS, src/KPSFileFinder.cpp:
8977 updated homepage
8978
8979 * Makefile, Makefile.am, Makefile.in, config.h, config.h.in,
8980 config.status, configure, configure.ac, doc/Makefile,
8981 potracelib/Makefile.am, potracelib/auxiliary.h, potracelib/bitmap.h,
8982 potracelib/bitops.h, potracelib/curve.c, potracelib/curve.h,
8983 potracelib/decompose.c, potracelib/decompose.h, potracelib/flate.c,
8984 potracelib/flate.h, potracelib/lists.h, potracelib/potracelib.c,
8985 potracelib/potracelib.h, potracelib/progress.h, potracelib/trace.c,
8986 potracelib/trace.h, src/Makefile, src/Makefile.am, src/Makefile.in:
8987 added potracelib to distribution
8988
8989 * configure:
8990 removed configure from repository
8991
8992 2006-12-31 Martin Gieseking <martin.gieseking@uos.de>
8993
8994 * NEWS, configure.ac, src/DVIToSVG.cpp, src/FileSystem.cpp,
8995 src/FontEngine.cpp, src/GFTracer.cpp, src/KPSFileFinder.cpp,
8996 src/Matrix.h, src/Message.cpp, src/PageSize.cpp,
8997 src/TransformationMatrix.cpp, src/dvisvgm.cpp:
8998 updated to MikTeX 2.5 support
8999
9000 * Makefile, config.status, configure, configure.ac, doc/Makefile,
9001 doc/dvisvgm.1, src/FileSystem.cpp, src/FontEngine.cpp,
9002 src/KPSFileFinder.cpp, src/Makefile, src/dvisvgm.cpp, src/test-all.cpp:
9003 some minor fixes
9004
9005 * src/KPSFileFinder.cpp:
9006 fixed namepsace bug
9007
9008 2006-08-01 Martin Gieseking <martin.gieseking@uos.de>
9009
9010 * Makefile, Makefile.in, NEWS, aclocal.m4, autom4te.cache/output.0,
9011 autom4te.cache/requests, autom4te.cache/traces.0, config.h, config.log,
9012 config.status, configure, configure.ac, doc/Makefile, doc/Makefile.in,
9013 doc/dvisvgm.1, src/FontEngine.cpp, src/Makefile, src/Makefile.in,
9014 src/cmdline.c, src/cmdline.h, src/dvisvgm.cpp:
9015 added support for freetype version >= 2.1.1
9016
9017 * configure.ac:
9018 enabled svn keyword expansion
9019
9020 2006-04-12 Martin Gieseking <martin.gieseking@uos.de>
9021
9022 * COPYING, INSTALL, Makefile, Makefile.am, Makefile.in,
9023 Martins_svg_neu.svg, NEWS, README, aclocal.m4, autom4te.cache/output.0,
9024 autom4te.cache/requests, autom4te.cache/traces.0, cmdline.c,
9025 config.guess, config.h, config.h.in, config.log, config.status,
9026 config.sub, configure, configure.ac, depcomp, doc/Makefile,
9027 doc/Makefile.am, doc/Makefile.in, doc/dvisvgm.1, doc/dvisvgm.1.in,
9028 gpl.txt, gzstream/COPYING.LIB, gzstream/Makefile, gzstream/README,
9029 gzstream/gzstream.cpp, gzstream/gzstream.h, gzstream/index.html,
9030 gzstream/logo.gif, gzstream/test_gunzip.C, gzstream/test_gzip.C,
9031 gzstream/version, install-sh, map/cork-lm.map, missing, src/Bitmap.cpp,
9032 src/Bitmap.h, src/BoundingBox.cpp, src/BoundingBox.h, src/Calculator.cpp,
9033 src/Calculator.h, src/CharmapTranslator.cpp, src/CharmapTranslator.h,
9034 src/DVIActions.h, src/DVIBBoxActions.h, src/DVIBBoxReader.cpp,
9035 src/DVIBBoxReader.h, src/DVIReader.cpp, src/DVIReader.h,
9036 src/DVIToSVG.cpp, src/DVIToSVG.h, src/DVIToSVGActions.cpp,
9037 src/DVIToSVGActions.h, src/FileFinder.cpp, src/FileFinder.h,
9038 src/FileSystem.cpp, src/FileSystem.h, src/FontEmitter.h,
9039 src/FontEngine.cpp, src/FontEngine.h, src/FontGlyph.cpp, src/FontGlyph.h,
9040 src/FontMap.cpp, src/FontMap.h, src/GFReader.cpp, src/GFReader.h,
9041 src/GFTracer.cpp, src/GFTracer.h, src/KPSFileFinder.cpp,
9042 src/KPSFileFinder.h, src/Makefile, src/Makefile.am, src/Makefile.in,
9043 src/Matrix.cpp, src/Matrix.h, src/Message.cpp, src/Message.h,
9044 src/MessageException.h, src/MetafontWrapper.cpp, src/MetafontWrapper.h,
9045 src/PSInterpreter.cpp, src/PSInterpreter.h, src/PageSize.cpp,
9046 src/PageSize.h, src/Pair.h, src/SVGFontEmitter.cpp, src/SVGFontEmitter.h,
9047 src/SVGFontTraceEmitter.cpp, src/SVGFontTraceEmitter.h,
9048 src/StreamCounter.h, src/TFM.cpp, src/TFM.h,
9049 src/TransformationMatrix.cpp, src/TransformationMatrix.h,
9050 src/XMLDocTypeNode.h, src/XMLDocument.cpp, src/XMLDocument.h,
9051 src/XMLNode.cpp, src/XMLNode.h, src/XMLString.cpp, src/XMLString.h,
9052 src/cmdline.c, src/cmdline.h, src/dvisvgm.cpp, src/getopt.c,
9053 src/getopt.h, src/getopt1.c, src/gzstream.cpp, src/gzstream.h,
9054 src/lshort-cm.dvi, src/lshort-cm.svg, src/lshort-cm.svgz, src/lshort.dvi,
9055 src/lshort.svg, src/lshort.svgz, src/macros.h, src/miktex-core.def,
9056 src/miktex-kps.def, src/miktex-kps.h, src/options.ggo, src/test-all.cpp,
9057 src/tests/CalculatorTest.h, src/tests/PageSizeTest.h,
9058 src/tests/StreamCounterTest.h, src/types.h, stamp-h1, table.txt:
9059 initial import
9060
9061 * src/Bitmap.cpp, src/Bitmap.h, src/BoundingBox.cpp, src/BoundingBox.h,
9062 src/Calculator.cpp, src/Calculator.h, src/CharmapTranslator.cpp,
9063 src/CharmapTranslator.h, src/DVIActions.h, src/DVIBBoxActions.h,
9064 src/DVIBBoxReader.cpp, src/DVIBBoxReader.h, src/DVIReader.cpp,
9065 src/DVIReader.h, src/DVIToSVG.cpp, src/DVIToSVG.h,
9066 src/DVIToSVGActions.cpp, src/DVIToSVGActions.h, src/FileFinder.cpp,
9067 src/FileFinder.h, src/FileSystem.cpp, src/FileSystem.h,
9068 src/FontEmitter.h, src/FontEngine.cpp, src/FontEngine.h,
9069 src/FontGlyph.cpp, src/FontGlyph.h, src/FontMap.cpp, src/FontMap.h,
9070 src/GFReader.cpp, src/GFReader.h, src/GFTracer.cpp, src/GFTracer.h,
9071 src/KPSFileFinder.cpp, src/KPSFileFinder.h, src/Message.cpp,
9072 src/Message.h, src/MessageException.h, src/MetafontWrapper.cpp,
9073 src/MetafontWrapper.h, src/PageSize.cpp, src/PageSize.h, src/Pair.h,
9074 src/SVGFontEmitter.cpp, src/SVGFontEmitter.h,
9075 src/SVGFontTraceEmitter.cpp, src/SVGFontTraceEmitter.h,
9076 src/StreamCounter.h, src/TFM.cpp, src/TFM.h,
9077 src/TransformationMatrix.cpp, src/TransformationMatrix.h,
9078 src/XMLDocTypeNode.h, src/XMLDocument.cpp, src/XMLDocument.h,
9079 src/XMLNode.cpp, src/XMLNode.h, src/XMLString.cpp, src/XMLString.h,
9080 src/dvisvgm.cpp, src/macros.h, src/test-all.cpp,
9081 src/tests/CalculatorTest.h, src/tests/PageSizeTest.h,
9082 src/tests/StreamCounterTest.h, src/types.h:
9083 changed keyword tags
9084
9085 * src/lshort-cm.dvi, src/lshort-cm.svg, src/lshort-cm.svgz,
9086 src/lshort.dvi, src/lshort.svg, src/lshort.svgz:
9087 removed files that need not be version controlled
9088
8989 target_triplet = @target@
9090 subdir = .
9191 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
92 am__aclocal_m4_deps = $(top_srcdir)/configure.ac
92 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_compile_flag.m4 \
93 $(top_srcdir)/m4/ax_code_coverage.m4 \
94 $(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \
95 $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
96 $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
97 $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac
9398 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
9499 $(ACLOCAL_M4)
95100 DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \
158163 CSCOPE = cscope
159164 DIST_SUBDIRS = $(SUBDIRS)
160165 am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in AUTHORS \
161 COPYING INSTALL NEWS README ar-lib compile config.guess \
162 config.sub install-sh ltmain.sh missing
166 COPYING ChangeLog INSTALL NEWS README ar-lib compile \
167 config.guess config.sub depcomp install-sh ltmain.sh missing
163168 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
164169 distdir = $(PACKAGE)-$(VERSION)
165170 top_distdir = $(distdir)
0 dvisvgm-2.8 (2019-10-25)
1 - added support for JPEG, PNG, PDF, and SVG files to special 'psfile'
2 - added support for Ghostscript 9.50
3 - added support for elliptical arc segments in graphics paths
4 - added support for CMap operator 'begincidchar' (patch by Akira Kakuto)
5 - added suport for experimental 128-bit XXH3 hashes
6 - extended optimizer module 'simplify-transform' to incorporate translation and
7 scaling components into positional and size attributes
8 - replaced CRC32 checksums used in cache files with XXH32 hashes
9 - updated potrace to version 1.16
10 - updated xxHash to version 2.7.2
11 - updated gtest to 1.10
12 - lots of code refactorings
13
14 dvisvgm-2.7.4 (2019-07-28)
15 - fixed memory issue occurred when calling Metafont
16 - fixed rounding issue in color conversion (GH #116)
17 - changed location of cache files from ~/.dvisvgm/cache to
18 $XDG_CACHE_HOME/dvisvgm which usually expands to ~/.cache/dvisvgm (GH #112)
19 - some minor refactorings
20
21 dvisvgm-2.7.3 (2019-07-12)
22 - fixed randomly missing glyph paths referenced by 'use' elements (GH #110)
23 - minor update of the man page
24 - some code refactorings
25
026 dvisvgm-2.7.2 (2019-06-07)
127 - adapted PostScript handler to incompatible changes introduced with
228 Ghostscript 9.27 (removal of GS_PDF_ProcSet and pdfdict)
15361536 AC_SUBST([am__untar])
15371537 ]) # _AM_PROG_TAR
15381538
1539 # ===========================================================================
1540 # https://www.gnu.org/software/autoconf-archive/ax_check_compile_flag.html
1541 # ===========================================================================
1542 #
1543 # SYNOPSIS
1544 #
1545 # AX_CHECK_COMPILE_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS], [INPUT])
1546 #
1547 # DESCRIPTION
1548 #
1549 # Check whether the given FLAG works with the current language's compiler
1550 # or gives an error. (Warnings, however, are ignored)
1551 #
1552 # ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
1553 # success/failure.
1554 #
1555 # If EXTRA-FLAGS is defined, it is added to the current language's default
1556 # flags (e.g. CFLAGS) when the check is done. The check is thus made with
1557 # the flags: "CFLAGS EXTRA-FLAGS FLAG". This can for example be used to
1558 # force the compiler to issue an error when a bad flag is given.
1559 #
1560 # INPUT gives an alternative input source to AC_COMPILE_IFELSE.
1561 #
1562 # NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this
1563 # macro in sync with AX_CHECK_{PREPROC,LINK}_FLAG.
1564 #
1565 # LICENSE
1566 #
1567 # Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
1568 # Copyright (c) 2011 Maarten Bosmans <mkbosmans@gmail.com>
1569 #
1570 # Copying and distribution of this file, with or without modification, are
1571 # permitted in any medium without royalty provided the copyright notice
1572 # and this notice are preserved. This file is offered as-is, without any
1573 # warranty.
1574
1575 #serial 6
1576
1577 AC_DEFUN([AX_CHECK_COMPILE_FLAG],
1578 [AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_IF
1579 AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_[]_AC_LANG_ABBREV[]flags_$4_$1])dnl
1580 AC_CACHE_CHECK([whether _AC_LANG compiler accepts $1], CACHEVAR, [
1581 ax_check_save_flags=$[]_AC_LANG_PREFIX[]FLAGS
1582 _AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $4 $1"
1583 AC_COMPILE_IFELSE([m4_default([$5],[AC_LANG_PROGRAM()])],
1584 [AS_VAR_SET(CACHEVAR,[yes])],
1585 [AS_VAR_SET(CACHEVAR,[no])])
1586 _AC_LANG_PREFIX[]FLAGS=$ax_check_save_flags])
1587 AS_VAR_IF(CACHEVAR,yes,
1588 [m4_default([$2], :)],
1589 [m4_default([$3], :)])
1590 AS_VAR_POPDEF([CACHEVAR])dnl
1591 ])dnl AX_CHECK_COMPILE_FLAGS
1592
1593
1594 # ===========================================================================
1595 # https://www.gnu.org/software/autoconf-archive/ax_code_coverage.html
1596 # ===========================================================================
1597 #
1598 # SYNOPSIS
1599 #
1600 # AX_CODE_COVERAGE()
1601 #
1602 # DESCRIPTION
1603 #
1604 # Defines CODE_COVERAGE_CPPFLAGS, CODE_COVERAGE_CFLAGS,
1605 # CODE_COVERAGE_CXXFLAGS and CODE_COVERAGE_LIBS which should be included
1606 # in the CPPFLAGS, CFLAGS CXXFLAGS and LIBS/LIBADD variables of every
1607 # build target (program or library) which should be built with code
1608 # coverage support. Also defines CODE_COVERAGE_RULES which should be
1609 # substituted in your Makefile; and $enable_code_coverage which can be
1610 # used in subsequent configure output. CODE_COVERAGE_ENABLED is defined
1611 # and substituted, and corresponds to the value of the
1612 # --enable-code-coverage option, which defaults to being disabled.
1613 #
1614 # Test also for gcov program and create GCOV variable that could be
1615 # substituted.
1616 #
1617 # Note that all optimization flags in CFLAGS must be disabled when code
1618 # coverage is enabled.
1619 #
1620 # Usage example:
1621 #
1622 # configure.ac:
1623 #
1624 # AX_CODE_COVERAGE
1625 #
1626 # Makefile.am:
1627 #
1628 # @CODE_COVERAGE_RULES@
1629 # my_program_LIBS = ... $(CODE_COVERAGE_LIBS) ...
1630 # my_program_CPPFLAGS = ... $(CODE_COVERAGE_CPPFLAGS) ...
1631 # my_program_CFLAGS = ... $(CODE_COVERAGE_CFLAGS) ...
1632 # my_program_CXXFLAGS = ... $(CODE_COVERAGE_CXXFLAGS) ...
1633 #
1634 # This results in a "check-code-coverage" rule being added to any
1635 # Makefile.am which includes "@CODE_COVERAGE_RULES@" (assuming the module
1636 # has been configured with --enable-code-coverage). Running `make
1637 # check-code-coverage` in that directory will run the module's test suite
1638 # (`make check`) and build a code coverage report detailing the code which
1639 # was touched, then print the URI for the report.
1640 #
1641 # In earlier versions of this macro, CODE_COVERAGE_LDFLAGS was defined
1642 # instead of CODE_COVERAGE_LIBS. They are both still defined, but use of
1643 # CODE_COVERAGE_LIBS is preferred for clarity; CODE_COVERAGE_LDFLAGS is
1644 # deprecated. They have the same value.
1645 #
1646 # This code was derived from Makefile.decl in GLib, originally licenced
1647 # under LGPLv2.1+.
1648 #
1649 # LICENSE
1650 #
1651 # Copyright (c) 2012, 2016 Philip Withnall
1652 # Copyright (c) 2012 Xan Lopez
1653 # Copyright (c) 2012 Christian Persch
1654 # Copyright (c) 2012 Paolo Borelli
1655 # Copyright (c) 2012 Dan Winship
1656 # Copyright (c) 2015 Bastien ROUCARIES
1657 #
1658 # This library is free software; you can redistribute it and/or modify it
1659 # under the terms of the GNU Lesser General Public License as published by
1660 # the Free Software Foundation; either version 2.1 of the License, or (at
1661 # your option) any later version.
1662 #
1663 # This library is distributed in the hope that it will be useful, but
1664 # WITHOUT ANY WARRANTY; without even the implied warranty of
1665 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
1666 # General Public License for more details.
1667 #
1668 # You should have received a copy of the GNU Lesser General Public License
1669 # along with this program. If not, see <https://www.gnu.org/licenses/>.
1670
1671 #serial 25
1672
1673 AC_DEFUN([AX_CODE_COVERAGE],[
1674 dnl Check for --enable-code-coverage
1675 AC_REQUIRE([AC_PROG_SED])
1676
1677 # allow to override gcov location
1678 AC_ARG_WITH([gcov],
1679 [AS_HELP_STRING([--with-gcov[=GCOV]], [use given GCOV for coverage (GCOV=gcov).])],
1680 [_AX_CODE_COVERAGE_GCOV_PROG_WITH=$with_gcov],
1681 [_AX_CODE_COVERAGE_GCOV_PROG_WITH=gcov])
1682
1683 AC_MSG_CHECKING([whether to build with code coverage support])
1684 AC_ARG_ENABLE([code-coverage],
1685 AS_HELP_STRING([--enable-code-coverage],
1686 [Whether to enable code coverage support]),,
1687 enable_code_coverage=no)
1688
1689 AM_CONDITIONAL([CODE_COVERAGE_ENABLED], [test x$enable_code_coverage = xyes])
1690 AC_SUBST([CODE_COVERAGE_ENABLED], [$enable_code_coverage])
1691 AC_MSG_RESULT($enable_code_coverage)
1692
1693 AS_IF([ test "$enable_code_coverage" = "yes" ], [
1694 # check for gcov
1695 AC_CHECK_TOOL([GCOV],
1696 [$_AX_CODE_COVERAGE_GCOV_PROG_WITH],
1697 [:])
1698 AS_IF([test "X$GCOV" = "X:"],
1699 [AC_MSG_ERROR([gcov is needed to do coverage])])
1700 AC_SUBST([GCOV])
1701
1702 dnl Check if gcc is being used
1703 AS_IF([ test "$GCC" = "no" ], [
1704 AC_MSG_ERROR([not compiling with gcc, which is required for gcov code coverage])
1705 ])
1706
1707 AC_CHECK_PROG([LCOV], [lcov], [lcov])
1708 AC_CHECK_PROG([GENHTML], [genhtml], [genhtml])
1709
1710 AS_IF([ test -z "$LCOV" ], [
1711 AC_MSG_ERROR([To enable code coverage reporting you must have lcov installed])
1712 ])
1713
1714 AS_IF([ test -z "$GENHTML" ], [
1715 AC_MSG_ERROR([Could not find genhtml from the lcov package])
1716 ])
1717
1718 dnl Build the code coverage flags
1719 dnl Define CODE_COVERAGE_LDFLAGS for backwards compatibility
1720 CODE_COVERAGE_CPPFLAGS="-DNDEBUG"
1721 CODE_COVERAGE_CFLAGS="-O0 -g -fprofile-arcs -ftest-coverage"
1722 CODE_COVERAGE_CXXFLAGS="-O0 -g -fprofile-arcs -ftest-coverage"
1723 CODE_COVERAGE_LIBS="-lgcov"
1724 CODE_COVERAGE_LDFLAGS="$CODE_COVERAGE_LIBS"
1725
1726 AC_SUBST([CODE_COVERAGE_CPPFLAGS])
1727 AC_SUBST([CODE_COVERAGE_CFLAGS])
1728 AC_SUBST([CODE_COVERAGE_CXXFLAGS])
1729 AC_SUBST([CODE_COVERAGE_LIBS])
1730 AC_SUBST([CODE_COVERAGE_LDFLAGS])
1731
1732 [CODE_COVERAGE_RULES_CHECK='
1733 -$(A''M_V_at)$(MAKE) $(AM_MAKEFLAGS) -k check
1734 $(A''M_V_at)$(MAKE) $(AM_MAKEFLAGS) code-coverage-capture
1735 ']
1736 [CODE_COVERAGE_RULES_CAPTURE='
1737 $(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)
1738 $(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)
1739 -@rm -f $(CODE_COVERAGE_OUTPUT_FILE).tmp
1740 $(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)
1741 @echo "file://$(abs_builddir)/$(CODE_COVERAGE_OUTPUT_DIRECTORY)/index.html"
1742 ']
1743 [CODE_COVERAGE_RULES_CLEAN='
1744 clean: code-coverage-clean
1745 distclean: code-coverage-clean
1746 code-coverage-clean:
1747 -$(LCOV) --directory $(top_builddir) -z
1748 -rm -rf $(CODE_COVERAGE_OUTPUT_FILE) $(CODE_COVERAGE_OUTPUT_FILE).tmp $(CODE_COVERAGE_OUTPUT_DIRECTORY)
1749 -find . \( -name "*.gcda" -o -name "*.gcno" -o -name "*.gcov" \) -delete
1750 ']
1751 ], [
1752 [CODE_COVERAGE_RULES_CHECK='
1753 @echo "Need to reconfigure with --enable-code-coverage"
1754 ']
1755 CODE_COVERAGE_RULES_CAPTURE="$CODE_COVERAGE_RULES_CHECK"
1756 CODE_COVERAGE_RULES_CLEAN=''
1757 ])
1758
1759 [CODE_COVERAGE_RULES='
1760 # Code coverage
1761 #
1762 # Optional:
1763 # - CODE_COVERAGE_DIRECTORY: Top-level directory for code coverage reporting.
1764 # Multiple directories may be specified, separated by whitespace.
1765 # (Default: $(top_builddir))
1766 # - CODE_COVERAGE_OUTPUT_FILE: Filename and path for the .info file generated
1767 # by lcov for code coverage. (Default:
1768 # $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage.info)
1769 # - CODE_COVERAGE_OUTPUT_DIRECTORY: Directory for generated code coverage
1770 # reports to be created. (Default:
1771 # $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage)
1772 # - CODE_COVERAGE_BRANCH_COVERAGE: Set to 1 to enforce branch coverage,
1773 # set to 0 to disable it and leave empty to stay with the default.
1774 # (Default: empty)
1775 # - CODE_COVERAGE_LCOV_SHOPTS_DEFAULT: Extra options shared between both lcov
1776 # instances. (Default: based on $CODE_COVERAGE_BRANCH_COVERAGE)
1777 # - CODE_COVERAGE_LCOV_SHOPTS: Extra options to shared between both lcov
1778 # instances. (Default: $CODE_COVERAGE_LCOV_SHOPTS_DEFAULT)
1779 # - CODE_COVERAGE_LCOV_OPTIONS_GCOVPATH: --gcov-tool pathtogcov
1780 # - CODE_COVERAGE_LCOV_OPTIONS_DEFAULT: Extra options to pass to the
1781 # collecting lcov instance. (Default: $CODE_COVERAGE_LCOV_OPTIONS_GCOVPATH)
1782 # - CODE_COVERAGE_LCOV_OPTIONS: Extra options to pass to the collecting lcov
1783 # instance. (Default: $CODE_COVERAGE_LCOV_OPTIONS_DEFAULT)
1784 # - CODE_COVERAGE_LCOV_RMOPTS_DEFAULT: Extra options to pass to the filtering
1785 # lcov instance. (Default: empty)
1786 # - CODE_COVERAGE_LCOV_RMOPTS: Extra options to pass to the filtering lcov
1787 # instance. (Default: $CODE_COVERAGE_LCOV_RMOPTS_DEFAULT)
1788 # - CODE_COVERAGE_GENHTML_OPTIONS_DEFAULT: Extra options to pass to the
1789 # genhtml instance. (Default: based on $CODE_COVERAGE_BRANCH_COVERAGE)
1790 # - CODE_COVERAGE_GENHTML_OPTIONS: Extra options to pass to the genhtml
1791 # instance. (Default: $CODE_COVERAGE_GENHTML_OPTIONS_DEFAULT)
1792 # - CODE_COVERAGE_IGNORE_PATTERN: Extra glob pattern of files to ignore
1793 #
1794 # The generated report will be titled using the $(PACKAGE_NAME) and
1795 # $(PACKAGE_VERSION). In order to add the current git hash to the title,
1796 # use the git-version-gen script, available online.
1797
1798 # Optional variables
1799 CODE_COVERAGE_DIRECTORY ?= $(top_builddir)
1800 CODE_COVERAGE_OUTPUT_FILE ?= $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage.info
1801 CODE_COVERAGE_OUTPUT_DIRECTORY ?= $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage
1802 CODE_COVERAGE_BRANCH_COVERAGE ?=
1803 CODE_COVERAGE_LCOV_SHOPTS_DEFAULT ?= $(if $(CODE_COVERAGE_BRANCH_COVERAGE),\
1804 --rc lcov_branch_coverage=$(CODE_COVERAGE_BRANCH_COVERAGE))
1805 CODE_COVERAGE_LCOV_SHOPTS ?= $(CODE_COVERAGE_LCOV_SHOPTS_DEFAULT)
1806 CODE_COVERAGE_LCOV_OPTIONS_GCOVPATH ?= --gcov-tool "$(GCOV)"
1807 CODE_COVERAGE_LCOV_OPTIONS_DEFAULT ?= $(CODE_COVERAGE_LCOV_OPTIONS_GCOVPATH)
1808 CODE_COVERAGE_LCOV_OPTIONS ?= $(CODE_COVERAGE_LCOV_OPTIONS_DEFAULT)
1809 CODE_COVERAGE_LCOV_RMOPTS_DEFAULT ?=
1810 CODE_COVERAGE_LCOV_RMOPTS ?= $(CODE_COVERAGE_LCOV_RMOPTS_DEFAULT)
1811 CODE_COVERAGE_GENHTML_OPTIONS_DEFAULT ?=\
1812 $(if $(CODE_COVERAGE_BRANCH_COVERAGE),\
1813 --rc genhtml_branch_coverage=$(CODE_COVERAGE_BRANCH_COVERAGE))
1814 CODE_COVERAGE_GENHTML_OPTIONS ?= $(CODE_COVERAGE_GENHTML_OPTIONS_DEFAULT)
1815 CODE_COVERAGE_IGNORE_PATTERN ?=
1816
1817 GITIGNOREFILES ?=
1818 GITIGNOREFILES += $(CODE_COVERAGE_OUTPUT_FILE) $(CODE_COVERAGE_OUTPUT_DIRECTORY)
1819
1820 code_coverage_v_lcov_cap = $(code_coverage_v_lcov_cap_$(V))
1821 code_coverage_v_lcov_cap_ = $(code_coverage_v_lcov_cap_$(AM_DEFAULT_VERBOSITY))
1822 code_coverage_v_lcov_cap_0 = @echo " LCOV --capture"\
1823 $(CODE_COVERAGE_OUTPUT_FILE);
1824 code_coverage_v_lcov_ign = $(code_coverage_v_lcov_ign_$(V))
1825 code_coverage_v_lcov_ign_ = $(code_coverage_v_lcov_ign_$(AM_DEFAULT_VERBOSITY))
1826 code_coverage_v_lcov_ign_0 = @echo " LCOV --remove /tmp/*"\
1827 $(CODE_COVERAGE_IGNORE_PATTERN);
1828 code_coverage_v_genhtml = $(code_coverage_v_genhtml_$(V))
1829 code_coverage_v_genhtml_ = $(code_coverage_v_genhtml_$(AM_DEFAULT_VERBOSITY))
1830 code_coverage_v_genhtml_0 = @echo " GEN " $(CODE_COVERAGE_OUTPUT_DIRECTORY);
1831 code_coverage_quiet = $(code_coverage_quiet_$(V))
1832 code_coverage_quiet_ = $(code_coverage_quiet_$(AM_DEFAULT_VERBOSITY))
1833 code_coverage_quiet_0 = --quiet
1834
1835 # sanitizes the test-name: replaces with underscores: dashes and dots
1836 code_coverage_sanitize = $(subst -,_,$(subst .,_,$(1)))
1837
1838 # Use recursive makes in order to ignore errors during check
1839 check-code-coverage:'"$CODE_COVERAGE_RULES_CHECK"'
1840
1841 # Capture code coverage data
1842 code-coverage-capture: code-coverage-capture-hook'"$CODE_COVERAGE_RULES_CAPTURE"'
1843
1844 # Hook rule executed before code-coverage-capture, overridable by the user
1845 code-coverage-capture-hook:
1846
1847 '"$CODE_COVERAGE_RULES_CLEAN"'
1848
1849 A''M_DISTCHECK_CONFIGURE_FLAGS ?=
1850 A''M_DISTCHECK_CONFIGURE_FLAGS += --disable-code-coverage
1851
1852 .PHONY: check-code-coverage code-coverage-capture code-coverage-capture-hook code-coverage-clean
1853 ']
1854
1855 AC_SUBST([CODE_COVERAGE_RULES])
1856 m4_ifdef([_AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE([CODE_COVERAGE_RULES])])
1857 ])
1858
1859 # ===========================================================================
1860 # https://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx.html
1861 # ===========================================================================
1862 #
1863 # SYNOPSIS
1864 #
1865 # AX_CXX_COMPILE_STDCXX(VERSION, [ext|noext], [mandatory|optional])
1866 #
1867 # DESCRIPTION
1868 #
1869 # Check for baseline language coverage in the compiler for the specified
1870 # version of the C++ standard. If necessary, add switches to CXX and
1871 # CXXCPP to enable support. VERSION may be '11' (for the C++11 standard)
1872 # or '14' (for the C++14 standard).
1873 #
1874 # The second argument, if specified, indicates whether you insist on an
1875 # extended mode (e.g. -std=gnu++11) or a strict conformance mode (e.g.
1876 # -std=c++11). If neither is specified, you get whatever works, with
1877 # preference for an extended mode.
1878 #
1879 # The third argument, if specified 'mandatory' or if left unspecified,
1880 # indicates that baseline support for the specified C++ standard is
1881 # required and that the macro should error out if no mode with that
1882 # support is found. If specified 'optional', then configuration proceeds
1883 # regardless, after defining HAVE_CXX${VERSION} if and only if a
1884 # supporting mode is found.
1885 #
1886 # LICENSE
1887 #
1888 # Copyright (c) 2008 Benjamin Kosnik <bkoz@redhat.com>
1889 # Copyright (c) 2012 Zack Weinberg <zackw@panix.com>
1890 # Copyright (c) 2013 Roy Stogner <roystgnr@ices.utexas.edu>
1891 # Copyright (c) 2014, 2015 Google Inc.; contributed by Alexey Sokolov <sokolov@google.com>
1892 # Copyright (c) 2015 Paul Norman <penorman@mac.com>
1893 # Copyright (c) 2015 Moritz Klammler <moritz@klammler.eu>
1894 # Copyright (c) 2016, 2018 Krzesimir Nowak <qdlacz@gmail.com>
1895 # Copyright (c) 2019 Enji Cooper <yaneurabeya@gmail.com>
1896 #
1897 # Copying and distribution of this file, with or without modification, are
1898 # permitted in any medium without royalty provided the copyright notice
1899 # and this notice are preserved. This file is offered as-is, without any
1900 # warranty.
1901
1902 #serial 11
1903
1904 dnl This macro is based on the code from the AX_CXX_COMPILE_STDCXX_11 macro
1905 dnl (serial version number 13).
1906
1907 AC_DEFUN([AX_CXX_COMPILE_STDCXX], [dnl
1908 m4_if([$1], [11], [ax_cxx_compile_alternatives="11 0x"],
1909 [$1], [14], [ax_cxx_compile_alternatives="14 1y"],
1910 [$1], [17], [ax_cxx_compile_alternatives="17 1z"],
1911 [m4_fatal([invalid first argument `$1' to AX_CXX_COMPILE_STDCXX])])dnl
1912 m4_if([$2], [], [],
1913 [$2], [ext], [],
1914 [$2], [noext], [],
1915 [m4_fatal([invalid second argument `$2' to AX_CXX_COMPILE_STDCXX])])dnl
1916 m4_if([$3], [], [ax_cxx_compile_cxx$1_required=true],
1917 [$3], [mandatory], [ax_cxx_compile_cxx$1_required=true],
1918 [$3], [optional], [ax_cxx_compile_cxx$1_required=false],
1919 [m4_fatal([invalid third argument `$3' to AX_CXX_COMPILE_STDCXX])])
1920 AC_LANG_PUSH([C++])dnl
1921 ac_success=no
1922
1923 m4_if([$2], [noext], [], [dnl
1924 if test x$ac_success = xno; then
1925 for alternative in ${ax_cxx_compile_alternatives}; do
1926 switch="-std=gnu++${alternative}"
1927 cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx$1_$switch])
1928 AC_CACHE_CHECK(whether $CXX supports C++$1 features with $switch,
1929 $cachevar,
1930 [ac_save_CXX="$CXX"
1931 CXX="$CXX $switch"
1932 AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])],
1933 [eval $cachevar=yes],
1934 [eval $cachevar=no])
1935 CXX="$ac_save_CXX"])
1936 if eval test x\$$cachevar = xyes; then
1937 CXX="$CXX $switch"
1938 if test -n "$CXXCPP" ; then
1939 CXXCPP="$CXXCPP $switch"
1940 fi
1941 ac_success=yes
1942 break
1943 fi
1944 done
1945 fi])
1946
1947 m4_if([$2], [ext], [], [dnl
1948 if test x$ac_success = xno; then
1949 dnl HP's aCC needs +std=c++11 according to:
1950 dnl http://h21007.www2.hp.com/portal/download/files/unprot/aCxx/PDF_Release_Notes/769149-001.pdf
1951 dnl Cray's crayCC needs "-h std=c++11"
1952 for alternative in ${ax_cxx_compile_alternatives}; do
1953 for switch in -std=c++${alternative} +std=c++${alternative} "-h std=c++${alternative}"; do
1954 cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx$1_$switch])
1955 AC_CACHE_CHECK(whether $CXX supports C++$1 features with $switch,
1956 $cachevar,
1957 [ac_save_CXX="$CXX"
1958 CXX="$CXX $switch"
1959 AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])],
1960 [eval $cachevar=yes],
1961 [eval $cachevar=no])
1962 CXX="$ac_save_CXX"])
1963 if eval test x\$$cachevar = xyes; then
1964 CXX="$CXX $switch"
1965 if test -n "$CXXCPP" ; then
1966 CXXCPP="$CXXCPP $switch"
1967 fi
1968 ac_success=yes
1969 break
1970 fi
1971 done
1972 if test x$ac_success = xyes; then
1973 break
1974 fi
1975 done
1976 fi])
1977 AC_LANG_POP([C++])
1978 if test x$ax_cxx_compile_cxx$1_required = xtrue; then
1979 if test x$ac_success = xno; then
1980 AC_MSG_ERROR([*** A compiler with support for C++$1 language features is required.])
1981 fi
1982 fi
1983 if test x$ac_success = xno; then
1984 HAVE_CXX$1=0
1985 AC_MSG_NOTICE([No compiler with C++$1 support was found])
1986 else
1987 HAVE_CXX$1=1
1988 AC_DEFINE(HAVE_CXX$1,1,
1989 [define if the compiler supports basic C++$1 syntax])
1990 fi
1991 AC_SUBST(HAVE_CXX$1)
1992 ])
1993
1994
1995 dnl Test body for checking C++11 support
1996
1997 m4_define([_AX_CXX_COMPILE_STDCXX_testbody_11],
1998 _AX_CXX_COMPILE_STDCXX_testbody_new_in_11
1999 )
2000
2001
2002 dnl Test body for checking C++14 support
2003
2004 m4_define([_AX_CXX_COMPILE_STDCXX_testbody_14],
2005 _AX_CXX_COMPILE_STDCXX_testbody_new_in_11
2006 _AX_CXX_COMPILE_STDCXX_testbody_new_in_14
2007 )
2008
2009 m4_define([_AX_CXX_COMPILE_STDCXX_testbody_17],
2010 _AX_CXX_COMPILE_STDCXX_testbody_new_in_11
2011 _AX_CXX_COMPILE_STDCXX_testbody_new_in_14
2012 _AX_CXX_COMPILE_STDCXX_testbody_new_in_17
2013 )
2014
2015 dnl Tests for new features in C++11
2016
2017 m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_11], [[
2018
2019 // If the compiler admits that it is not ready for C++11, why torture it?
2020 // Hopefully, this will speed up the test.
2021
2022 #ifndef __cplusplus
2023
2024 #error "This is not a C++ compiler"
2025
2026 #elif __cplusplus < 201103L
2027
2028 #error "This is not a C++11 compiler"
2029
2030 #else
2031
2032 namespace cxx11
2033 {
2034
2035 namespace test_static_assert
2036 {
2037
2038 template <typename T>
2039 struct check
2040 {
2041 static_assert(sizeof(int) <= sizeof(T), "not big enough");
2042 };
2043
2044 }
2045
2046 namespace test_final_override
2047 {
2048
2049 struct Base
2050 {
2051 virtual ~Base() {}
2052 virtual void f() {}
2053 };
2054
2055 struct Derived : public Base
2056 {
2057 virtual ~Derived() override {}
2058 virtual void f() override {}
2059 };
2060
2061 }
2062
2063 namespace test_double_right_angle_brackets
2064 {
2065
2066 template < typename T >
2067 struct check {};
2068
2069 typedef check<void> single_type;
2070 typedef check<check<void>> double_type;
2071 typedef check<check<check<void>>> triple_type;
2072 typedef check<check<check<check<void>>>> quadruple_type;
2073
2074 }
2075
2076 namespace test_decltype
2077 {
2078
2079 int
2080 f()
2081 {
2082 int a = 1;
2083 decltype(a) b = 2;
2084 return a + b;
2085 }
2086
2087 }
2088
2089 namespace test_type_deduction
2090 {
2091
2092 template < typename T1, typename T2 >
2093 struct is_same
2094 {
2095 static const bool value = false;
2096 };
2097
2098 template < typename T >
2099 struct is_same<T, T>
2100 {
2101 static const bool value = true;
2102 };
2103
2104 template < typename T1, typename T2 >
2105 auto
2106 add(T1 a1, T2 a2) -> decltype(a1 + a2)
2107 {
2108 return a1 + a2;
2109 }
2110
2111 int
2112 test(const int c, volatile int v)
2113 {
2114 static_assert(is_same<int, decltype(0)>::value == true, "");
2115 static_assert(is_same<int, decltype(c)>::value == false, "");
2116 static_assert(is_same<int, decltype(v)>::value == false, "");
2117 auto ac = c;
2118 auto av = v;
2119 auto sumi = ac + av + 'x';
2120 auto sumf = ac + av + 1.0;
2121 static_assert(is_same<int, decltype(ac)>::value == true, "");
2122 static_assert(is_same<int, decltype(av)>::value == true, "");
2123 static_assert(is_same<int, decltype(sumi)>::value == true, "");
2124 static_assert(is_same<int, decltype(sumf)>::value == false, "");
2125 static_assert(is_same<int, decltype(add(c, v))>::value == true, "");
2126 return (sumf > 0.0) ? sumi : add(c, v);
2127 }
2128
2129 }
2130
2131 namespace test_noexcept
2132 {
2133
2134 int f() { return 0; }
2135 int g() noexcept { return 0; }
2136
2137 static_assert(noexcept(f()) == false, "");
2138 static_assert(noexcept(g()) == true, "");
2139
2140 }
2141
2142 namespace test_constexpr
2143 {
2144
2145 template < typename CharT >
2146 unsigned long constexpr
2147 strlen_c_r(const CharT *const s, const unsigned long acc) noexcept
2148 {
2149 return *s ? strlen_c_r(s + 1, acc + 1) : acc;
2150 }
2151
2152 template < typename CharT >
2153 unsigned long constexpr
2154 strlen_c(const CharT *const s) noexcept
2155 {
2156 return strlen_c_r(s, 0UL);
2157 }
2158
2159 static_assert(strlen_c("") == 0UL, "");
2160 static_assert(strlen_c("1") == 1UL, "");
2161 static_assert(strlen_c("example") == 7UL, "");
2162 static_assert(strlen_c("another\0example") == 7UL, "");
2163
2164 }
2165
2166 namespace test_rvalue_references
2167 {
2168
2169 template < int N >
2170 struct answer
2171 {
2172 static constexpr int value = N;
2173 };
2174
2175 answer<1> f(int&) { return answer<1>(); }
2176 answer<2> f(const int&) { return answer<2>(); }
2177 answer<3> f(int&&) { return answer<3>(); }
2178
2179 void
2180 test()
2181 {
2182 int i = 0;
2183 const int c = 0;
2184 static_assert(decltype(f(i))::value == 1, "");
2185 static_assert(decltype(f(c))::value == 2, "");
2186 static_assert(decltype(f(0))::value == 3, "");
2187 }
2188
2189 }
2190
2191 namespace test_uniform_initialization
2192 {
2193
2194 struct test
2195 {
2196 static const int zero {};
2197 static const int one {1};
2198 };
2199
2200 static_assert(test::zero == 0, "");
2201 static_assert(test::one == 1, "");
2202
2203 }
2204
2205 namespace test_lambdas
2206 {
2207
2208 void
2209 test1()
2210 {
2211 auto lambda1 = [](){};
2212 auto lambda2 = lambda1;
2213 lambda1();
2214 lambda2();
2215 }
2216
2217 int
2218 test2()
2219 {
2220 auto a = [](int i, int j){ return i + j; }(1, 2);
2221 auto b = []() -> int { return '0'; }();
2222 auto c = [=](){ return a + b; }();
2223 auto d = [&](){ return c; }();
2224 auto e = [a, &b](int x) mutable {
2225 const auto identity = [](int y){ return y; };
2226 for (auto i = 0; i < a; ++i)
2227 a += b--;
2228 return x + identity(a + b);
2229 }(0);
2230 return a + b + c + d + e;
2231 }
2232
2233 int
2234 test3()
2235 {
2236 const auto nullary = [](){ return 0; };
2237 const auto unary = [](int x){ return x; };
2238 using nullary_t = decltype(nullary);
2239 using unary_t = decltype(unary);
2240 const auto higher1st = [](nullary_t f){ return f(); };
2241 const auto higher2nd = [unary](nullary_t f1){
2242 return [unary, f1](unary_t f2){ return f2(unary(f1())); };
2243 };
2244 return higher1st(nullary) + higher2nd(nullary)(unary);
2245 }
2246
2247 }
2248
2249 namespace test_variadic_templates
2250 {
2251
2252 template <int...>
2253 struct sum;
2254
2255 template <int N0, int... N1toN>
2256 struct sum<N0, N1toN...>
2257 {
2258 static constexpr auto value = N0 + sum<N1toN...>::value;
2259 };
2260
2261 template <>
2262 struct sum<>
2263 {
2264 static constexpr auto value = 0;
2265 };
2266
2267 static_assert(sum<>::value == 0, "");
2268 static_assert(sum<1>::value == 1, "");
2269 static_assert(sum<23>::value == 23, "");
2270 static_assert(sum<1, 2>::value == 3, "");
2271 static_assert(sum<5, 5, 11>::value == 21, "");
2272 static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, "");
2273
2274 }
2275
2276 // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae
2277 // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function
2278 // because of this.
2279 namespace test_template_alias_sfinae
2280 {
2281
2282 struct foo {};
2283
2284 template<typename T>
2285 using member = typename T::member_type;
2286
2287 template<typename T>
2288 void func(...) {}
2289
2290 template<typename T>
2291 void func(member<T>*) {}
2292
2293 void test();
2294
2295 void test() { func<foo>(0); }
2296
2297 }
2298
2299 } // namespace cxx11
2300
2301 #endif // __cplusplus >= 201103L
2302
2303 ]])
2304
2305
2306 dnl Tests for new features in C++14
2307
2308 m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_14], [[
2309
2310 // If the compiler admits that it is not ready for C++14, why torture it?
2311 // Hopefully, this will speed up the test.
2312
2313 #ifndef __cplusplus
2314
2315 #error "This is not a C++ compiler"
2316
2317 #elif __cplusplus < 201402L
2318
2319 #error "This is not a C++14 compiler"
2320
2321 #else
2322
2323 namespace cxx14
2324 {
2325
2326 namespace test_polymorphic_lambdas
2327 {
2328
2329 int
2330 test()
2331 {
2332 const auto lambda = [](auto&&... args){
2333 const auto istiny = [](auto x){
2334 return (sizeof(x) == 1UL) ? 1 : 0;
2335 };
2336 const int aretiny[] = { istiny(args)... };
2337 return aretiny[0];
2338 };
2339 return lambda(1, 1L, 1.0f, '1');
2340 }
2341
2342 }
2343
2344 namespace test_binary_literals
2345 {
2346
2347 constexpr auto ivii = 0b0000000000101010;
2348 static_assert(ivii == 42, "wrong value");
2349
2350 }
2351
2352 namespace test_generalized_constexpr
2353 {
2354
2355 template < typename CharT >
2356 constexpr unsigned long
2357 strlen_c(const CharT *const s) noexcept
2358 {
2359 auto length = 0UL;
2360 for (auto p = s; *p; ++p)
2361 ++length;
2362 return length;
2363 }
2364
2365 static_assert(strlen_c("") == 0UL, "");
2366 static_assert(strlen_c("x") == 1UL, "");
2367 static_assert(strlen_c("test") == 4UL, "");
2368 static_assert(strlen_c("another\0test") == 7UL, "");
2369
2370 }
2371
2372 namespace test_lambda_init_capture
2373 {
2374
2375 int
2376 test()
2377 {
2378 auto x = 0;
2379 const auto lambda1 = [a = x](int b){ return a + b; };
2380 const auto lambda2 = [a = lambda1(x)](){ return a; };
2381 return lambda2();
2382 }
2383
2384 }
2385
2386 namespace test_digit_separators
2387 {
2388
2389 constexpr auto ten_million = 100'000'000;
2390 static_assert(ten_million == 100000000, "");
2391
2392 }
2393
2394 namespace test_return_type_deduction
2395 {
2396
2397 auto f(int& x) { return x; }
2398 decltype(auto) g(int& x) { return x; }
2399
2400 template < typename T1, typename T2 >
2401 struct is_same
2402 {
2403 static constexpr auto value = false;
2404 };
2405
2406 template < typename T >
2407 struct is_same<T, T>
2408 {
2409 static constexpr auto value = true;
2410 };
2411
2412 int
2413 test()
2414 {
2415 auto x = 0;
2416 static_assert(is_same<int, decltype(f(x))>::value, "");
2417 static_assert(is_same<int&, decltype(g(x))>::value, "");
2418 return x;
2419 }
2420
2421 }
2422
2423 } // namespace cxx14
2424
2425 #endif // __cplusplus >= 201402L
2426
2427 ]])
2428
2429
2430 dnl Tests for new features in C++17
2431
2432 m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_17], [[
2433
2434 // If the compiler admits that it is not ready for C++17, why torture it?
2435 // Hopefully, this will speed up the test.
2436
2437 #ifndef __cplusplus
2438
2439 #error "This is not a C++ compiler"
2440
2441 #elif __cplusplus < 201703L
2442
2443 #error "This is not a C++17 compiler"
2444
2445 #else
2446
2447 #include <initializer_list>
2448 #include <utility>
2449 #include <type_traits>
2450
2451 namespace cxx17
2452 {
2453
2454 namespace test_constexpr_lambdas
2455 {
2456
2457 constexpr int foo = [](){return 42;}();
2458
2459 }
2460
2461 namespace test::nested_namespace::definitions
2462 {
2463
2464 }
2465
2466 namespace test_fold_expression
2467 {
2468
2469 template<typename... Args>
2470 int multiply(Args... args)
2471 {
2472 return (args * ... * 1);
2473 }
2474
2475 template<typename... Args>
2476 bool all(Args... args)
2477 {
2478 return (args && ...);
2479 }
2480
2481 }
2482
2483 namespace test_extended_static_assert
2484 {
2485
2486 static_assert (true);
2487
2488 }
2489
2490 namespace test_auto_brace_init_list
2491 {
2492
2493 auto foo = {5};
2494 auto bar {5};
2495
2496 static_assert(std::is_same<std::initializer_list<int>, decltype(foo)>::value);
2497 static_assert(std::is_same<int, decltype(bar)>::value);
2498 }
2499
2500 namespace test_typename_in_template_template_parameter
2501 {
2502
2503 template<template<typename> typename X> struct D;
2504
2505 }
2506
2507 namespace test_fallthrough_nodiscard_maybe_unused_attributes
2508 {
2509
2510 int f1()
2511 {
2512 return 42;
2513 }
2514
2515 [[nodiscard]] int f2()
2516 {
2517 [[maybe_unused]] auto unused = f1();
2518
2519 switch (f1())
2520 {
2521 case 17:
2522 f1();
2523 [[fallthrough]];
2524 case 42:
2525 f1();
2526 }
2527 return f1();
2528 }
2529
2530 }
2531
2532 namespace test_extended_aggregate_initialization
2533 {
2534
2535 struct base1
2536 {
2537 int b1, b2 = 42;
2538 };
2539
2540 struct base2
2541 {
2542 base2() {
2543 b3 = 42;
2544 }
2545 int b3;
2546 };
2547
2548 struct derived : base1, base2
2549 {
2550 int d;
2551 };
2552
2553 derived d1 {{1, 2}, {}, 4}; // full initialization
2554 derived d2 {{}, {}, 4}; // value-initialized bases
2555
2556 }
2557
2558 namespace test_general_range_based_for_loop
2559 {
2560
2561 struct iter
2562 {
2563 int i;
2564
2565 int& operator* ()
2566 {
2567 return i;
2568 }
2569
2570 const int& operator* () const
2571 {
2572 return i;
2573 }
2574
2575 iter& operator++()
2576 {
2577 ++i;
2578 return *this;
2579 }
2580 };
2581
2582 struct sentinel
2583 {
2584 int i;
2585 };
2586
2587 bool operator== (const iter& i, const sentinel& s)
2588 {
2589 return i.i == s.i;
2590 }
2591
2592 bool operator!= (const iter& i, const sentinel& s)
2593 {
2594 return !(i == s);
2595 }
2596
2597 struct range
2598 {
2599 iter begin() const
2600 {
2601 return {0};
2602 }
2603
2604 sentinel end() const
2605 {
2606 return {5};
2607 }
2608 };
2609
2610 void f()
2611 {
2612 range r {};
2613
2614 for (auto i : r)
2615 {
2616 [[maybe_unused]] auto v = i;
2617 }
2618 }
2619
2620 }
2621
2622 namespace test_lambda_capture_asterisk_this_by_value
2623 {
2624
2625 struct t
2626 {
2627 int i;
2628 int foo()
2629 {
2630 return [*this]()
2631 {
2632 return i;
2633 }();
2634 }
2635 };
2636
2637 }
2638
2639 namespace test_enum_class_construction
2640 {
2641
2642 enum class byte : unsigned char
2643 {};
2644
2645 byte foo {42};
2646
2647 }
2648
2649 namespace test_constexpr_if
2650 {
2651
2652 template <bool cond>
2653 int f ()
2654 {
2655 if constexpr(cond)
2656 {
2657 return 13;
2658 }
2659 else
2660 {
2661 return 42;
2662 }
2663 }
2664
2665 }
2666
2667 namespace test_selection_statement_with_initializer
2668 {
2669
2670 int f()
2671 {
2672 return 13;
2673 }
2674
2675 int f2()
2676 {
2677 if (auto i = f(); i > 0)
2678 {
2679 return 3;
2680 }
2681
2682 switch (auto i = f(); i + 4)
2683 {
2684 case 17:
2685 return 2;
2686
2687 default:
2688 return 1;
2689 }
2690 }
2691
2692 }
2693
2694 namespace test_template_argument_deduction_for_class_templates
2695 {
2696
2697 template <typename T1, typename T2>
2698 struct pair
2699 {
2700 pair (T1 p1, T2 p2)
2701 : m1 {p1},
2702 m2 {p2}
2703 {}
2704
2705 T1 m1;
2706 T2 m2;
2707 };
2708
2709 void f()
2710 {
2711 [[maybe_unused]] auto p = pair{13, 42u};
2712 }
2713
2714 }
2715
2716 namespace test_non_type_auto_template_parameters
2717 {
2718
2719 template <auto n>
2720 struct B
2721 {};
2722
2723 B<5> b1;
2724 B<'a'> b2;
2725
2726 }
2727
2728 namespace test_structured_bindings
2729 {
2730
2731 int arr[2] = { 1, 2 };
2732 std::pair<int, int> pr = { 1, 2 };
2733
2734 auto f1() -> int(&)[2]
2735 {
2736 return arr;
2737 }
2738
2739 auto f2() -> std::pair<int, int>&
2740 {
2741 return pr;
2742 }
2743
2744 struct S
2745 {
2746 int x1 : 2;
2747 volatile double y1;
2748 };
2749
2750 S f3()
2751 {
2752 return {};
2753 }
2754
2755 auto [ x1, y1 ] = f1();
2756 auto& [ xr1, yr1 ] = f1();
2757 auto [ x2, y2 ] = f2();
2758 auto& [ xr2, yr2 ] = f2();
2759 const auto [ x3, y3 ] = f3();
2760
2761 }
2762
2763 namespace test_exception_spec_type_system
2764 {
2765
2766 struct Good {};
2767 struct Bad {};
2768
2769 void g1() noexcept;
2770 void g2();
2771
2772 template<typename T>
2773 Bad
2774 f(T*, T*);
2775
2776 template<typename T1, typename T2>
2777 Good
2778 f(T1*, T2*);
2779
2780 static_assert (std::is_same_v<Good, decltype(f(g1, g2))>);
2781
2782 }
2783
2784 namespace test_inline_variables
2785 {
2786
2787 template<class T> void f(T)
2788 {}
2789
2790 template<class T> inline T g(T)
2791 {
2792 return T{};
2793 }
2794
2795 template<> inline void f<>(int)
2796 {}
2797
2798 template<> int g<>(int)
2799 {
2800 return 5;
2801 }
2802
2803 }
2804
2805 } // namespace cxx17
2806
2807 #endif // __cplusplus < 201703L
2808
2809 ]])
2810
2811 # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
2812 #
2813 # Copyright (C) 1996-2001, 2003-2015 Free Software Foundation, Inc.
2814 # Written by Gordon Matzigkeit, 1996
2815 #
2816 # This file is free software; the Free Software Foundation gives
2817 # unlimited permission to copy and/or distribute it, with or without
2818 # modifications, as long as this notice is preserved.
2819
2820 m4_define([_LT_COPYING], [dnl
2821 # Copyright (C) 2014 Free Software Foundation, Inc.
2822 # This is free software; see the source for copying conditions. There is NO
2823 # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
2824
2825 # GNU Libtool is free software; you can redistribute it and/or modify
2826 # it under the terms of the GNU General Public License as published by
2827 # the Free Software Foundation; either version 2 of of the License, or
2828 # (at your option) any later version.
2829 #
2830 # As a special exception to the GNU General Public License, if you
2831 # distribute this file as part of a program or library that is built
2832 # using GNU Libtool, you may include this file under the same
2833 # distribution terms that you use for the rest of that program.
2834 #
2835 # GNU Libtool is distributed in the hope that it will be useful, but
2836 # WITHOUT ANY WARRANTY; without even the implied warranty of
2837 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2838 # GNU General Public License for more details.
2839 #
2840 # You should have received a copy of the GNU General Public License
2841 # along with this program. If not, see <http://www.gnu.org/licenses/>.
2842 ])
2843
2844 # serial 58 LT_INIT
2845
2846
2847 # LT_PREREQ(VERSION)
2848 # ------------------
2849 # Complain and exit if this libtool version is less that VERSION.
2850 m4_defun([LT_PREREQ],
2851 [m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
2852 [m4_default([$3],
2853 [m4_fatal([Libtool version $1 or higher is required],
2854 63)])],
2855 [$2])])
2856
2857
2858 # _LT_CHECK_BUILDDIR
2859 # ------------------
2860 # Complain if the absolute build directory name contains unusual characters
2861 m4_defun([_LT_CHECK_BUILDDIR],
2862 [case `pwd` in
2863 *\ * | *\ *)
2864 AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
2865 esac
2866 ])
2867
2868
2869 # LT_INIT([OPTIONS])
2870 # ------------------
2871 AC_DEFUN([LT_INIT],
2872 [AC_PREREQ([2.62])dnl We use AC_PATH_PROGS_FEATURE_CHECK
2873 AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
2874 AC_BEFORE([$0], [LT_LANG])dnl
2875 AC_BEFORE([$0], [LT_OUTPUT])dnl
2876 AC_BEFORE([$0], [LTDL_INIT])dnl
2877 m4_require([_LT_CHECK_BUILDDIR])dnl
2878
2879 dnl Autoconf doesn't catch unexpanded LT_ macros by default:
2880 m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
2881 m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
2882 dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
2883 dnl unless we require an AC_DEFUNed macro:
2884 AC_REQUIRE([LTOPTIONS_VERSION])dnl
2885 AC_REQUIRE([LTSUGAR_VERSION])dnl
2886 AC_REQUIRE([LTVERSION_VERSION])dnl
2887 AC_REQUIRE([LTOBSOLETE_VERSION])dnl
2888 m4_require([_LT_PROG_LTMAIN])dnl
2889
2890 _LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}])
2891
2892 dnl Parse OPTIONS
2893 _LT_SET_OPTIONS([$0], [$1])
2894
2895 # This can be used to rebuild libtool when needed
2896 LIBTOOL_DEPS=$ltmain
2897
2898 # Always use our own libtool.
2899 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
2900 AC_SUBST(LIBTOOL)dnl
2901
2902 _LT_SETUP
2903
2904 # Only expand once:
2905 m4_define([LT_INIT])
2906 ])# LT_INIT
2907
2908 # Old names:
2909 AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
2910 AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
2911 dnl aclocal-1.4 backwards compatibility:
2912 dnl AC_DEFUN([AC_PROG_LIBTOOL], [])
2913 dnl AC_DEFUN([AM_PROG_LIBTOOL], [])
2914
2915
2916 # _LT_PREPARE_CC_BASENAME
2917 # -----------------------
2918 m4_defun([_LT_PREPARE_CC_BASENAME], [
2919 # Calculate cc_basename. Skip known compiler wrappers and cross-prefix.
2920 func_cc_basename ()
2921 {
2922 for cc_temp in @S|@*""; do
2923 case $cc_temp in
2924 compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
2925 distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
2926 \-*) ;;
2927 *) break;;
2928 esac
2929 done
2930 func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
2931 }
2932 ])# _LT_PREPARE_CC_BASENAME
2933
2934
2935 # _LT_CC_BASENAME(CC)
2936 # -------------------
2937 # It would be clearer to call AC_REQUIREs from _LT_PREPARE_CC_BASENAME,
2938 # but that macro is also expanded into generated libtool script, which
2939 # arranges for $SED and $ECHO to be set by different means.
2940 m4_defun([_LT_CC_BASENAME],
2941 [m4_require([_LT_PREPARE_CC_BASENAME])dnl
2942 AC_REQUIRE([_LT_DECL_SED])dnl
2943 AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
2944 func_cc_basename $1
2945 cc_basename=$func_cc_basename_result
2946 ])
2947
2948
2949 # _LT_FILEUTILS_DEFAULTS
2950 # ----------------------
2951 # It is okay to use these file commands and assume they have been set
2952 # sensibly after 'm4_require([_LT_FILEUTILS_DEFAULTS])'.
2953 m4_defun([_LT_FILEUTILS_DEFAULTS],
2954 [: ${CP="cp -f"}
2955 : ${MV="mv -f"}
2956 : ${RM="rm -f"}
2957 ])# _LT_FILEUTILS_DEFAULTS
2958
2959
2960 # _LT_SETUP
2961 # ---------
2962 m4_defun([_LT_SETUP],
2963 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
2964 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
2965 AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl
2966 AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
2967
2968 _LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl
2969 dnl
2970 _LT_DECL([], [host_alias], [0], [The host system])dnl
2971 _LT_DECL([], [host], [0])dnl
2972 _LT_DECL([], [host_os], [0])dnl
2973 dnl
2974 _LT_DECL([], [build_alias], [0], [The build system])dnl
2975 _LT_DECL([], [build], [0])dnl
2976 _LT_DECL([], [build_os], [0])dnl
2977 dnl
2978 AC_REQUIRE([AC_PROG_CC])dnl
2979 AC_REQUIRE([LT_PATH_LD])dnl
2980 AC_REQUIRE([LT_PATH_NM])dnl
2981 dnl
2982 AC_REQUIRE([AC_PROG_LN_S])dnl
2983 test -z "$LN_S" && LN_S="ln -s"
2984 _LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
2985 dnl
2986 AC_REQUIRE([LT_CMD_MAX_LEN])dnl
2987 _LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
2988 _LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
2989 dnl
2990 m4_require([_LT_FILEUTILS_DEFAULTS])dnl
2991 m4_require([_LT_CHECK_SHELL_FEATURES])dnl
2992 m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl
2993 m4_require([_LT_CMD_RELOAD])dnl
2994 m4_require([_LT_CHECK_MAGIC_METHOD])dnl
2995 m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl
2996 m4_require([_LT_CMD_OLD_ARCHIVE])dnl
2997 m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
2998 m4_require([_LT_WITH_SYSROOT])dnl
2999 m4_require([_LT_CMD_TRUNCATE])dnl
3000
3001 _LT_CONFIG_LIBTOOL_INIT([
3002 # See if we are running on zsh, and set the options that allow our
3003 # commands through without removal of \ escapes INIT.
3004 if test -n "\${ZSH_VERSION+set}"; then
3005 setopt NO_GLOB_SUBST
3006 fi
3007 ])
3008 if test -n "${ZSH_VERSION+set}"; then
3009 setopt NO_GLOB_SUBST
3010 fi
3011
3012 _LT_CHECK_OBJDIR
3013
3014 m4_require([_LT_TAG_COMPILER])dnl
3015
3016 case $host_os in
3017 aix3*)
3018 # AIX sometimes has problems with the GCC collect2 program. For some
3019 # reason, if we set the COLLECT_NAMES environment variable, the problems
3020 # vanish in a puff of smoke.
3021 if test set != "${COLLECT_NAMES+set}"; then
3022 COLLECT_NAMES=
3023 export COLLECT_NAMES
3024 fi
3025 ;;
3026 esac
3027
3028 # Global variables:
3029 ofile=libtool
3030 can_build_shared=yes
3031
3032 # All known linkers require a '.a' archive for static linking (except MSVC,
3033 # which needs '.lib').
3034 libext=a
3035
3036 with_gnu_ld=$lt_cv_prog_gnu_ld
3037
3038 old_CC=$CC
3039 old_CFLAGS=$CFLAGS
3040
3041 # Set sane defaults for various variables
3042 test -z "$CC" && CC=cc
3043 test -z "$LTCC" && LTCC=$CC
3044 test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
3045 test -z "$LD" && LD=ld
3046 test -z "$ac_objext" && ac_objext=o
3047
3048 _LT_CC_BASENAME([$compiler])
3049
3050 # Only perform the check for file, if the check method requires it
3051 test -z "$MAGIC_CMD" && MAGIC_CMD=file
3052 case $deplibs_check_method in
3053 file_magic*)
3054 if test "$file_magic_cmd" = '$MAGIC_CMD'; then
3055 _LT_PATH_MAGIC
3056 fi
3057 ;;
3058 esac
3059
3060 # Use C for the default configuration in the libtool script
3061 LT_SUPPORTED_TAG([CC])
3062 _LT_LANG_C_CONFIG
3063 _LT_LANG_DEFAULT_CONFIG
3064 _LT_CONFIG_COMMANDS
3065 ])# _LT_SETUP
3066
3067
3068 # _LT_PREPARE_SED_QUOTE_VARS
3069 # --------------------------
3070 # Define a few sed substitution that help us do robust quoting.
3071 m4_defun([_LT_PREPARE_SED_QUOTE_VARS],
3072 [# Backslashify metacharacters that are still active within
3073 # double-quoted strings.
3074 sed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
3075
3076 # Same as above, but do not quote variable references.
3077 double_quote_subst='s/\([["`\\]]\)/\\\1/g'
3078
3079 # Sed substitution to delay expansion of an escaped shell variable in a
3080 # double_quote_subst'ed string.
3081 delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
3082
3083 # Sed substitution to delay expansion of an escaped single quote.
3084 delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
3085
3086 # Sed substitution to avoid accidental globbing in evaled expressions
3087 no_glob_subst='s/\*/\\\*/g'
3088 ])
3089
3090 # _LT_PROG_LTMAIN
3091 # ---------------
3092 # Note that this code is called both from 'configure', and 'config.status'
3093 # now that we use AC_CONFIG_COMMANDS to generate libtool. Notably,
3094 # 'config.status' has no value for ac_aux_dir unless we are using Automake,
3095 # so we pass a copy along to make sure it has a sensible value anyway.
3096 m4_defun([_LT_PROG_LTMAIN],
3097 [m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
3098 _LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
3099 ltmain=$ac_aux_dir/ltmain.sh
3100 ])# _LT_PROG_LTMAIN
3101
3102
3103
3104 # So that we can recreate a full libtool script including additional
3105 # tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
3106 # in macros and then make a single call at the end using the 'libtool'
3107 # label.
3108
3109
3110 # _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
3111 # ----------------------------------------
3112 # Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
3113 m4_define([_LT_CONFIG_LIBTOOL_INIT],
3114 [m4_ifval([$1],
3115 [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
3116 [$1
3117 ])])])
3118
3119 # Initialize.
3120 m4_define([_LT_OUTPUT_LIBTOOL_INIT])
3121
3122
3123 # _LT_CONFIG_LIBTOOL([COMMANDS])
3124 # ------------------------------
3125 # Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
3126 m4_define([_LT_CONFIG_LIBTOOL],
3127 [m4_ifval([$1],
3128 [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
3129 [$1
3130 ])])])
3131
3132 # Initialize.
3133 m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
3134
3135
3136 # _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
3137 # -----------------------------------------------------
3138 m4_defun([_LT_CONFIG_SAVE_COMMANDS],
3139 [_LT_CONFIG_LIBTOOL([$1])
3140 _LT_CONFIG_LIBTOOL_INIT([$2])
3141 ])
3142
3143
3144 # _LT_FORMAT_COMMENT([COMMENT])
3145 # -----------------------------
3146 # Add leading comment marks to the start of each line, and a trailing
3147 # full-stop to the whole comment if one is not present already.
3148 m4_define([_LT_FORMAT_COMMENT],
3149 [m4_ifval([$1], [
3150 m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
3151 [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
3152 )])
3153
3154
3155
3156
3157
3158 # _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
3159 # -------------------------------------------------------------------
3160 # CONFIGNAME is the name given to the value in the libtool script.
3161 # VARNAME is the (base) name used in the configure script.
3162 # VALUE may be 0, 1 or 2 for a computed quote escaped value based on
3163 # VARNAME. Any other value will be used directly.
3164 m4_define([_LT_DECL],
3165 [lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
3166 [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
3167 [m4_ifval([$1], [$1], [$2])])
3168 lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
3169 m4_ifval([$4],
3170 [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
3171 lt_dict_add_subkey([lt_decl_dict], [$2],
3172 [tagged?], [m4_ifval([$5], [yes], [no])])])
3173 ])
3174
3175
3176 # _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
3177 # --------------------------------------------------------
3178 m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
3179
3180
3181 # lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
3182 # ------------------------------------------------
3183 m4_define([lt_decl_tag_varnames],
3184 [_lt_decl_filter([tagged?], [yes], $@)])
3185
3186
3187 # _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
3188 # ---------------------------------------------------------
3189 m4_define([_lt_decl_filter],
3190 [m4_case([$#],
3191 [0], [m4_fatal([$0: too few arguments: $#])],
3192 [1], [m4_fatal([$0: too few arguments: $#: $1])],
3193 [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
3194 [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
3195 [lt_dict_filter([lt_decl_dict], $@)])[]dnl
3196 ])
3197
3198
3199 # lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
3200 # --------------------------------------------------
3201 m4_define([lt_decl_quote_varnames],
3202 [_lt_decl_filter([value], [1], $@)])
3203
3204
3205 # lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
3206 # ---------------------------------------------------
3207 m4_define([lt_decl_dquote_varnames],
3208 [_lt_decl_filter([value], [2], $@)])
3209
3210
3211 # lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
3212 # ---------------------------------------------------
3213 m4_define([lt_decl_varnames_tagged],
3214 [m4_assert([$# <= 2])dnl
3215 _$0(m4_quote(m4_default([$1], [[, ]])),
3216 m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
3217 m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
3218 m4_define([_lt_decl_varnames_tagged],
3219 [m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
3220
3221
3222 # lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
3223 # ------------------------------------------------
3224 m4_define([lt_decl_all_varnames],
3225 [_$0(m4_quote(m4_default([$1], [[, ]])),
3226 m4_if([$2], [],
3227 m4_quote(lt_decl_varnames),
3228 m4_quote(m4_shift($@))))[]dnl
3229 ])
3230 m4_define([_lt_decl_all_varnames],
3231 [lt_join($@, lt_decl_varnames_tagged([$1],
3232 lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
3233 ])
3234
3235
3236 # _LT_CONFIG_STATUS_DECLARE([VARNAME])
3237 # ------------------------------------
3238 # Quote a variable value, and forward it to 'config.status' so that its
3239 # declaration there will have the same value as in 'configure'. VARNAME
3240 # must have a single quote delimited value for this to work.
3241 m4_define([_LT_CONFIG_STATUS_DECLARE],
3242 [$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`'])
3243
3244
3245 # _LT_CONFIG_STATUS_DECLARATIONS
3246 # ------------------------------
3247 # We delimit libtool config variables with single quotes, so when
3248 # we write them to config.status, we have to be sure to quote all
3249 # embedded single quotes properly. In configure, this macro expands
3250 # each variable declared with _LT_DECL (and _LT_TAGDECL) into:
3251 #
3252 # <var>='`$ECHO "$<var>" | $SED "$delay_single_quote_subst"`'
3253 m4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
3254 [m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
3255 [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
3256
3257
3258 # _LT_LIBTOOL_TAGS
3259 # ----------------
3260 # Output comment and list of tags supported by the script
3261 m4_defun([_LT_LIBTOOL_TAGS],
3262 [_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
3263 available_tags='_LT_TAGS'dnl
3264 ])
3265
3266
3267 # _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
3268 # -----------------------------------
3269 # Extract the dictionary values for VARNAME (optionally with TAG) and
3270 # expand to a commented shell variable setting:
3271 #
3272 # # Some comment about what VAR is for.
3273 # visible_name=$lt_internal_name
3274 m4_define([_LT_LIBTOOL_DECLARE],
3275 [_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
3276 [description])))[]dnl
3277 m4_pushdef([_libtool_name],
3278 m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
3279 m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
3280 [0], [_libtool_name=[$]$1],
3281 [1], [_libtool_name=$lt_[]$1],
3282 [2], [_libtool_name=$lt_[]$1],
3283 [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
3284 m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
3285 ])
3286
3287
3288 # _LT_LIBTOOL_CONFIG_VARS
3289 # -----------------------
3290 # Produce commented declarations of non-tagged libtool config variables
3291 # suitable for insertion in the LIBTOOL CONFIG section of the 'libtool'
3292 # script. Tagged libtool config variables (even for the LIBTOOL CONFIG
3293 # section) are produced by _LT_LIBTOOL_TAG_VARS.
3294 m4_defun([_LT_LIBTOOL_CONFIG_VARS],
3295 [m4_foreach([_lt_var],
3296 m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
3297 [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
3298
3299
3300 # _LT_LIBTOOL_TAG_VARS(TAG)
3301 # -------------------------
3302 m4_define([_LT_LIBTOOL_TAG_VARS],
3303 [m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
3304 [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
3305
3306
3307 # _LT_TAGVAR(VARNAME, [TAGNAME])
3308 # ------------------------------
3309 m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
3310
3311
3312 # _LT_CONFIG_COMMANDS
3313 # -------------------
3314 # Send accumulated output to $CONFIG_STATUS. Thanks to the lists of
3315 # variables for single and double quote escaping we saved from calls
3316 # to _LT_DECL, we can put quote escaped variables declarations
3317 # into 'config.status', and then the shell code to quote escape them in
3318 # for loops in 'config.status'. Finally, any additional code accumulated
3319 # from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
3320 m4_defun([_LT_CONFIG_COMMANDS],
3321 [AC_PROVIDE_IFELSE([LT_OUTPUT],
3322 dnl If the libtool generation code has been placed in $CONFIG_LT,
3323 dnl instead of duplicating it all over again into config.status,
3324 dnl then we will have config.status run $CONFIG_LT later, so it
3325 dnl needs to know what name is stored there:
3326 [AC_CONFIG_COMMANDS([libtool],
3327 [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
3328 dnl If the libtool generation code is destined for config.status,
3329 dnl expand the accumulated commands and init code now:
3330 [AC_CONFIG_COMMANDS([libtool],
3331 [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
3332 ])#_LT_CONFIG_COMMANDS
3333
3334
3335 # Initialize.
3336 m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
3337 [
3338
3339 # The HP-UX ksh and POSIX shell print the target directory to stdout
3340 # if CDPATH is set.
3341 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
3342
3343 sed_quote_subst='$sed_quote_subst'
3344 double_quote_subst='$double_quote_subst'
3345 delay_variable_subst='$delay_variable_subst'
3346 _LT_CONFIG_STATUS_DECLARATIONS
3347 LTCC='$LTCC'
3348 LTCFLAGS='$LTCFLAGS'
3349 compiler='$compiler_DEFAULT'
3350
3351 # A function that is used when there is no print builtin or printf.
3352 func_fallback_echo ()
3353 {
3354 eval 'cat <<_LTECHO_EOF
3355 \$[]1
3356 _LTECHO_EOF'
3357 }
3358
3359 # Quote evaled strings.
3360 for var in lt_decl_all_varnames([[ \
3361 ]], lt_decl_quote_varnames); do
3362 case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
3363 *[[\\\\\\\`\\"\\\$]]*)
3364 eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
3365 ;;
3366 *)
3367 eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
3368 ;;
3369 esac
3370 done
3371
3372 # Double-quote double-evaled strings.
3373 for var in lt_decl_all_varnames([[ \
3374 ]], lt_decl_dquote_varnames); do
3375 case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
3376 *[[\\\\\\\`\\"\\\$]]*)
3377 eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
3378 ;;
3379 *)
3380 eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
3381 ;;
3382 esac
3383 done
3384
3385 _LT_OUTPUT_LIBTOOL_INIT
3386 ])
3387
3388 # _LT_GENERATED_FILE_INIT(FILE, [COMMENT])
3389 # ------------------------------------
3390 # Generate a child script FILE with all initialization necessary to
3391 # reuse the environment learned by the parent script, and make the
3392 # file executable. If COMMENT is supplied, it is inserted after the
3393 # '#!' sequence but before initialization text begins. After this
3394 # macro, additional text can be appended to FILE to form the body of
3395 # the child script. The macro ends with non-zero status if the
3396 # file could not be fully written (such as if the disk is full).
3397 m4_ifdef([AS_INIT_GENERATED],
3398 [m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])],
3399 [m4_defun([_LT_GENERATED_FILE_INIT],
3400 [m4_require([AS_PREPARE])]dnl
3401 [m4_pushdef([AS_MESSAGE_LOG_FD])]dnl
3402 [lt_write_fail=0
3403 cat >$1 <<_ASEOF || lt_write_fail=1
3404 #! $SHELL
3405 # Generated by $as_me.
3406 $2
3407 SHELL=\${CONFIG_SHELL-$SHELL}
3408 export SHELL
3409 _ASEOF
3410 cat >>$1 <<\_ASEOF || lt_write_fail=1
3411 AS_SHELL_SANITIZE
3412 _AS_PREPARE
3413 exec AS_MESSAGE_FD>&1
3414 _ASEOF
3415 test 0 = "$lt_write_fail" && chmod +x $1[]dnl
3416 m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT
3417
3418 # LT_OUTPUT
3419 # ---------
3420 # This macro allows early generation of the libtool script (before
3421 # AC_OUTPUT is called), incase it is used in configure for compilation
3422 # tests.
3423 AC_DEFUN([LT_OUTPUT],
3424 [: ${CONFIG_LT=./config.lt}
3425 AC_MSG_NOTICE([creating $CONFIG_LT])
3426 _LT_GENERATED_FILE_INIT(["$CONFIG_LT"],
3427 [# Run this file to recreate a libtool stub with the current configuration.])
3428
3429 cat >>"$CONFIG_LT" <<\_LTEOF
3430 lt_cl_silent=false
3431 exec AS_MESSAGE_LOG_FD>>config.log
3432 {
3433 echo
3434 AS_BOX([Running $as_me.])
3435 } >&AS_MESSAGE_LOG_FD
3436
3437 lt_cl_help="\
3438 '$as_me' creates a local libtool stub from the current configuration,
3439 for use in further configure time tests before the real libtool is
3440 generated.
3441
3442 Usage: $[0] [[OPTIONS]]
3443
3444 -h, --help print this help, then exit
3445 -V, --version print version number, then exit
3446 -q, --quiet do not print progress messages
3447 -d, --debug don't remove temporary files
3448
3449 Report bugs to <bug-libtool@gnu.org>."
3450
3451 lt_cl_version="\
3452 m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
3453 m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
3454 configured by $[0], generated by m4_PACKAGE_STRING.
3455
3456 Copyright (C) 2011 Free Software Foundation, Inc.
3457 This config.lt script is free software; the Free Software Foundation
3458 gives unlimited permision to copy, distribute and modify it."
3459
3460 while test 0 != $[#]
3461 do
3462 case $[1] in
3463 --version | --v* | -V )
3464 echo "$lt_cl_version"; exit 0 ;;
3465 --help | --h* | -h )
3466 echo "$lt_cl_help"; exit 0 ;;
3467 --debug | --d* | -d )
3468 debug=: ;;
3469 --quiet | --q* | --silent | --s* | -q )
3470 lt_cl_silent=: ;;
3471
3472 -*) AC_MSG_ERROR([unrecognized option: $[1]
3473 Try '$[0] --help' for more information.]) ;;
3474
3475 *) AC_MSG_ERROR([unrecognized argument: $[1]
3476 Try '$[0] --help' for more information.]) ;;
3477 esac
3478 shift
3479 done
3480
3481 if $lt_cl_silent; then
3482 exec AS_MESSAGE_FD>/dev/null
3483 fi
3484 _LTEOF
3485
3486 cat >>"$CONFIG_LT" <<_LTEOF
3487 _LT_OUTPUT_LIBTOOL_COMMANDS_INIT
3488 _LTEOF
3489
3490 cat >>"$CONFIG_LT" <<\_LTEOF
3491 AC_MSG_NOTICE([creating $ofile])
3492 _LT_OUTPUT_LIBTOOL_COMMANDS
3493 AS_EXIT(0)
3494 _LTEOF
3495 chmod +x "$CONFIG_LT"
3496
3497 # configure is writing to config.log, but config.lt does its own redirection,
3498 # appending to config.log, which fails on DOS, as config.log is still kept
3499 # open by configure. Here we exec the FD to /dev/null, effectively closing
3500 # config.log, so it can be properly (re)opened and appended to by config.lt.
3501 lt_cl_success=:
3502 test yes = "$silent" &&
3503 lt_config_lt_args="$lt_config_lt_args --quiet"
3504 exec AS_MESSAGE_LOG_FD>/dev/null
3505 $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
3506 exec AS_MESSAGE_LOG_FD>>config.log
3507 $lt_cl_success || AS_EXIT(1)
3508 ])# LT_OUTPUT
3509
3510
3511 # _LT_CONFIG(TAG)
3512 # ---------------
3513 # If TAG is the built-in tag, create an initial libtool script with a
3514 # default configuration from the untagged config vars. Otherwise add code
3515 # to config.status for appending the configuration named by TAG from the
3516 # matching tagged config vars.
3517 m4_defun([_LT_CONFIG],
3518 [m4_require([_LT_FILEUTILS_DEFAULTS])dnl
3519 _LT_CONFIG_SAVE_COMMANDS([
3520 m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
3521 m4_if(_LT_TAG, [C], [
3522 # See if we are running on zsh, and set the options that allow our
3523 # commands through without removal of \ escapes.
3524 if test -n "${ZSH_VERSION+set}"; then
3525 setopt NO_GLOB_SUBST
3526 fi
3527
3528 cfgfile=${ofile}T
3529 trap "$RM \"$cfgfile\"; exit 1" 1 2 15
3530 $RM "$cfgfile"
3531
3532 cat <<_LT_EOF >> "$cfgfile"
3533 #! $SHELL
3534 # Generated automatically by $as_me ($PACKAGE) $VERSION
3535 # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
3536 # NOTE: Changes made to this file will be lost: look at ltmain.sh.
3537
3538 # Provide generalized library-building support services.
3539 # Written by Gordon Matzigkeit, 1996
3540
3541 _LT_COPYING
3542 _LT_LIBTOOL_TAGS
3543
3544 # Configured defaults for sys_lib_dlsearch_path munging.
3545 : \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"}
3546
3547 # ### BEGIN LIBTOOL CONFIG
3548 _LT_LIBTOOL_CONFIG_VARS
3549 _LT_LIBTOOL_TAG_VARS
3550 # ### END LIBTOOL CONFIG
3551
3552 _LT_EOF
3553
3554 cat <<'_LT_EOF' >> "$cfgfile"
3555
3556 # ### BEGIN FUNCTIONS SHARED WITH CONFIGURE
3557
3558 _LT_PREPARE_MUNGE_PATH_LIST
3559 _LT_PREPARE_CC_BASENAME
3560
3561 # ### END FUNCTIONS SHARED WITH CONFIGURE
3562
3563 _LT_EOF
3564
3565 case $host_os in
3566 aix3*)
3567 cat <<\_LT_EOF >> "$cfgfile"
3568 # AIX sometimes has problems with the GCC collect2 program. For some
3569 # reason, if we set the COLLECT_NAMES environment variable, the problems
3570 # vanish in a puff of smoke.
3571 if test set != "${COLLECT_NAMES+set}"; then
3572 COLLECT_NAMES=
3573 export COLLECT_NAMES
3574 fi
3575 _LT_EOF
3576 ;;
3577 esac
3578
3579 _LT_PROG_LTMAIN
3580
3581 # We use sed instead of cat because bash on DJGPP gets confused if
3582 # if finds mixed CR/LF and LF-only lines. Since sed operates in
3583 # text mode, it properly converts lines to CR/LF. This bash problem
3584 # is reportedly fixed, but why not run on old versions too?
3585 sed '$q' "$ltmain" >> "$cfgfile" \
3586 || (rm -f "$cfgfile"; exit 1)
3587
3588 mv -f "$cfgfile" "$ofile" ||
3589 (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
3590 chmod +x "$ofile"
3591 ],
3592 [cat <<_LT_EOF >> "$ofile"
3593
3594 dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
3595 dnl in a comment (ie after a #).
3596 # ### BEGIN LIBTOOL TAG CONFIG: $1
3597 _LT_LIBTOOL_TAG_VARS(_LT_TAG)
3598 # ### END LIBTOOL TAG CONFIG: $1
3599 _LT_EOF
3600 ])dnl /m4_if
3601 ],
3602 [m4_if([$1], [], [
3603 PACKAGE='$PACKAGE'
3604 VERSION='$VERSION'
3605 RM='$RM'
3606 ofile='$ofile'], [])
3607 ])dnl /_LT_CONFIG_SAVE_COMMANDS
3608 ])# _LT_CONFIG
3609
3610
3611 # LT_SUPPORTED_TAG(TAG)
3612 # ---------------------
3613 # Trace this macro to discover what tags are supported by the libtool
3614 # --tag option, using:
3615 # autoconf --trace 'LT_SUPPORTED_TAG:$1'
3616 AC_DEFUN([LT_SUPPORTED_TAG], [])
3617
3618
3619 # C support is built-in for now
3620 m4_define([_LT_LANG_C_enabled], [])
3621 m4_define([_LT_TAGS], [])
3622
3623
3624 # LT_LANG(LANG)
3625 # -------------
3626 # Enable libtool support for the given language if not already enabled.
3627 AC_DEFUN([LT_LANG],
3628 [AC_BEFORE([$0], [LT_OUTPUT])dnl
3629 m4_case([$1],
3630 [C], [_LT_LANG(C)],
3631 [C++], [_LT_LANG(CXX)],
3632 [Go], [_LT_LANG(GO)],
3633 [Java], [_LT_LANG(GCJ)],
3634 [Fortran 77], [_LT_LANG(F77)],
3635 [Fortran], [_LT_LANG(FC)],
3636 [Windows Resource], [_LT_LANG(RC)],
3637 [m4_ifdef([_LT_LANG_]$1[_CONFIG],
3638 [_LT_LANG($1)],
3639 [m4_fatal([$0: unsupported language: "$1"])])])dnl
3640 ])# LT_LANG
3641
3642
3643 # _LT_LANG(LANGNAME)
3644 # ------------------
3645 m4_defun([_LT_LANG],
3646 [m4_ifdef([_LT_LANG_]$1[_enabled], [],
3647 [LT_SUPPORTED_TAG([$1])dnl
3648 m4_append([_LT_TAGS], [$1 ])dnl
3649 m4_define([_LT_LANG_]$1[_enabled], [])dnl
3650 _LT_LANG_$1_CONFIG($1)])dnl
3651 ])# _LT_LANG
3652
3653
3654 m4_ifndef([AC_PROG_GO], [
3655 # NOTE: This macro has been submitted for inclusion into #
3656 # GNU Autoconf as AC_PROG_GO. When it is available in #
3657 # a released version of Autoconf we should remove this #
3658 # macro and use it instead. #
3659 m4_defun([AC_PROG_GO],
3660 [AC_LANG_PUSH(Go)dnl
3661 AC_ARG_VAR([GOC], [Go compiler command])dnl
3662 AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl
3663 _AC_ARG_VAR_LDFLAGS()dnl
3664 AC_CHECK_TOOL(GOC, gccgo)
3665 if test -z "$GOC"; then
3666 if test -n "$ac_tool_prefix"; then
3667 AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo])
3668 fi
3669 fi
3670 if test -z "$GOC"; then
3671 AC_CHECK_PROG(GOC, gccgo, gccgo, false)
3672 fi
3673 ])#m4_defun
3674 ])#m4_ifndef
3675
3676
3677 # _LT_LANG_DEFAULT_CONFIG
3678 # -----------------------
3679 m4_defun([_LT_LANG_DEFAULT_CONFIG],
3680 [AC_PROVIDE_IFELSE([AC_PROG_CXX],
3681 [LT_LANG(CXX)],
3682 [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
3683
3684 AC_PROVIDE_IFELSE([AC_PROG_F77],
3685 [LT_LANG(F77)],
3686 [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
3687
3688 AC_PROVIDE_IFELSE([AC_PROG_FC],
3689 [LT_LANG(FC)],
3690 [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
3691
3692 dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
3693 dnl pulling things in needlessly.
3694 AC_PROVIDE_IFELSE([AC_PROG_GCJ],
3695 [LT_LANG(GCJ)],
3696 [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
3697 [LT_LANG(GCJ)],
3698 [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
3699 [LT_LANG(GCJ)],
3700 [m4_ifdef([AC_PROG_GCJ],
3701 [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
3702 m4_ifdef([A][M_PROG_GCJ],
3703 [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
3704 m4_ifdef([LT_PROG_GCJ],
3705 [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
3706
3707 AC_PROVIDE_IFELSE([AC_PROG_GO],
3708 [LT_LANG(GO)],
3709 [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])])
3710
3711 AC_PROVIDE_IFELSE([LT_PROG_RC],
3712 [LT_LANG(RC)],
3713 [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
3714 ])# _LT_LANG_DEFAULT_CONFIG
3715
3716 # Obsolete macros:
3717 AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
3718 AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
3719 AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
3720 AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
3721 AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)])
3722 dnl aclocal-1.4 backwards compatibility:
3723 dnl AC_DEFUN([AC_LIBTOOL_CXX], [])
3724 dnl AC_DEFUN([AC_LIBTOOL_F77], [])
3725 dnl AC_DEFUN([AC_LIBTOOL_FC], [])
3726 dnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
3727 dnl AC_DEFUN([AC_LIBTOOL_RC], [])
3728
3729
3730 # _LT_TAG_COMPILER
3731 # ----------------
3732 m4_defun([_LT_TAG_COMPILER],
3733 [AC_REQUIRE([AC_PROG_CC])dnl
3734
3735 _LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
3736 _LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
3737 _LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
3738 _LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
3739
3740 # If no C compiler was specified, use CC.
3741 LTCC=${LTCC-"$CC"}
3742
3743 # If no C compiler flags were specified, use CFLAGS.
3744 LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
3745
3746 # Allow CC to be a program name with arguments.
3747 compiler=$CC
3748 ])# _LT_TAG_COMPILER
3749
3750
3751 # _LT_COMPILER_BOILERPLATE
3752 # ------------------------
3753 # Check for compiler boilerplate output or warnings with
3754 # the simple compiler test code.
3755 m4_defun([_LT_COMPILER_BOILERPLATE],
3756 [m4_require([_LT_DECL_SED])dnl
3757 ac_outfile=conftest.$ac_objext
3758 echo "$lt_simple_compile_test_code" >conftest.$ac_ext
3759 eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
3760 _lt_compiler_boilerplate=`cat conftest.err`
3761 $RM conftest*
3762 ])# _LT_COMPILER_BOILERPLATE
3763
3764
3765 # _LT_LINKER_BOILERPLATE
3766 # ----------------------
3767 # Check for linker boilerplate output or warnings with
3768 # the simple link test code.
3769 m4_defun([_LT_LINKER_BOILERPLATE],
3770 [m4_require([_LT_DECL_SED])dnl
3771 ac_outfile=conftest.$ac_objext
3772 echo "$lt_simple_link_test_code" >conftest.$ac_ext
3773 eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
3774 _lt_linker_boilerplate=`cat conftest.err`
3775 $RM -r conftest*
3776 ])# _LT_LINKER_BOILERPLATE
3777
3778 # _LT_REQUIRED_DARWIN_CHECKS
3779 # -------------------------
3780 m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
3781 case $host_os in
3782 rhapsody* | darwin*)
3783 AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
3784 AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
3785 AC_CHECK_TOOL([LIPO], [lipo], [:])
3786 AC_CHECK_TOOL([OTOOL], [otool], [:])
3787 AC_CHECK_TOOL([OTOOL64], [otool64], [:])
3788 _LT_DECL([], [DSYMUTIL], [1],
3789 [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
3790 _LT_DECL([], [NMEDIT], [1],
3791 [Tool to change global to local symbols on Mac OS X])
3792 _LT_DECL([], [LIPO], [1],
3793 [Tool to manipulate fat objects and archives on Mac OS X])
3794 _LT_DECL([], [OTOOL], [1],
3795 [ldd/readelf like tool for Mach-O binaries on Mac OS X])
3796 _LT_DECL([], [OTOOL64], [1],
3797 [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
3798
3799 AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
3800 [lt_cv_apple_cc_single_mod=no
3801 if test -z "$LT_MULTI_MODULE"; then
3802 # By default we will add the -single_module flag. You can override
3803 # by either setting the environment variable LT_MULTI_MODULE
3804 # non-empty at configure time, or by adding -multi_module to the
3805 # link flags.
3806 rm -rf libconftest.dylib*
3807 echo "int foo(void){return 1;}" > conftest.c
3808 echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
3809 -dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
3810 $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
3811 -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
3812 _lt_result=$?
3813 # If there is a non-empty error log, and "single_module"
3814 # appears in it, assume the flag caused a linker warning
3815 if test -s conftest.err && $GREP single_module conftest.err; then
3816 cat conftest.err >&AS_MESSAGE_LOG_FD
3817 # Otherwise, if the output was created with a 0 exit code from
3818 # the compiler, it worked.
3819 elif test -f libconftest.dylib && test 0 = "$_lt_result"; then
3820 lt_cv_apple_cc_single_mod=yes
3821 else
3822 cat conftest.err >&AS_MESSAGE_LOG_FD
3823 fi
3824 rm -rf libconftest.dylib*
3825 rm -f conftest.*
3826 fi])
3827
3828 AC_CACHE_CHECK([for -exported_symbols_list linker flag],
3829 [lt_cv_ld_exported_symbols_list],
3830 [lt_cv_ld_exported_symbols_list=no
3831 save_LDFLAGS=$LDFLAGS
3832 echo "_main" > conftest.sym
3833 LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
3834 AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
3835 [lt_cv_ld_exported_symbols_list=yes],
3836 [lt_cv_ld_exported_symbols_list=no])
3837 LDFLAGS=$save_LDFLAGS
3838 ])
3839
3840 AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load],
3841 [lt_cv_ld_force_load=no
3842 cat > conftest.c << _LT_EOF
3843 int forced_loaded() { return 2;}
3844 _LT_EOF
3845 echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD
3846 $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD
3847 echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
3848 $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
3849 echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
3850 $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
3851 cat > conftest.c << _LT_EOF
3852 int main() { return 0;}
3853 _LT_EOF
3854 echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD
3855 $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
3856 _lt_result=$?
3857 if test -s conftest.err && $GREP force_load conftest.err; then
3858 cat conftest.err >&AS_MESSAGE_LOG_FD
3859 elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then
3860 lt_cv_ld_force_load=yes
3861 else
3862 cat conftest.err >&AS_MESSAGE_LOG_FD
3863 fi
3864 rm -f conftest.err libconftest.a conftest conftest.c
3865 rm -rf conftest.dSYM
3866 ])
3867 case $host_os in
3868 rhapsody* | darwin1.[[012]])
3869 _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;;
3870 darwin1.*)
3871 _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
3872 darwin*) # darwin 5.x on
3873 # if running on 10.5 or later, the deployment target defaults
3874 # to the OS version, if on x86, and 10.4, the deployment
3875 # target defaults to 10.4. Don't you love it?
3876 case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
3877 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
3878 _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
3879 10.[[012]][[,.]]*)
3880 _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
3881 10.*)
3882 _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
3883 esac
3884 ;;
3885 esac
3886 if test yes = "$lt_cv_apple_cc_single_mod"; then
3887 _lt_dar_single_mod='$single_module'
3888 fi
3889 if test yes = "$lt_cv_ld_exported_symbols_list"; then
3890 _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym'
3891 else
3892 _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib'
3893 fi
3894 if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then
3895 _lt_dsymutil='~$DSYMUTIL $lib || :'
3896 else
3897 _lt_dsymutil=
3898 fi
3899 ;;
3900 esac
3901 ])
3902
3903
3904 # _LT_DARWIN_LINKER_FEATURES([TAG])
3905 # ---------------------------------
3906 # Checks for linker and compiler features on darwin
3907 m4_defun([_LT_DARWIN_LINKER_FEATURES],
3908 [
3909 m4_require([_LT_REQUIRED_DARWIN_CHECKS])
3910 _LT_TAGVAR(archive_cmds_need_lc, $1)=no
3911 _LT_TAGVAR(hardcode_direct, $1)=no
3912 _LT_TAGVAR(hardcode_automatic, $1)=yes
3913 _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
3914 if test yes = "$lt_cv_ld_force_load"; then
3915 _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
3916 m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes],
3917 [FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes])
3918 else
3919 _LT_TAGVAR(whole_archive_flag_spec, $1)=''
3920 fi
3921 _LT_TAGVAR(link_all_deplibs, $1)=yes
3922 _LT_TAGVAR(allow_undefined_flag, $1)=$_lt_dar_allow_undefined
3923 case $cc_basename in
3924 ifort*|nagfor*) _lt_dar_can_shared=yes ;;
3925 *) _lt_dar_can_shared=$GCC ;;
3926 esac
3927 if test yes = "$_lt_dar_can_shared"; then
3928 output_verbose_link_cmd=func_echo_all
3929 _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil"
3930 _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil"
3931 _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil"
3932 _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil"
3933 m4_if([$1], [CXX],
3934 [ if test yes != "$lt_cv_apple_cc_single_mod"; then
3935 _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dsymutil"
3936 _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil"
3937 fi
3938 ],[])
3939 else
3940 _LT_TAGVAR(ld_shlibs, $1)=no
3941 fi
3942 ])
3943
3944 # _LT_SYS_MODULE_PATH_AIX([TAGNAME])
3945 # ----------------------------------
3946 # Links a minimal program and checks the executable
3947 # for the system default hardcoded library path. In most cases,
3948 # this is /usr/lib:/lib, but when the MPI compilers are used
3949 # the location of the communication and MPI libs are included too.
3950 # If we don't find anything, use the default library path according
3951 # to the aix ld manual.
3952 # Store the results from the different compilers for each TAGNAME.
3953 # Allow to override them for all tags through lt_cv_aix_libpath.
3954 m4_defun([_LT_SYS_MODULE_PATH_AIX],
3955 [m4_require([_LT_DECL_SED])dnl
3956 if test set = "${lt_cv_aix_libpath+set}"; then
3957 aix_libpath=$lt_cv_aix_libpath
3958 else
3959 AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])],
3960 [AC_LINK_IFELSE([AC_LANG_PROGRAM],[
3961 lt_aix_libpath_sed='[
3962 /Import File Strings/,/^$/ {
3963 /^0/ {
3964 s/^0 *\([^ ]*\) *$/\1/
3965 p
3966 }
3967 }]'
3968 _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
3969 # Check for a 64-bit object if we didn't find anything.
3970 if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
3971 _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
3972 fi],[])
3973 if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
3974 _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=/usr/lib:/lib
3975 fi
3976 ])
3977 aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])
3978 fi
3979 ])# _LT_SYS_MODULE_PATH_AIX
3980
3981
3982 # _LT_SHELL_INIT(ARG)
3983 # -------------------
3984 m4_define([_LT_SHELL_INIT],
3985 [m4_divert_text([M4SH-INIT], [$1
3986 ])])# _LT_SHELL_INIT
3987
3988
3989
3990 # _LT_PROG_ECHO_BACKSLASH
3991 # -----------------------
3992 # Find how we can fake an echo command that does not interpret backslash.
3993 # In particular, with Autoconf 2.60 or later we add some code to the start
3994 # of the generated configure script that will find a shell with a builtin
3995 # printf (that we can use as an echo command).
3996 m4_defun([_LT_PROG_ECHO_BACKSLASH],
3997 [ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
3998 ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
3999 ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
4000
4001 AC_MSG_CHECKING([how to print strings])
4002 # Test print first, because it will be a builtin if present.
4003 if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
4004 test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
4005 ECHO='print -r --'
4006 elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
4007 ECHO='printf %s\n'
4008 else
4009 # Use this function as a fallback that always works.
4010 func_fallback_echo ()
4011 {
4012 eval 'cat <<_LTECHO_EOF
4013 $[]1
4014 _LTECHO_EOF'
4015 }
4016 ECHO='func_fallback_echo'
4017 fi
4018
4019 # func_echo_all arg...
4020 # Invoke $ECHO with all args, space-separated.
4021 func_echo_all ()
4022 {
4023 $ECHO "$*"
4024 }
4025
4026 case $ECHO in
4027 printf*) AC_MSG_RESULT([printf]) ;;
4028 print*) AC_MSG_RESULT([print -r]) ;;
4029 *) AC_MSG_RESULT([cat]) ;;
4030 esac
4031
4032 m4_ifdef([_AS_DETECT_SUGGESTED],
4033 [_AS_DETECT_SUGGESTED([
4034 test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || (
4035 ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
4036 ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
4037 ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
4038 PATH=/empty FPATH=/empty; export PATH FPATH
4039 test "X`printf %s $ECHO`" = "X$ECHO" \
4040 || test "X`print -r -- $ECHO`" = "X$ECHO" )])])
4041
4042 _LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
4043 _LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])
4044 ])# _LT_PROG_ECHO_BACKSLASH
4045
4046
4047 # _LT_WITH_SYSROOT
4048 # ----------------
4049 AC_DEFUN([_LT_WITH_SYSROOT],
4050 [AC_MSG_CHECKING([for sysroot])
4051 AC_ARG_WITH([sysroot],
4052 [AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
4053 [Search for dependent libraries within DIR (or the compiler's sysroot
4054 if not specified).])],
4055 [], [with_sysroot=no])
4056
4057 dnl lt_sysroot will always be passed unquoted. We quote it here
4058 dnl in case the user passed a directory name.
4059 lt_sysroot=
4060 case $with_sysroot in #(
4061 yes)
4062 if test yes = "$GCC"; then
4063 lt_sysroot=`$CC --print-sysroot 2>/dev/null`
4064 fi
4065 ;; #(
4066 /*)
4067 lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
4068 ;; #(
4069 no|'')
4070 ;; #(
4071 *)
4072 AC_MSG_RESULT([$with_sysroot])
4073 AC_MSG_ERROR([The sysroot must be an absolute path.])
4074 ;;
4075 esac
4076
4077 AC_MSG_RESULT([${lt_sysroot:-no}])
4078 _LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl
4079 [dependent libraries, and where our libraries should be installed.])])
4080
4081 # _LT_ENABLE_LOCK
4082 # ---------------
4083 m4_defun([_LT_ENABLE_LOCK],
4084 [AC_ARG_ENABLE([libtool-lock],
4085 [AS_HELP_STRING([--disable-libtool-lock],
4086 [avoid locking (might break parallel builds)])])
4087 test no = "$enable_libtool_lock" || enable_libtool_lock=yes
4088
4089 # Some flags need to be propagated to the compiler or linker for good
4090 # libtool support.
4091 case $host in
4092 ia64-*-hpux*)
4093 # Find out what ABI is being produced by ac_compile, and set mode
4094 # options accordingly.
4095 echo 'int i;' > conftest.$ac_ext
4096 if AC_TRY_EVAL(ac_compile); then
4097 case `/usr/bin/file conftest.$ac_objext` in
4098 *ELF-32*)
4099 HPUX_IA64_MODE=32
4100 ;;
4101 *ELF-64*)
4102 HPUX_IA64_MODE=64
4103 ;;
4104 esac
4105 fi
4106 rm -rf conftest*
4107 ;;
4108 *-*-irix6*)
4109 # Find out what ABI is being produced by ac_compile, and set linker
4110 # options accordingly.
4111 echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
4112 if AC_TRY_EVAL(ac_compile); then
4113 if test yes = "$lt_cv_prog_gnu_ld"; then
4114 case `/usr/bin/file conftest.$ac_objext` in
4115 *32-bit*)
4116 LD="${LD-ld} -melf32bsmip"
4117 ;;
4118 *N32*)
4119 LD="${LD-ld} -melf32bmipn32"
4120 ;;
4121 *64-bit*)
4122 LD="${LD-ld} -melf64bmip"
4123 ;;
4124 esac
4125 else
4126 case `/usr/bin/file conftest.$ac_objext` in
4127 *32-bit*)
4128 LD="${LD-ld} -32"
4129 ;;
4130 *N32*)
4131 LD="${LD-ld} -n32"
4132 ;;
4133 *64-bit*)
4134 LD="${LD-ld} -64"
4135 ;;
4136 esac
4137 fi
4138 fi
4139 rm -rf conftest*
4140 ;;
4141
4142 mips64*-*linux*)
4143 # Find out what ABI is being produced by ac_compile, and set linker
4144 # options accordingly.
4145 echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
4146 if AC_TRY_EVAL(ac_compile); then
4147 emul=elf
4148 case `/usr/bin/file conftest.$ac_objext` in
4149 *32-bit*)
4150 emul="${emul}32"
4151 ;;
4152 *64-bit*)
4153 emul="${emul}64"
4154 ;;
4155 esac
4156 case `/usr/bin/file conftest.$ac_objext` in
4157 *MSB*)
4158 emul="${emul}btsmip"
4159 ;;
4160 *LSB*)
4161 emul="${emul}ltsmip"
4162 ;;
4163 esac
4164 case `/usr/bin/file conftest.$ac_objext` in
4165 *N32*)
4166 emul="${emul}n32"
4167 ;;
4168 esac
4169 LD="${LD-ld} -m $emul"
4170 fi
4171 rm -rf conftest*
4172 ;;
4173
4174 x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \
4175 s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
4176 # Find out what ABI is being produced by ac_compile, and set linker
4177 # options accordingly. Note that the listed cases only cover the
4178 # situations where additional linker options are needed (such as when
4179 # doing 32-bit compilation for a host where ld defaults to 64-bit, or
4180 # vice versa); the common cases where no linker options are needed do
4181 # not appear in the list.
4182 echo 'int i;' > conftest.$ac_ext
4183 if AC_TRY_EVAL(ac_compile); then
4184 case `/usr/bin/file conftest.o` in
4185 *32-bit*)
4186 case $host in
4187 x86_64-*kfreebsd*-gnu)
4188 LD="${LD-ld} -m elf_i386_fbsd"
4189 ;;
4190 x86_64-*linux*)
4191 case `/usr/bin/file conftest.o` in
4192 *x86-64*)
4193 LD="${LD-ld} -m elf32_x86_64"
4194 ;;
4195 *)
4196 LD="${LD-ld} -m elf_i386"
4197 ;;
4198 esac
4199 ;;
4200 powerpc64le-*linux*)
4201 LD="${LD-ld} -m elf32lppclinux"
4202 ;;
4203 powerpc64-*linux*)
4204 LD="${LD-ld} -m elf32ppclinux"
4205 ;;
4206 s390x-*linux*)
4207 LD="${LD-ld} -m elf_s390"
4208 ;;
4209 sparc64-*linux*)
4210 LD="${LD-ld} -m elf32_sparc"
4211 ;;
4212 esac
4213 ;;
4214 *64-bit*)
4215 case $host in
4216 x86_64-*kfreebsd*-gnu)
4217 LD="${LD-ld} -m elf_x86_64_fbsd"
4218 ;;
4219 x86_64-*linux*)
4220 LD="${LD-ld} -m elf_x86_64"
4221 ;;
4222 powerpcle-*linux*)
4223 LD="${LD-ld} -m elf64lppc"
4224 ;;
4225 powerpc-*linux*)
4226 LD="${LD-ld} -m elf64ppc"
4227 ;;
4228 s390*-*linux*|s390*-*tpf*)
4229 LD="${LD-ld} -m elf64_s390"
4230 ;;
4231 sparc*-*linux*)
4232 LD="${LD-ld} -m elf64_sparc"
4233 ;;
4234 esac
4235 ;;
4236 esac
4237 fi
4238 rm -rf conftest*
4239 ;;
4240
4241 *-*-sco3.2v5*)
4242 # On SCO OpenServer 5, we need -belf to get full-featured binaries.
4243 SAVE_CFLAGS=$CFLAGS
4244 CFLAGS="$CFLAGS -belf"
4245 AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
4246 [AC_LANG_PUSH(C)
4247 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
4248 AC_LANG_POP])
4249 if test yes != "$lt_cv_cc_needs_belf"; then
4250 # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
4251 CFLAGS=$SAVE_CFLAGS
4252 fi
4253 ;;
4254 *-*solaris*)
4255 # Find out what ABI is being produced by ac_compile, and set linker
4256 # options accordingly.
4257 echo 'int i;' > conftest.$ac_ext
4258 if AC_TRY_EVAL(ac_compile); then
4259 case `/usr/bin/file conftest.o` in
4260 *64-bit*)
4261 case $lt_cv_prog_gnu_ld in
4262 yes*)
4263 case $host in
4264 i?86-*-solaris*|x86_64-*-solaris*)
4265 LD="${LD-ld} -m elf_x86_64"
4266 ;;
4267 sparc*-*-solaris*)
4268 LD="${LD-ld} -m elf64_sparc"
4269 ;;
4270 esac
4271 # GNU ld 2.21 introduced _sol2 emulations. Use them if available.
4272 if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
4273 LD=${LD-ld}_sol2
4274 fi
4275 ;;
4276 *)
4277 if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
4278 LD="${LD-ld} -64"
4279 fi
4280 ;;
4281 esac
4282 ;;
4283 esac
4284 fi
4285 rm -rf conftest*
4286 ;;
4287 esac
4288
4289 need_locks=$enable_libtool_lock
4290 ])# _LT_ENABLE_LOCK
4291
4292
4293 # _LT_PROG_AR
4294 # -----------
4295 m4_defun([_LT_PROG_AR],
4296 [AC_CHECK_TOOLS(AR, [ar], false)
4297 : ${AR=ar}
4298 : ${AR_FLAGS=cru}
4299 _LT_DECL([], [AR], [1], [The archiver])
4300 _LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive])
4301
4302 AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
4303 [lt_cv_ar_at_file=no
4304 AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
4305 [echo conftest.$ac_objext > conftest.lst
4306 lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD'
4307 AC_TRY_EVAL([lt_ar_try])
4308 if test 0 -eq "$ac_status"; then
4309 # Ensure the archiver fails upon bogus file names.
4310 rm -f conftest.$ac_objext libconftest.a
4311 AC_TRY_EVAL([lt_ar_try])
4312 if test 0 -ne "$ac_status"; then
4313 lt_cv_ar_at_file=@
4314 fi
4315 fi
4316 rm -f conftest.* libconftest.a
4317 ])
4318 ])
4319
4320 if test no = "$lt_cv_ar_at_file"; then
4321 archiver_list_spec=
4322 else
4323 archiver_list_spec=$lt_cv_ar_at_file
4324 fi
4325 _LT_DECL([], [archiver_list_spec], [1],
4326 [How to feed a file listing to the archiver])
4327 ])# _LT_PROG_AR
4328
4329
4330 # _LT_CMD_OLD_ARCHIVE
4331 # -------------------
4332 m4_defun([_LT_CMD_OLD_ARCHIVE],
4333 [_LT_PROG_AR
4334
4335 AC_CHECK_TOOL(STRIP, strip, :)
4336 test -z "$STRIP" && STRIP=:
4337 _LT_DECL([], [STRIP], [1], [A symbol stripping program])
4338
4339 AC_CHECK_TOOL(RANLIB, ranlib, :)
4340 test -z "$RANLIB" && RANLIB=:
4341 _LT_DECL([], [RANLIB], [1],
4342 [Commands used to install an old-style archive])
4343
4344 # Determine commands to create old-style static archives.
4345 old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
4346 old_postinstall_cmds='chmod 644 $oldlib'
4347 old_postuninstall_cmds=
4348
4349 if test -n "$RANLIB"; then
4350 case $host_os in
4351 bitrig* | openbsd*)
4352 old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
4353 ;;
4354 *)
4355 old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
4356 ;;
4357 esac
4358 old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
4359 fi
4360
4361 case $host_os in
4362 darwin*)
4363 lock_old_archive_extraction=yes ;;
4364 *)
4365 lock_old_archive_extraction=no ;;
4366 esac
4367 _LT_DECL([], [old_postinstall_cmds], [2])
4368 _LT_DECL([], [old_postuninstall_cmds], [2])
4369 _LT_TAGDECL([], [old_archive_cmds], [2],
4370 [Commands used to build an old-style archive])
4371 _LT_DECL([], [lock_old_archive_extraction], [0],
4372 [Whether to use a lock for old archive extraction])
4373 ])# _LT_CMD_OLD_ARCHIVE
4374
4375
4376 # _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
4377 # [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
4378 # ----------------------------------------------------------------
4379 # Check whether the given compiler option works
4380 AC_DEFUN([_LT_COMPILER_OPTION],
4381 [m4_require([_LT_FILEUTILS_DEFAULTS])dnl
4382 m4_require([_LT_DECL_SED])dnl
4383 AC_CACHE_CHECK([$1], [$2],
4384 [$2=no
4385 m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
4386 echo "$lt_simple_compile_test_code" > conftest.$ac_ext
4387 lt_compiler_flag="$3" ## exclude from sc_useless_quotes_in_assignment
4388 # Insert the option either (1) after the last *FLAGS variable, or
4389 # (2) before a word containing "conftest.", or (3) at the end.
4390 # Note that $ac_compile itself does not contain backslashes and begins
4391 # with a dollar sign (not a hyphen), so the echo should work correctly.
4392 # The option is referenced via a variable to avoid confusing sed.
4393 lt_compile=`echo "$ac_compile" | $SED \
4394 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
4395 -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
4396 -e 's:$: $lt_compiler_flag:'`
4397 (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
4398 (eval "$lt_compile" 2>conftest.err)
4399 ac_status=$?
4400 cat conftest.err >&AS_MESSAGE_LOG_FD
4401 echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
4402 if (exit $ac_status) && test -s "$ac_outfile"; then
4403 # The compiler can only warn and ignore the option if not recognized
4404 # So say no if there are warnings other than the usual output.
4405 $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
4406 $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
4407 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
4408 $2=yes
4409 fi
4410 fi
4411 $RM conftest*
4412 ])
4413
4414 if test yes = "[$]$2"; then
4415 m4_if([$5], , :, [$5])
4416 else
4417 m4_if([$6], , :, [$6])
4418 fi
4419 ])# _LT_COMPILER_OPTION
4420
4421 # Old name:
4422 AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
4423 dnl aclocal-1.4 backwards compatibility:
4424 dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
4425
4426
4427 # _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
4428 # [ACTION-SUCCESS], [ACTION-FAILURE])
4429 # ----------------------------------------------------
4430 # Check whether the given linker option works
4431 AC_DEFUN([_LT_LINKER_OPTION],
4432 [m4_require([_LT_FILEUTILS_DEFAULTS])dnl
4433 m4_require([_LT_DECL_SED])dnl
4434 AC_CACHE_CHECK([$1], [$2],
4435 [$2=no
4436 save_LDFLAGS=$LDFLAGS
4437 LDFLAGS="$LDFLAGS $3"
4438 echo "$lt_simple_link_test_code" > conftest.$ac_ext
4439 if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
4440 # The linker can only warn and ignore the option if not recognized
4441 # So say no if there are warnings
4442 if test -s conftest.err; then
4443 # Append any errors to the config.log.
4444 cat conftest.err 1>&AS_MESSAGE_LOG_FD
4445 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
4446 $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
4447 if diff conftest.exp conftest.er2 >/dev/null; then
4448 $2=yes
4449 fi
4450 else
4451 $2=yes
4452 fi
4453 fi
4454 $RM -r conftest*
4455 LDFLAGS=$save_LDFLAGS
4456 ])
4457
4458 if test yes = "[$]$2"; then
4459 m4_if([$4], , :, [$4])
4460 else
4461 m4_if([$5], , :, [$5])
4462 fi
4463 ])# _LT_LINKER_OPTION
4464
4465 # Old name:
4466 AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
4467 dnl aclocal-1.4 backwards compatibility:
4468 dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
4469
4470
4471 # LT_CMD_MAX_LEN
4472 #---------------
4473 AC_DEFUN([LT_CMD_MAX_LEN],
4474 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
4475 # find the maximum length of command line arguments
4476 AC_MSG_CHECKING([the maximum length of command line arguments])
4477 AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
4478 i=0
4479 teststring=ABCD
4480
4481 case $build_os in
4482 msdosdjgpp*)
4483 # On DJGPP, this test can blow up pretty badly due to problems in libc
4484 # (any single argument exceeding 2000 bytes causes a buffer overrun
4485 # during glob expansion). Even if it were fixed, the result of this
4486 # check would be larger than it should be.
4487 lt_cv_sys_max_cmd_len=12288; # 12K is about right
4488 ;;
4489
4490 gnu*)
4491 # Under GNU Hurd, this test is not required because there is
4492 # no limit to the length of command line arguments.
4493 # Libtool will interpret -1 as no limit whatsoever
4494 lt_cv_sys_max_cmd_len=-1;
4495 ;;
4496
4497 cygwin* | mingw* | cegcc*)
4498 # On Win9x/ME, this test blows up -- it succeeds, but takes
4499 # about 5 minutes as the teststring grows exponentially.
4500 # Worse, since 9x/ME are not pre-emptively multitasking,
4501 # you end up with a "frozen" computer, even though with patience
4502 # the test eventually succeeds (with a max line length of 256k).
4503 # Instead, let's just punt: use the minimum linelength reported by
4504 # all of the supported platforms: 8192 (on NT/2K/XP).
4505 lt_cv_sys_max_cmd_len=8192;
4506 ;;
4507
4508 mint*)
4509 # On MiNT this can take a long time and run out of memory.
4510 lt_cv_sys_max_cmd_len=8192;
4511 ;;
4512
4513 amigaos*)
4514 # On AmigaOS with pdksh, this test takes hours, literally.
4515 # So we just punt and use a minimum line length of 8192.
4516 lt_cv_sys_max_cmd_len=8192;
4517 ;;
4518
4519 bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*)
4520 # This has been around since 386BSD, at least. Likely further.
4521 if test -x /sbin/sysctl; then
4522 lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
4523 elif test -x /usr/sbin/sysctl; then
4524 lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
4525 else
4526 lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs
4527 fi
4528 # And add a safety zone
4529 lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
4530 lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
4531 ;;
4532
4533 interix*)
4534 # We know the value 262144 and hardcode it with a safety zone (like BSD)
4535 lt_cv_sys_max_cmd_len=196608
4536 ;;
4537
4538 os2*)
4539 # The test takes a long time on OS/2.
4540 lt_cv_sys_max_cmd_len=8192
4541 ;;
4542
4543 osf*)
4544 # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
4545 # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
4546 # nice to cause kernel panics so lets avoid the loop below.
4547 # First set a reasonable default.
4548 lt_cv_sys_max_cmd_len=16384
4549 #
4550 if test -x /sbin/sysconfig; then
4551 case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
4552 *1*) lt_cv_sys_max_cmd_len=-1 ;;
4553 esac
4554 fi
4555 ;;
4556 sco3.2v5*)
4557 lt_cv_sys_max_cmd_len=102400
4558 ;;
4559 sysv5* | sco5v6* | sysv4.2uw2*)
4560 kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
4561 if test -n "$kargmax"; then
4562 lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'`
4563 else
4564 lt_cv_sys_max_cmd_len=32768
4565 fi
4566 ;;
4567 *)
4568 lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
4569 if test -n "$lt_cv_sys_max_cmd_len" && \
4570 test undefined != "$lt_cv_sys_max_cmd_len"; then
4571 lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
4572 lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
4573 else
4574 # Make teststring a little bigger before we do anything with it.
4575 # a 1K string should be a reasonable start.
4576 for i in 1 2 3 4 5 6 7 8; do
4577 teststring=$teststring$teststring
4578 done
4579 SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
4580 # If test is not a shell built-in, we'll probably end up computing a
4581 # maximum length that is only half of the actual maximum length, but
4582 # we can't tell.
4583 while { test X`env echo "$teststring$teststring" 2>/dev/null` \
4584 = "X$teststring$teststring"; } >/dev/null 2>&1 &&
4585 test 17 != "$i" # 1/2 MB should be enough
4586 do
4587 i=`expr $i + 1`
4588 teststring=$teststring$teststring
4589 done
4590 # Only check the string length outside the loop.
4591 lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
4592 teststring=
4593 # Add a significant safety factor because C++ compilers can tack on
4594 # massive amounts of additional arguments before passing them to the
4595 # linker. It appears as though 1/2 is a usable value.
4596 lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
4597 fi
4598 ;;
4599 esac
4600 ])
4601 if test -n "$lt_cv_sys_max_cmd_len"; then
4602 AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
4603 else
4604 AC_MSG_RESULT(none)
4605 fi
4606 max_cmd_len=$lt_cv_sys_max_cmd_len
4607 _LT_DECL([], [max_cmd_len], [0],
4608 [What is the maximum length of a command?])
4609 ])# LT_CMD_MAX_LEN
4610
4611 # Old name:
4612 AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
4613 dnl aclocal-1.4 backwards compatibility:
4614 dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
4615
4616
4617 # _LT_HEADER_DLFCN
4618 # ----------------
4619 m4_defun([_LT_HEADER_DLFCN],
4620 [AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
4621 ])# _LT_HEADER_DLFCN
4622
4623
4624 # _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
4625 # ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
4626 # ----------------------------------------------------------------
4627 m4_defun([_LT_TRY_DLOPEN_SELF],
4628 [m4_require([_LT_HEADER_DLFCN])dnl
4629 if test yes = "$cross_compiling"; then :
4630 [$4]
4631 else
4632 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
4633 lt_status=$lt_dlunknown
4634 cat > conftest.$ac_ext <<_LT_EOF
4635 [#line $LINENO "configure"
4636 #include "confdefs.h"
4637
4638 #if HAVE_DLFCN_H
4639 #include <dlfcn.h>
4640 #endif
4641
4642 #include <stdio.h>
4643
4644 #ifdef RTLD_GLOBAL
4645 # define LT_DLGLOBAL RTLD_GLOBAL
4646 #else
4647 # ifdef DL_GLOBAL
4648 # define LT_DLGLOBAL DL_GLOBAL
4649 # else
4650 # define LT_DLGLOBAL 0
4651 # endif
4652 #endif
4653
4654 /* We may have to define LT_DLLAZY_OR_NOW in the command line if we
4655 find out it does not work in some platform. */
4656 #ifndef LT_DLLAZY_OR_NOW
4657 # ifdef RTLD_LAZY
4658 # define LT_DLLAZY_OR_NOW RTLD_LAZY
4659 # else
4660 # ifdef DL_LAZY
4661 # define LT_DLLAZY_OR_NOW DL_LAZY
4662 # else
4663 # ifdef RTLD_NOW
4664 # define LT_DLLAZY_OR_NOW RTLD_NOW
4665 # else
4666 # ifdef DL_NOW
4667 # define LT_DLLAZY_OR_NOW DL_NOW
4668 # else
4669 # define LT_DLLAZY_OR_NOW 0
4670 # endif
4671 # endif
4672 # endif
4673 # endif
4674 #endif
4675
4676 /* When -fvisibility=hidden is used, assume the code has been annotated
4677 correspondingly for the symbols needed. */
4678 #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
4679 int fnord () __attribute__((visibility("default")));
4680 #endif
4681
4682 int fnord () { return 42; }
4683 int main ()
4684 {
4685 void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
4686 int status = $lt_dlunknown;
4687
4688 if (self)
4689 {
4690 if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
4691 else
4692 {
4693 if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
4694 else puts (dlerror ());
4695 }
4696 /* dlclose (self); */
4697 }
4698 else
4699 puts (dlerror ());
4700
4701 return status;
4702 }]
4703 _LT_EOF
4704 if AC_TRY_EVAL(ac_link) && test -s "conftest$ac_exeext" 2>/dev/null; then
4705 (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
4706 lt_status=$?
4707 case x$lt_status in
4708 x$lt_dlno_uscore) $1 ;;
4709 x$lt_dlneed_uscore) $2 ;;
4710 x$lt_dlunknown|x*) $3 ;;
4711 esac
4712 else :
4713 # compilation failed
4714 $3
4715 fi
4716 fi
4717 rm -fr conftest*
4718 ])# _LT_TRY_DLOPEN_SELF
4719
4720
4721 # LT_SYS_DLOPEN_SELF
4722 # ------------------
4723 AC_DEFUN([LT_SYS_DLOPEN_SELF],
4724 [m4_require([_LT_HEADER_DLFCN])dnl
4725 if test yes != "$enable_dlopen"; then
4726 enable_dlopen=unknown
4727 enable_dlopen_self=unknown
4728 enable_dlopen_self_static=unknown
4729 else
4730 lt_cv_dlopen=no
4731 lt_cv_dlopen_libs=
4732
4733 case $host_os in
4734 beos*)
4735 lt_cv_dlopen=load_add_on
4736 lt_cv_dlopen_libs=
4737 lt_cv_dlopen_self=yes
4738 ;;
4739
4740 mingw* | pw32* | cegcc*)
4741 lt_cv_dlopen=LoadLibrary
4742 lt_cv_dlopen_libs=
4743 ;;
4744
4745 cygwin*)
4746 lt_cv_dlopen=dlopen
4747 lt_cv_dlopen_libs=
4748 ;;
4749
4750 darwin*)
4751 # if libdl is installed we need to link against it
4752 AC_CHECK_LIB([dl], [dlopen],
4753 [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],[
4754 lt_cv_dlopen=dyld
4755 lt_cv_dlopen_libs=
4756 lt_cv_dlopen_self=yes
4757 ])
4758 ;;
4759
4760 tpf*)
4761 # Don't try to run any link tests for TPF. We know it's impossible
4762 # because TPF is a cross-compiler, and we know how we open DSOs.
4763 lt_cv_dlopen=dlopen
4764 lt_cv_dlopen_libs=
4765 lt_cv_dlopen_self=no
4766 ;;
4767
4768 *)
4769 AC_CHECK_FUNC([shl_load],
4770 [lt_cv_dlopen=shl_load],
4771 [AC_CHECK_LIB([dld], [shl_load],
4772 [lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld],
4773 [AC_CHECK_FUNC([dlopen],
4774 [lt_cv_dlopen=dlopen],
4775 [AC_CHECK_LIB([dl], [dlopen],
4776 [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],
4777 [AC_CHECK_LIB([svld], [dlopen],
4778 [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld],
4779 [AC_CHECK_LIB([dld], [dld_link],
4780 [lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld])
4781 ])
4782 ])
4783 ])
4784 ])
4785 ])
4786 ;;
4787 esac
4788
4789 if test no = "$lt_cv_dlopen"; then
4790 enable_dlopen=no
4791 else
4792 enable_dlopen=yes
4793 fi
4794
4795 case $lt_cv_dlopen in
4796 dlopen)
4797 save_CPPFLAGS=$CPPFLAGS
4798 test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
4799
4800 save_LDFLAGS=$LDFLAGS
4801 wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
4802
4803 save_LIBS=$LIBS
4804 LIBS="$lt_cv_dlopen_libs $LIBS"
4805
4806 AC_CACHE_CHECK([whether a program can dlopen itself],
4807 lt_cv_dlopen_self, [dnl
4808 _LT_TRY_DLOPEN_SELF(
4809 lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
4810 lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
4811 ])
4812
4813 if test yes = "$lt_cv_dlopen_self"; then
4814 wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
4815 AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
4816 lt_cv_dlopen_self_static, [dnl
4817 _LT_TRY_DLOPEN_SELF(
4818 lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
4819 lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross)
4820 ])
4821 fi
4822
4823 CPPFLAGS=$save_CPPFLAGS
4824 LDFLAGS=$save_LDFLAGS
4825 LIBS=$save_LIBS
4826 ;;
4827 esac
4828
4829 case $lt_cv_dlopen_self in
4830 yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
4831 *) enable_dlopen_self=unknown ;;
4832 esac
4833
4834 case $lt_cv_dlopen_self_static in
4835 yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
4836 *) enable_dlopen_self_static=unknown ;;
4837 esac
4838 fi
4839 _LT_DECL([dlopen_support], [enable_dlopen], [0],
4840 [Whether dlopen is supported])
4841 _LT_DECL([dlopen_self], [enable_dlopen_self], [0],
4842 [Whether dlopen of programs is supported])
4843 _LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
4844 [Whether dlopen of statically linked programs is supported])
4845 ])# LT_SYS_DLOPEN_SELF
4846
4847 # Old name:
4848 AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
4849 dnl aclocal-1.4 backwards compatibility:
4850 dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
4851
4852
4853 # _LT_COMPILER_C_O([TAGNAME])
4854 # ---------------------------
4855 # Check to see if options -c and -o are simultaneously supported by compiler.
4856 # This macro does not hard code the compiler like AC_PROG_CC_C_O.
4857 m4_defun([_LT_COMPILER_C_O],
4858 [m4_require([_LT_DECL_SED])dnl
4859 m4_require([_LT_FILEUTILS_DEFAULTS])dnl
4860 m4_require([_LT_TAG_COMPILER])dnl
4861 AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
4862 [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
4863 [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
4864 $RM -r conftest 2>/dev/null
4865 mkdir conftest
4866 cd conftest
4867 mkdir out
4868 echo "$lt_simple_compile_test_code" > conftest.$ac_ext
4869
4870 lt_compiler_flag="-o out/conftest2.$ac_objext"
4871 # Insert the option either (1) after the last *FLAGS variable, or
4872 # (2) before a word containing "conftest.", or (3) at the end.
4873 # Note that $ac_compile itself does not contain backslashes and begins
4874 # with a dollar sign (not a hyphen), so the echo should work correctly.
4875 lt_compile=`echo "$ac_compile" | $SED \
4876 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
4877 -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
4878 -e 's:$: $lt_compiler_flag:'`
4879 (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
4880 (eval "$lt_compile" 2>out/conftest.err)
4881 ac_status=$?
4882 cat out/conftest.err >&AS_MESSAGE_LOG_FD
4883 echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
4884 if (exit $ac_status) && test -s out/conftest2.$ac_objext
4885 then
4886 # The compiler can only warn and ignore the option if not recognized
4887 # So say no if there are warnings
4888 $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
4889 $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
4890 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
4891 _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
4892 fi
4893 fi
4894 chmod u+w . 2>&AS_MESSAGE_LOG_FD
4895 $RM conftest*
4896 # SGI C++ compiler will create directory out/ii_files/ for
4897 # template instantiation
4898 test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
4899 $RM out/* && rmdir out
4900 cd ..
4901 $RM -r conftest
4902 $RM conftest*
4903 ])
4904 _LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
4905 [Does compiler simultaneously support -c and -o options?])
4906 ])# _LT_COMPILER_C_O
4907
4908
4909 # _LT_COMPILER_FILE_LOCKS([TAGNAME])
4910 # ----------------------------------
4911 # Check to see if we can do hard links to lock some files if needed
4912 m4_defun([_LT_COMPILER_FILE_LOCKS],
4913 [m4_require([_LT_ENABLE_LOCK])dnl
4914 m4_require([_LT_FILEUTILS_DEFAULTS])dnl
4915 _LT_COMPILER_C_O([$1])
4916
4917 hard_links=nottested
4918 if test no = "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" && test no != "$need_locks"; then
4919 # do not overwrite the value of need_locks provided by the user
4920 AC_MSG_CHECKING([if we can lock with hard links])
4921 hard_links=yes
4922 $RM conftest*
4923 ln conftest.a conftest.b 2>/dev/null && hard_links=no
4924 touch conftest.a
4925 ln conftest.a conftest.b 2>&5 || hard_links=no
4926 ln conftest.a conftest.b 2>/dev/null && hard_links=no
4927 AC_MSG_RESULT([$hard_links])
4928 if test no = "$hard_links"; then
4929 AC_MSG_WARN(['$CC' does not support '-c -o', so 'make -j' may be unsafe])
4930 need_locks=warn
4931 fi
4932 else
4933 need_locks=no
4934 fi
4935 _LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
4936 ])# _LT_COMPILER_FILE_LOCKS
4937
4938
4939 # _LT_CHECK_OBJDIR
4940 # ----------------
4941 m4_defun([_LT_CHECK_OBJDIR],
4942 [AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
4943 [rm -f .libs 2>/dev/null
4944 mkdir .libs 2>/dev/null
4945 if test -d .libs; then
4946 lt_cv_objdir=.libs
4947 else
4948 # MS-DOS does not allow filenames that begin with a dot.
4949 lt_cv_objdir=_libs
4950 fi
4951 rmdir .libs 2>/dev/null])
4952 objdir=$lt_cv_objdir
4953 _LT_DECL([], [objdir], [0],
4954 [The name of the directory that contains temporary libtool files])dnl
4955 m4_pattern_allow([LT_OBJDIR])dnl
4956 AC_DEFINE_UNQUOTED([LT_OBJDIR], "$lt_cv_objdir/",
4957 [Define to the sub-directory where libtool stores uninstalled libraries.])
4958 ])# _LT_CHECK_OBJDIR
4959
4960
4961 # _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
4962 # --------------------------------------
4963 # Check hardcoding attributes.
4964 m4_defun([_LT_LINKER_HARDCODE_LIBPATH],
4965 [AC_MSG_CHECKING([how to hardcode library paths into programs])
4966 _LT_TAGVAR(hardcode_action, $1)=
4967 if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
4968 test -n "$_LT_TAGVAR(runpath_var, $1)" ||
4969 test yes = "$_LT_TAGVAR(hardcode_automatic, $1)"; then
4970
4971 # We can hardcode non-existent directories.
4972 if test no != "$_LT_TAGVAR(hardcode_direct, $1)" &&
4973 # If the only mechanism to avoid hardcoding is shlibpath_var, we
4974 # have to relink, otherwise we might link with an installed library
4975 # when we should be linking with a yet-to-be-installed one
4976 ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" &&
4977 test no != "$_LT_TAGVAR(hardcode_minus_L, $1)"; then
4978 # Linking always hardcodes the temporary library directory.
4979 _LT_TAGVAR(hardcode_action, $1)=relink
4980 else
4981 # We can link without hardcoding, and we can hardcode nonexisting dirs.
4982 _LT_TAGVAR(hardcode_action, $1)=immediate
4983 fi
4984 else
4985 # We cannot hardcode anything, or else we can only hardcode existing
4986 # directories.
4987 _LT_TAGVAR(hardcode_action, $1)=unsupported
4988 fi
4989 AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
4990
4991 if test relink = "$_LT_TAGVAR(hardcode_action, $1)" ||
4992 test yes = "$_LT_TAGVAR(inherit_rpath, $1)"; then
4993 # Fast installation is not supported
4994 enable_fast_install=no
4995 elif test yes = "$shlibpath_overrides_runpath" ||
4996 test no = "$enable_shared"; then
4997 # Fast installation is not necessary
4998 enable_fast_install=needless
4999 fi
5000 _LT_TAGDECL([], [hardcode_action], [0],
5001 [How to hardcode a shared library path into an executable])
5002 ])# _LT_LINKER_HARDCODE_LIBPATH
5003
5004
5005 # _LT_CMD_STRIPLIB
5006 # ----------------
5007 m4_defun([_LT_CMD_STRIPLIB],
5008 [m4_require([_LT_DECL_EGREP])
5009 striplib=
5010 old_striplib=
5011 AC_MSG_CHECKING([whether stripping libraries is possible])
5012 if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
5013 test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
5014 test -z "$striplib" && striplib="$STRIP --strip-unneeded"
5015 AC_MSG_RESULT([yes])
5016 else
5017 # FIXME - insert some real tests, host_os isn't really good enough
5018 case $host_os in
5019 darwin*)
5020 if test -n "$STRIP"; then
5021 striplib="$STRIP -x"
5022 old_striplib="$STRIP -S"
5023 AC_MSG_RESULT([yes])
5024 else
5025 AC_MSG_RESULT([no])
5026 fi
5027 ;;
5028 *)
5029 AC_MSG_RESULT([no])
5030 ;;
5031 esac
5032 fi
5033 _LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
5034 _LT_DECL([], [striplib], [1])
5035 ])# _LT_CMD_STRIPLIB
5036
5037
5038 # _LT_PREPARE_MUNGE_PATH_LIST
5039 # ---------------------------
5040 # Make sure func_munge_path_list() is defined correctly.
5041 m4_defun([_LT_PREPARE_MUNGE_PATH_LIST],
5042 [[# func_munge_path_list VARIABLE PATH
5043 # -----------------------------------
5044 # VARIABLE is name of variable containing _space_ separated list of
5045 # directories to be munged by the contents of PATH, which is string
5046 # having a format:
5047 # "DIR[:DIR]:"
5048 # string "DIR[ DIR]" will be prepended to VARIABLE
5049 # ":DIR[:DIR]"
5050 # string "DIR[ DIR]" will be appended to VARIABLE
5051 # "DIRP[:DIRP]::[DIRA:]DIRA"
5052 # string "DIRP[ DIRP]" will be prepended to VARIABLE and string
5053 # "DIRA[ DIRA]" will be appended to VARIABLE
5054 # "DIR[:DIR]"
5055 # VARIABLE will be replaced by "DIR[ DIR]"
5056 func_munge_path_list ()
5057 {
5058 case x@S|@2 in
5059 x)
5060 ;;
5061 *:)
5062 eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'` \@S|@@S|@1\"
5063 ;;
5064 x:*)
5065 eval @S|@1=\"\@S|@@S|@1 `$ECHO @S|@2 | $SED 's/:/ /g'`\"
5066 ;;
5067 *::*)
5068 eval @S|@1=\"\@S|@@S|@1\ `$ECHO @S|@2 | $SED -e 's/.*:://' -e 's/:/ /g'`\"
5069 eval @S|@1=\"`$ECHO @S|@2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \@S|@@S|@1\"
5070 ;;
5071 *)
5072 eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'`\"
5073 ;;
5074 esac
5075 }
5076 ]])# _LT_PREPARE_PATH_LIST
5077
5078
5079 # _LT_SYS_DYNAMIC_LINKER([TAG])
5080 # -----------------------------
5081 # PORTME Fill in your ld.so characteristics
5082 m4_defun([_LT_SYS_DYNAMIC_LINKER],
5083 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
5084 m4_require([_LT_DECL_EGREP])dnl
5085 m4_require([_LT_FILEUTILS_DEFAULTS])dnl
5086 m4_require([_LT_DECL_OBJDUMP])dnl
5087 m4_require([_LT_DECL_SED])dnl
5088 m4_require([_LT_CHECK_SHELL_FEATURES])dnl
5089 m4_require([_LT_PREPARE_MUNGE_PATH_LIST])dnl
5090 AC_MSG_CHECKING([dynamic linker characteristics])
5091 m4_if([$1],
5092 [], [
5093 if test yes = "$GCC"; then
5094 case $host_os in
5095 darwin*) lt_awk_arg='/^libraries:/,/LR/' ;;
5096 *) lt_awk_arg='/^libraries:/' ;;
5097 esac
5098 case $host_os in
5099 mingw* | cegcc*) lt_sed_strip_eq='s|=\([[A-Za-z]]:\)|\1|g' ;;
5100 *) lt_sed_strip_eq='s|=/|/|g' ;;
5101 esac
5102 lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
5103 case $lt_search_path_spec in
5104 *\;*)
5105 # if the path contains ";" then we assume it to be the separator
5106 # otherwise default to the standard path separator (i.e. ":") - it is
5107 # assumed that no part of a normal pathname contains ";" but that should
5108 # okay in the real world where ";" in dirpaths is itself problematic.
5109 lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
5110 ;;
5111 *)
5112 lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
5113 ;;
5114 esac
5115 # Ok, now we have the path, separated by spaces, we can step through it
5116 # and add multilib dir if necessary...
5117 lt_tmp_lt_search_path_spec=
5118 lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
5119 # ...but if some path component already ends with the multilib dir we assume
5120 # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer).
5121 case "$lt_multi_os_dir; $lt_search_path_spec " in
5122 "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*)
5123 lt_multi_os_dir=
5124 ;;
5125 esac
5126 for lt_sys_path in $lt_search_path_spec; do
5127 if test -d "$lt_sys_path$lt_multi_os_dir"; then
5128 lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir"
5129 elif test -n "$lt_multi_os_dir"; then
5130 test -d "$lt_sys_path" && \
5131 lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
5132 fi
5133 done
5134 lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
5135 BEGIN {RS = " "; FS = "/|\n";} {
5136 lt_foo = "";
5137 lt_count = 0;
5138 for (lt_i = NF; lt_i > 0; lt_i--) {
5139 if ($lt_i != "" && $lt_i != ".") {
5140 if ($lt_i == "..") {
5141 lt_count++;
5142 } else {
5143 if (lt_count == 0) {
5144 lt_foo = "/" $lt_i lt_foo;
5145 } else {
5146 lt_count--;
5147 }
5148 }
5149 }
5150 }
5151 if (lt_foo != "") { lt_freq[[lt_foo]]++; }
5152 if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
5153 }'`
5154 # AWK program above erroneously prepends '/' to C:/dos/paths
5155 # for these hosts.
5156 case $host_os in
5157 mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
5158 $SED 's|/\([[A-Za-z]]:\)|\1|g'` ;;
5159 esac
5160 sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
5161 else
5162 sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
5163 fi])
5164 library_names_spec=
5165 libname_spec='lib$name'
5166 soname_spec=
5167 shrext_cmds=.so
5168 postinstall_cmds=
5169 postuninstall_cmds=
5170 finish_cmds=
5171 finish_eval=
5172 shlibpath_var=
5173 shlibpath_overrides_runpath=unknown
5174 version_type=none
5175 dynamic_linker="$host_os ld.so"
5176 sys_lib_dlsearch_path_spec="/lib /usr/lib"
5177 need_lib_prefix=unknown
5178 hardcode_into_libs=no
5179
5180 # when you set need_version to no, make sure it does not cause -set_version
5181 # flags to be left without arguments
5182 need_version=unknown
5183
5184 AC_ARG_VAR([LT_SYS_LIBRARY_PATH],
5185 [User-defined run-time library search path.])
5186
5187 case $host_os in
5188 aix3*)
5189 version_type=linux # correct to gnu/linux during the next big refactor
5190 library_names_spec='$libname$release$shared_ext$versuffix $libname.a'
5191 shlibpath_var=LIBPATH
5192
5193 # AIX 3 has no versioning support, so we append a major version to the name.
5194 soname_spec='$libname$release$shared_ext$major'
5195 ;;
5196
5197 aix[[4-9]]*)
5198 version_type=linux # correct to gnu/linux during the next big refactor
5199 need_lib_prefix=no
5200 need_version=no
5201 hardcode_into_libs=yes
5202 if test ia64 = "$host_cpu"; then
5203 # AIX 5 supports IA64
5204 library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext'
5205 shlibpath_var=LD_LIBRARY_PATH
5206 else
5207 # With GCC up to 2.95.x, collect2 would create an import file
5208 # for dependence libraries. The import file would start with
5209 # the line '#! .'. This would cause the generated library to
5210 # depend on '.', always an invalid library. This was fixed in
5211 # development snapshots of GCC prior to 3.0.
5212 case $host_os in
5213 aix4 | aix4.[[01]] | aix4.[[01]].*)
5214 if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
5215 echo ' yes '
5216 echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then
5217 :
5218 else
5219 can_build_shared=no
5220 fi
5221 ;;
5222 esac
5223 # Using Import Files as archive members, it is possible to support
5224 # filename-based versioning of shared library archives on AIX. While
5225 # this would work for both with and without runtime linking, it will
5226 # prevent static linking of such archives. So we do filename-based
5227 # shared library versioning with .so extension only, which is used
5228 # when both runtime linking and shared linking is enabled.
5229 # Unfortunately, runtime linking may impact performance, so we do
5230 # not want this to be the default eventually. Also, we use the
5231 # versioned .so libs for executables only if there is the -brtl
5232 # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only.
5233 # To allow for filename-based versioning support, we need to create
5234 # libNAME.so.V as an archive file, containing:
5235 # *) an Import File, referring to the versioned filename of the
5236 # archive as well as the shared archive member, telling the
5237 # bitwidth (32 or 64) of that shared object, and providing the
5238 # list of exported symbols of that shared object, eventually
5239 # decorated with the 'weak' keyword
5240 # *) the shared object with the F_LOADONLY flag set, to really avoid
5241 # it being seen by the linker.
5242 # At run time we better use the real file rather than another symlink,
5243 # but for link time we create the symlink libNAME.so -> libNAME.so.V
5244
5245 case $with_aix_soname,$aix_use_runtimelinking in
5246 # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct
5247 # soname into executable. Probably we can add versioning support to
5248 # collect2, so additional links can be useful in future.
5249 aix,yes) # traditional libtool
5250 dynamic_linker='AIX unversionable lib.so'
5251 # If using run time linking (on AIX 4.2 or later) use lib<name>.so
5252 # instead of lib<name>.a to let people know that these are not
5253 # typical AIX shared libraries.
5254 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
5255 ;;
5256 aix,no) # traditional AIX only
5257 dynamic_linker='AIX lib.a[(]lib.so.V[)]'
5258 # We preserve .a as extension for shared libraries through AIX4.2
5259 # and later when we are not doing run time linking.
5260 library_names_spec='$libname$release.a $libname.a'
5261 soname_spec='$libname$release$shared_ext$major'
5262 ;;
5263 svr4,*) # full svr4 only
5264 dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)]"
5265 library_names_spec='$libname$release$shared_ext$major $libname$shared_ext'
5266 # We do not specify a path in Import Files, so LIBPATH fires.
5267 shlibpath_overrides_runpath=yes
5268 ;;
5269 *,yes) # both, prefer svr4
5270 dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)], lib.a[(]lib.so.V[)]"
5271 library_names_spec='$libname$release$shared_ext$major $libname$shared_ext'
5272 # unpreferred sharedlib libNAME.a needs extra handling
5273 postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"'
5274 postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"'
5275 # We do not specify a path in Import Files, so LIBPATH fires.
5276 shlibpath_overrides_runpath=yes
5277 ;;
5278 *,no) # both, prefer aix
5279 dynamic_linker="AIX lib.a[(]lib.so.V[)], lib.so.V[(]$shared_archive_member_spec.o[)]"
5280 library_names_spec='$libname$release.a $libname.a'
5281 soname_spec='$libname$release$shared_ext$major'
5282 # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling
5283 postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)'
5284 postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"'
5285 ;;
5286 esac
5287 shlibpath_var=LIBPATH
5288 fi
5289 ;;
5290
5291 amigaos*)
5292 case $host_cpu in
5293 powerpc)
5294 # Since July 2007 AmigaOS4 officially supports .so libraries.
5295 # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
5296 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
5297 ;;
5298 m68k)
5299 library_names_spec='$libname.ixlibrary $libname.a'
5300 # Create ${libname}_ixlibrary.a entries in /sys/libs.
5301 finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
5302 ;;
5303 esac
5304 ;;
5305
5306 beos*)
5307 library_names_spec='$libname$shared_ext'
5308 dynamic_linker="$host_os ld.so"
5309 shlibpath_var=LIBRARY_PATH
5310 ;;
5311
5312 bsdi[[45]]*)
5313 version_type=linux # correct to gnu/linux during the next big refactor
5314 need_version=no
5315 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
5316 soname_spec='$libname$release$shared_ext$major'
5317 finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
5318 shlibpath_var=LD_LIBRARY_PATH
5319 sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
5320 sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
5321 # the default ld.so.conf also contains /usr/contrib/lib and
5322 # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
5323 # libtool to hard-code these into programs
5324 ;;
5325
5326 cygwin* | mingw* | pw32* | cegcc*)
5327 version_type=windows
5328 shrext_cmds=.dll
5329 need_version=no
5330 need_lib_prefix=no
5331
5332 case $GCC,$cc_basename in
5333 yes,*)
5334 # gcc
5335 library_names_spec='$libname.dll.a'
5336 # DLL is installed to $(libdir)/../bin by postinstall_cmds
5337 postinstall_cmds='base_file=`basename \$file`~
5338 dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
5339 dldir=$destdir/`dirname \$dlpath`~
5340 test -d \$dldir || mkdir -p \$dldir~
5341 $install_prog $dir/$dlname \$dldir/$dlname~
5342 chmod a+x \$dldir/$dlname~
5343 if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
5344 eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
5345 fi'
5346 postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
5347 dlpath=$dir/\$dldll~
5348 $RM \$dlpath'
5349 shlibpath_overrides_runpath=yes
5350
5351 case $host_os in
5352 cygwin*)
5353 # Cygwin DLLs use 'cyg' prefix rather than 'lib'
5354 soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
5355 m4_if([$1], [],[
5356 sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
5357 ;;
5358 mingw* | cegcc*)
5359 # MinGW DLLs use traditional 'lib' prefix
5360 soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
5361 ;;
5362 pw32*)
5363 # pw32 DLLs use 'pw' prefix rather than 'lib'
5364 library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
5365 ;;
5366 esac
5367 dynamic_linker='Win32 ld.exe'
5368 ;;
5369
5370 *,cl*)
5371 # Native MSVC
5372 libname_spec='$name'
5373 soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
5374 library_names_spec='$libname.dll.lib'
5375
5376 case $build_os in
5377 mingw*)
5378 sys_lib_search_path_spec=
5379 lt_save_ifs=$IFS
5380 IFS=';'
5381 for lt_path in $LIB
5382 do
5383 IFS=$lt_save_ifs
5384 # Let DOS variable expansion print the short 8.3 style file name.
5385 lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
5386 sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
5387 done
5388 IFS=$lt_save_ifs
5389 # Convert to MSYS style.
5390 sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'`
5391 ;;
5392 cygwin*)
5393 # Convert to unix form, then to dos form, then back to unix form
5394 # but this time dos style (no spaces!) so that the unix form looks
5395 # like /cygdrive/c/PROGRA~1:/cygdr...
5396 sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
5397 sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
5398 sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
5399 ;;
5400 *)
5401 sys_lib_search_path_spec=$LIB
5402 if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
5403 # It is most probably a Windows format PATH.
5404 sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
5405 else
5406 sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
5407 fi
5408 # FIXME: find the short name or the path components, as spaces are
5409 # common. (e.g. "Program Files" -> "PROGRA~1")
5410 ;;
5411 esac
5412
5413 # DLL is installed to $(libdir)/../bin by postinstall_cmds
5414 postinstall_cmds='base_file=`basename \$file`~
5415 dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
5416 dldir=$destdir/`dirname \$dlpath`~
5417 test -d \$dldir || mkdir -p \$dldir~
5418 $install_prog $dir/$dlname \$dldir/$dlname'
5419 postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
5420 dlpath=$dir/\$dldll~
5421 $RM \$dlpath'
5422 shlibpath_overrides_runpath=yes
5423 dynamic_linker='Win32 link.exe'
5424 ;;
5425
5426 *)
5427 # Assume MSVC wrapper
5428 library_names_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext $libname.lib'
5429 dynamic_linker='Win32 ld.exe'
5430 ;;
5431 esac
5432 # FIXME: first we should search . and the directory the executable is in
5433 shlibpath_var=PATH
5434 ;;
5435
5436 darwin* | rhapsody*)
5437 dynamic_linker="$host_os dyld"
5438 version_type=darwin
5439 need_lib_prefix=no
5440 need_version=no
5441 library_names_spec='$libname$release$major$shared_ext $libname$shared_ext'
5442 soname_spec='$libname$release$major$shared_ext'
5443 shlibpath_overrides_runpath=yes
5444 shlibpath_var=DYLD_LIBRARY_PATH
5445 shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
5446 m4_if([$1], [],[
5447 sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
5448 sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
5449 ;;
5450
5451 dgux*)
5452 version_type=linux # correct to gnu/linux during the next big refactor
5453 need_lib_prefix=no
5454 need_version=no
5455 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
5456 soname_spec='$libname$release$shared_ext$major'
5457 shlibpath_var=LD_LIBRARY_PATH
5458 ;;
5459
5460 freebsd* | dragonfly*)
5461 # DragonFly does not have aout. When/if they implement a new
5462 # versioning mechanism, adjust this.
5463 if test -x /usr/bin/objformat; then
5464 objformat=`/usr/bin/objformat`
5465 else
5466 case $host_os in
5467 freebsd[[23]].*) objformat=aout ;;
5468 *) objformat=elf ;;
5469 esac
5470 fi
5471 version_type=freebsd-$objformat
5472 case $version_type in
5473 freebsd-elf*)
5474 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
5475 soname_spec='$libname$release$shared_ext$major'
5476 need_version=no
5477 need_lib_prefix=no
5478 ;;
5479 freebsd-*)
5480 library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
5481 need_version=yes
5482 ;;
5483 esac
5484 shlibpath_var=LD_LIBRARY_PATH
5485 case $host_os in
5486 freebsd2.*)
5487 shlibpath_overrides_runpath=yes
5488 ;;
5489 freebsd3.[[01]]* | freebsdelf3.[[01]]*)
5490 shlibpath_overrides_runpath=yes
5491 hardcode_into_libs=yes
5492 ;;
5493 freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
5494 freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
5495 shlibpath_overrides_runpath=no
5496 hardcode_into_libs=yes
5497 ;;
5498 *) # from 4.6 on, and DragonFly
5499 shlibpath_overrides_runpath=yes
5500 hardcode_into_libs=yes
5501 ;;
5502 esac
5503 ;;
5504
5505 haiku*)
5506 version_type=linux # correct to gnu/linux during the next big refactor
5507 need_lib_prefix=no
5508 need_version=no
5509 dynamic_linker="$host_os runtime_loader"
5510 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
5511 soname_spec='$libname$release$shared_ext$major'
5512 shlibpath_var=LIBRARY_PATH
5513 shlibpath_overrides_runpath=no
5514 sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
5515 hardcode_into_libs=yes
5516 ;;
5517
5518 hpux9* | hpux10* | hpux11*)
5519 # Give a soname corresponding to the major version so that dld.sl refuses to
5520 # link against other versions.
5521 version_type=sunos
5522 need_lib_prefix=no
5523 need_version=no
5524 case $host_cpu in
5525 ia64*)
5526 shrext_cmds='.so'
5527 hardcode_into_libs=yes
5528 dynamic_linker="$host_os dld.so"
5529 shlibpath_var=LD_LIBRARY_PATH
5530 shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
5531 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
5532 soname_spec='$libname$release$shared_ext$major'
5533 if test 32 = "$HPUX_IA64_MODE"; then
5534 sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
5535 sys_lib_dlsearch_path_spec=/usr/lib/hpux32
5536 else
5537 sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
5538 sys_lib_dlsearch_path_spec=/usr/lib/hpux64
5539 fi
5540 ;;
5541 hppa*64*)
5542 shrext_cmds='.sl'
5543 hardcode_into_libs=yes
5544 dynamic_linker="$host_os dld.sl"
5545 shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
5546 shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
5547 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
5548 soname_spec='$libname$release$shared_ext$major'
5549 sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
5550 sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
5551 ;;
5552 *)
5553 shrext_cmds='.sl'
5554 dynamic_linker="$host_os dld.sl"
5555 shlibpath_var=SHLIB_PATH
5556 shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
5557 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
5558 soname_spec='$libname$release$shared_ext$major'
5559 ;;
5560 esac
5561 # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
5562 postinstall_cmds='chmod 555 $lib'
5563 # or fails outright, so override atomically:
5564 install_override_mode=555
5565 ;;
5566
5567 interix[[3-9]]*)
5568 version_type=linux # correct to gnu/linux during the next big refactor
5569 need_lib_prefix=no
5570 need_version=no
5571 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
5572 soname_spec='$libname$release$shared_ext$major'
5573 dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
5574 shlibpath_var=LD_LIBRARY_PATH
5575 shlibpath_overrides_runpath=no
5576 hardcode_into_libs=yes
5577 ;;
5578
5579 irix5* | irix6* | nonstopux*)
5580 case $host_os in
5581 nonstopux*) version_type=nonstopux ;;
5582 *)
5583 if test yes = "$lt_cv_prog_gnu_ld"; then
5584 version_type=linux # correct to gnu/linux during the next big refactor
5585 else
5586 version_type=irix
5587 fi ;;
5588 esac
5589 need_lib_prefix=no
5590 need_version=no
5591 soname_spec='$libname$release$shared_ext$major'
5592 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext'
5593 case $host_os in
5594 irix5* | nonstopux*)
5595 libsuff= shlibsuff=
5596 ;;
5597 *)
5598 case $LD in # libtool.m4 will add one of these switches to LD
5599 *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
5600 libsuff= shlibsuff= libmagic=32-bit;;
5601 *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
5602 libsuff=32 shlibsuff=N32 libmagic=N32;;
5603 *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
5604 libsuff=64 shlibsuff=64 libmagic=64-bit;;
5605 *) libsuff= shlibsuff= libmagic=never-match;;
5606 esac
5607 ;;
5608 esac
5609 shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
5610 shlibpath_overrides_runpath=no
5611 sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff"
5612 sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff"
5613 hardcode_into_libs=yes
5614 ;;
5615
5616 # No shared lib support for Linux oldld, aout, or coff.
5617 linux*oldld* | linux*aout* | linux*coff*)
5618 dynamic_linker=no
5619 ;;
5620
5621 linux*android*)
5622 version_type=none # Android doesn't support versioned libraries.
5623 need_lib_prefix=no
5624 need_version=no
5625 library_names_spec='$libname$release$shared_ext'
5626 soname_spec='$libname$release$shared_ext'
5627 finish_cmds=
5628 shlibpath_var=LD_LIBRARY_PATH
5629 shlibpath_overrides_runpath=yes
5630
5631 # This implies no fast_install, which is unacceptable.
5632 # Some rework will be needed to allow for fast_install
5633 # before this can be enabled.
5634 hardcode_into_libs=yes
5635
5636 dynamic_linker='Android linker'
5637 # Don't embed -rpath directories since the linker doesn't support them.
5638 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5639 ;;
5640
5641 # This must be glibc/ELF.
5642 linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
5643 version_type=linux # correct to gnu/linux during the next big refactor
5644 need_lib_prefix=no
5645 need_version=no
5646 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
5647 soname_spec='$libname$release$shared_ext$major'
5648 finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
5649 shlibpath_var=LD_LIBRARY_PATH
5650 shlibpath_overrides_runpath=no
5651
5652 # Some binutils ld are patched to set DT_RUNPATH
5653 AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath],
5654 [lt_cv_shlibpath_overrides_runpath=no
5655 save_LDFLAGS=$LDFLAGS
5656 save_libdir=$libdir
5657 eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
5658 LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
5659 AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
5660 [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
5661 [lt_cv_shlibpath_overrides_runpath=yes])])
5662 LDFLAGS=$save_LDFLAGS
5663 libdir=$save_libdir
5664 ])
5665 shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
5666
5667 # This implies no fast_install, which is unacceptable.
5668 # Some rework will be needed to allow for fast_install
5669 # before this can be enabled.
5670 hardcode_into_libs=yes
5671
5672 # Add ABI-specific directories to the system library path.
5673 sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib"
5674
5675 # Ideally, we could use ldconfig to report *all* directores which are
5676 # searched for libraries, however this is still not possible. Aside from not
5677 # being certain /sbin/ldconfig is available, command
5678 # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64,
5679 # even though it is searched at run-time. Try to do the best guess by
5680 # appending ld.so.conf contents (and includes) to the search path.
5681 if test -f /etc/ld.so.conf; then
5682 lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
5683 sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra"
5684 fi
5685
5686 # We used to test for /lib/ld.so.1 and disable shared libraries on
5687 # powerpc, because MkLinux only supported shared libraries with the
5688 # GNU dynamic linker. Since this was broken with cross compilers,
5689 # most powerpc-linux boxes support dynamic linking these days and
5690 # people can always --disable-shared, the test was removed, and we
5691 # assume the GNU/Linux dynamic linker is in use.
5692 dynamic_linker='GNU/Linux ld.so'
5693 ;;
5694
5695 netbsd*)
5696 version_type=sunos
5697 need_lib_prefix=no
5698 need_version=no
5699 if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
5700 library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
5701 finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
5702 dynamic_linker='NetBSD (a.out) ld.so'
5703 else
5704 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
5705 soname_spec='$libname$release$shared_ext$major'
5706 dynamic_linker='NetBSD ld.elf_so'
5707 fi
5708 shlibpath_var=LD_LIBRARY_PATH
5709 shlibpath_overrides_runpath=yes
5710 hardcode_into_libs=yes
5711 ;;
5712
5713 newsos6)
5714 version_type=linux # correct to gnu/linux during the next big refactor
5715 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
5716 shlibpath_var=LD_LIBRARY_PATH
5717 shlibpath_overrides_runpath=yes
5718 ;;
5719
5720 *nto* | *qnx*)
5721 version_type=qnx
5722 need_lib_prefix=no
5723 need_version=no
5724 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
5725 soname_spec='$libname$release$shared_ext$major'
5726 shlibpath_var=LD_LIBRARY_PATH
5727 shlibpath_overrides_runpath=no
5728 hardcode_into_libs=yes
5729 dynamic_linker='ldqnx.so'
5730 ;;
5731
5732 openbsd* | bitrig*)
5733 version_type=sunos
5734 sys_lib_dlsearch_path_spec=/usr/lib
5735 need_lib_prefix=no
5736 if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
5737 need_version=no
5738 else
5739 need_version=yes
5740 fi
5741 library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
5742 finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
5743 shlibpath_var=LD_LIBRARY_PATH
5744 shlibpath_overrides_runpath=yes
5745 ;;
5746
5747 os2*)
5748 libname_spec='$name'
5749 version_type=windows
5750 shrext_cmds=.dll
5751 need_version=no
5752 need_lib_prefix=no
5753 # OS/2 can only load a DLL with a base name of 8 characters or less.
5754 soname_spec='`test -n "$os2dllname" && libname="$os2dllname";
5755 v=$($ECHO $release$versuffix | tr -d .-);
5756 n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _);
5757 $ECHO $n$v`$shared_ext'
5758 library_names_spec='${libname}_dll.$libext'
5759 dynamic_linker='OS/2 ld.exe'
5760 shlibpath_var=BEGINLIBPATH
5761 sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
5762 sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
5763 postinstall_cmds='base_file=`basename \$file`~
5764 dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~
5765 dldir=$destdir/`dirname \$dlpath`~
5766 test -d \$dldir || mkdir -p \$dldir~
5767 $install_prog $dir/$dlname \$dldir/$dlname~
5768 chmod a+x \$dldir/$dlname~
5769 if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
5770 eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
5771 fi'
5772 postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~
5773 dlpath=$dir/\$dldll~
5774 $RM \$dlpath'
5775 ;;
5776
5777 osf3* | osf4* | osf5*)
5778 version_type=osf
5779 need_lib_prefix=no
5780 need_version=no
5781 soname_spec='$libname$release$shared_ext$major'
5782 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
5783 shlibpath_var=LD_LIBRARY_PATH
5784 sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
5785 sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
5786 ;;
5787
5788 rdos*)
5789 dynamic_linker=no
5790 ;;
5791
5792 solaris*)
5793 version_type=linux # correct to gnu/linux during the next big refactor
5794 need_lib_prefix=no
5795 need_version=no
5796 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
5797 soname_spec='$libname$release$shared_ext$major'
5798 shlibpath_var=LD_LIBRARY_PATH
5799 shlibpath_overrides_runpath=yes
5800 hardcode_into_libs=yes
5801 # ldd complains unless libraries are executable
5802 postinstall_cmds='chmod +x $lib'
5803 ;;
5804
5805 sunos4*)
5806 version_type=sunos
5807 library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
5808 finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
5809 shlibpath_var=LD_LIBRARY_PATH
5810 shlibpath_overrides_runpath=yes
5811 if test yes = "$with_gnu_ld"; then
5812 need_lib_prefix=no
5813 fi
5814 need_version=yes
5815 ;;
5816
5817 sysv4 | sysv4.3*)
5818 version_type=linux # correct to gnu/linux during the next big refactor
5819 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
5820 soname_spec='$libname$release$shared_ext$major'
5821 shlibpath_var=LD_LIBRARY_PATH
5822 case $host_vendor in
5823 sni)
5824 shlibpath_overrides_runpath=no
5825 need_lib_prefix=no
5826 runpath_var=LD_RUN_PATH
5827 ;;
5828 siemens)
5829 need_lib_prefix=no
5830 ;;
5831 motorola)
5832 need_lib_prefix=no
5833 need_version=no
5834 shlibpath_overrides_runpath=no
5835 sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
5836 ;;
5837 esac
5838 ;;
5839
5840 sysv4*MP*)
5841 if test -d /usr/nec; then
5842 version_type=linux # correct to gnu/linux during the next big refactor
5843 library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext'
5844 soname_spec='$libname$shared_ext.$major'
5845 shlibpath_var=LD_LIBRARY_PATH
5846 fi
5847 ;;
5848
5849 sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
5850 version_type=sco
5851 need_lib_prefix=no
5852 need_version=no
5853 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext'
5854 soname_spec='$libname$release$shared_ext$major'
5855 shlibpath_var=LD_LIBRARY_PATH
5856 shlibpath_overrides_runpath=yes
5857 hardcode_into_libs=yes
5858 if test yes = "$with_gnu_ld"; then
5859 sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
5860 else
5861 sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
5862 case $host_os in
5863 sco3.2v5*)
5864 sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
5865 ;;
5866 esac
5867 fi
5868 sys_lib_dlsearch_path_spec='/usr/lib'
5869 ;;
5870
5871 tpf*)
5872 # TPF is a cross-target only. Preferred cross-host = GNU/Linux.
5873 version_type=linux # correct to gnu/linux during the next big refactor
5874 need_lib_prefix=no
5875 need_version=no
5876 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
5877 shlibpath_var=LD_LIBRARY_PATH
5878 shlibpath_overrides_runpath=no
5879 hardcode_into_libs=yes
5880 ;;
5881
5882 uts4*)
5883 version_type=linux # correct to gnu/linux during the next big refactor
5884 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
5885 soname_spec='$libname$release$shared_ext$major'
5886 shlibpath_var=LD_LIBRARY_PATH
5887 ;;
5888
5889 *)
5890 dynamic_linker=no
5891 ;;
5892 esac
5893 AC_MSG_RESULT([$dynamic_linker])
5894 test no = "$dynamic_linker" && can_build_shared=no
5895
5896 variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
5897 if test yes = "$GCC"; then
5898 variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
5899 fi
5900
5901 if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then
5902 sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec
5903 fi
5904
5905 if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then
5906 sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec
5907 fi
5908
5909 # remember unaugmented sys_lib_dlsearch_path content for libtool script decls...
5910 configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec
5911
5912 # ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code
5913 func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH"
5914
5915 # to be used as default LT_SYS_LIBRARY_PATH value in generated libtool
5916 configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH
5917
5918 _LT_DECL([], [variables_saved_for_relink], [1],
5919 [Variables whose values should be saved in libtool wrapper scripts and
5920 restored at link time])
5921 _LT_DECL([], [need_lib_prefix], [0],
5922 [Do we need the "lib" prefix for modules?])
5923 _LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
5924 _LT_DECL([], [version_type], [0], [Library versioning type])
5925 _LT_DECL([], [runpath_var], [0], [Shared library runtime path variable])
5926 _LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
5927 _LT_DECL([], [shlibpath_overrides_runpath], [0],
5928 [Is shlibpath searched before the hard-coded library search path?])
5929 _LT_DECL([], [libname_spec], [1], [Format of library name prefix])
5930 _LT_DECL([], [library_names_spec], [1],
5931 [[List of archive names. First name is the real one, the rest are links.
5932 The last name is the one that the linker finds with -lNAME]])
5933 _LT_DECL([], [soname_spec], [1],
5934 [[The coded name of the library, if different from the real name]])
5935 _LT_DECL([], [install_override_mode], [1],
5936 [Permission mode override for installation of shared libraries])
5937 _LT_DECL([], [postinstall_cmds], [2],
5938 [Command to use after installation of a shared archive])
5939 _LT_DECL([], [postuninstall_cmds], [2],
5940 [Command to use after uninstallation of a shared archive])
5941 _LT_DECL([], [finish_cmds], [2],
5942 [Commands used to finish a libtool library installation in a directory])
5943 _LT_DECL([], [finish_eval], [1],
5944 [[As "finish_cmds", except a single script fragment to be evaled but
5945 not shown]])
5946 _LT_DECL([], [hardcode_into_libs], [0],
5947 [Whether we should hardcode library paths into libraries])
5948 _LT_DECL([], [sys_lib_search_path_spec], [2],
5949 [Compile-time system search path for libraries])
5950 _LT_DECL([sys_lib_dlsearch_path_spec], [configure_time_dlsearch_path], [2],
5951 [Detected run-time system search path for libraries])
5952 _LT_DECL([], [configure_time_lt_sys_library_path], [2],
5953 [Explicit LT_SYS_LIBRARY_PATH set during ./configure time])
5954 ])# _LT_SYS_DYNAMIC_LINKER
5955
5956
5957 # _LT_PATH_TOOL_PREFIX(TOOL)
5958 # --------------------------
5959 # find a file program that can recognize shared library
5960 AC_DEFUN([_LT_PATH_TOOL_PREFIX],
5961 [m4_require([_LT_DECL_EGREP])dnl
5962 AC_MSG_CHECKING([for $1])
5963 AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
5964 [case $MAGIC_CMD in
5965 [[\\/*] | ?:[\\/]*])
5966 lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path.
5967 ;;
5968 *)
5969 lt_save_MAGIC_CMD=$MAGIC_CMD
5970 lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
5971 dnl $ac_dummy forces splitting on constant user-supplied paths.
5972 dnl POSIX.2 word splitting is done only on the output of word expansions,
5973 dnl not every word. This closes a longstanding sh security hole.
5974 ac_dummy="m4_if([$2], , $PATH, [$2])"
5975 for ac_dir in $ac_dummy; do
5976 IFS=$lt_save_ifs
5977 test -z "$ac_dir" && ac_dir=.
5978 if test -f "$ac_dir/$1"; then
5979 lt_cv_path_MAGIC_CMD=$ac_dir/"$1"
5980 if test -n "$file_magic_test_file"; then
5981 case $deplibs_check_method in
5982 "file_magic "*)
5983 file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
5984 MAGIC_CMD=$lt_cv_path_MAGIC_CMD
5985 if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
5986 $EGREP "$file_magic_regex" > /dev/null; then
5987 :
5988 else
5989 cat <<_LT_EOF 1>&2
5990
5991 *** Warning: the command libtool uses to detect shared libraries,
5992 *** $file_magic_cmd, produces output that libtool cannot recognize.
5993 *** The result is that libtool may fail to recognize shared libraries
5994 *** as such. This will affect the creation of libtool libraries that
5995 *** depend on shared libraries, but programs linked with such libtool
5996 *** libraries will work regardless of this problem. Nevertheless, you
5997 *** may want to report the problem to your system manager and/or to
5998 *** bug-libtool@gnu.org
5999
6000 _LT_EOF
6001 fi ;;
6002 esac
6003 fi
6004 break
6005 fi
6006 done
6007 IFS=$lt_save_ifs
6008 MAGIC_CMD=$lt_save_MAGIC_CMD
6009 ;;
6010 esac])
6011 MAGIC_CMD=$lt_cv_path_MAGIC_CMD
6012 if test -n "$MAGIC_CMD"; then
6013 AC_MSG_RESULT($MAGIC_CMD)
6014 else
6015 AC_MSG_RESULT(no)
6016 fi
6017 _LT_DECL([], [MAGIC_CMD], [0],
6018 [Used to examine libraries when file_magic_cmd begins with "file"])dnl
6019 ])# _LT_PATH_TOOL_PREFIX
6020
6021 # Old name:
6022 AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
6023 dnl aclocal-1.4 backwards compatibility:
6024 dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
6025
6026
6027 # _LT_PATH_MAGIC
6028 # --------------
6029 # find a file program that can recognize a shared library
6030 m4_defun([_LT_PATH_MAGIC],
6031 [_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
6032 if test -z "$lt_cv_path_MAGIC_CMD"; then
6033 if test -n "$ac_tool_prefix"; then
6034 _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
6035 else
6036 MAGIC_CMD=:
6037 fi
6038 fi
6039 ])# _LT_PATH_MAGIC
6040
6041
6042 # LT_PATH_LD
6043 # ----------
6044 # find the pathname to the GNU or non-GNU linker
6045 AC_DEFUN([LT_PATH_LD],
6046 [AC_REQUIRE([AC_PROG_CC])dnl
6047 AC_REQUIRE([AC_CANONICAL_HOST])dnl
6048 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
6049 m4_require([_LT_DECL_SED])dnl
6050 m4_require([_LT_DECL_EGREP])dnl
6051 m4_require([_LT_PROG_ECHO_BACKSLASH])dnl
6052
6053 AC_ARG_WITH([gnu-ld],
6054 [AS_HELP_STRING([--with-gnu-ld],
6055 [assume the C compiler uses GNU ld @<:@default=no@:>@])],
6056 [test no = "$withval" || with_gnu_ld=yes],
6057 [with_gnu_ld=no])dnl
6058
6059 ac_prog=ld
6060 if test yes = "$GCC"; then
6061 # Check if gcc -print-prog-name=ld gives a path.
6062 AC_MSG_CHECKING([for ld used by $CC])
6063 case $host in
6064 *-*-mingw*)
6065 # gcc leaves a trailing carriage return, which upsets mingw
6066 ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
6067 *)
6068 ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
6069 esac
6070 case $ac_prog in
6071 # Accept absolute paths.
6072 [[\\/]]* | ?:[[\\/]]*)
6073 re_direlt='/[[^/]][[^/]]*/\.\./'
6074 # Canonicalize the pathname of ld
6075 ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
6076 while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
6077 ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
6078 done
6079 test -z "$LD" && LD=$ac_prog
6080 ;;
6081 "")
6082 # If it fails, then pretend we aren't using GCC.
6083 ac_prog=ld
6084 ;;
6085 *)
6086 # If it is relative, then search for the first ld in PATH.
6087 with_gnu_ld=unknown
6088 ;;
6089 esac
6090 elif test yes = "$with_gnu_ld"; then
6091 AC_MSG_CHECKING([for GNU ld])
6092 else
6093 AC_MSG_CHECKING([for non-GNU ld])
6094 fi
6095 AC_CACHE_VAL(lt_cv_path_LD,
6096 [if test -z "$LD"; then
6097 lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
6098 for ac_dir in $PATH; do
6099 IFS=$lt_save_ifs
6100 test -z "$ac_dir" && ac_dir=.
6101 if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
6102 lt_cv_path_LD=$ac_dir/$ac_prog
6103 # Check to see if the program is GNU ld. I'd rather use --version,
6104 # but apparently some variants of GNU ld only accept -v.
6105 # Break only if it was the GNU/non-GNU ld that we prefer.
6106 case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
6107 *GNU* | *'with BFD'*)
6108 test no != "$with_gnu_ld" && break
6109 ;;
6110 *)
6111 test yes != "$with_gnu_ld" && break
6112 ;;
6113 esac
6114 fi
6115 done
6116 IFS=$lt_save_ifs
6117 else
6118 lt_cv_path_LD=$LD # Let the user override the test with a path.
6119 fi])
6120 LD=$lt_cv_path_LD
6121 if test -n "$LD"; then
6122 AC_MSG_RESULT($LD)
6123 else
6124 AC_MSG_RESULT(no)
6125 fi
6126 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
6127 _LT_PATH_LD_GNU
6128 AC_SUBST([LD])
6129
6130 _LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
6131 ])# LT_PATH_LD
6132
6133 # Old names:
6134 AU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
6135 AU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
6136 dnl aclocal-1.4 backwards compatibility:
6137 dnl AC_DEFUN([AM_PROG_LD], [])
6138 dnl AC_DEFUN([AC_PROG_LD], [])
6139
6140
6141 # _LT_PATH_LD_GNU
6142 #- --------------
6143 m4_defun([_LT_PATH_LD_GNU],
6144 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
6145 [# I'd rather use --version here, but apparently some GNU lds only accept -v.
6146 case `$LD -v 2>&1 </dev/null` in
6147 *GNU* | *'with BFD'*)
6148 lt_cv_prog_gnu_ld=yes
6149 ;;
6150 *)
6151 lt_cv_prog_gnu_ld=no
6152 ;;
6153 esac])
6154 with_gnu_ld=$lt_cv_prog_gnu_ld
6155 ])# _LT_PATH_LD_GNU
6156
6157
6158 # _LT_CMD_RELOAD
6159 # --------------
6160 # find reload flag for linker
6161 # -- PORTME Some linkers may need a different reload flag.
6162 m4_defun([_LT_CMD_RELOAD],
6163 [AC_CACHE_CHECK([for $LD option to reload object files],
6164 lt_cv_ld_reload_flag,
6165 [lt_cv_ld_reload_flag='-r'])
6166 reload_flag=$lt_cv_ld_reload_flag
6167 case $reload_flag in
6168 "" | " "*) ;;
6169 *) reload_flag=" $reload_flag" ;;
6170 esac
6171 reload_cmds='$LD$reload_flag -o $output$reload_objs'
6172 case $host_os in
6173 cygwin* | mingw* | pw32* | cegcc*)
6174 if test yes != "$GCC"; then
6175 reload_cmds=false
6176 fi
6177 ;;
6178 darwin*)
6179 if test yes = "$GCC"; then
6180 reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs'
6181 else
6182 reload_cmds='$LD$reload_flag -o $output$reload_objs'
6183 fi
6184 ;;
6185 esac
6186 _LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl
6187 _LT_TAGDECL([], [reload_cmds], [2])dnl
6188 ])# _LT_CMD_RELOAD
6189
6190
6191 # _LT_PATH_DD
6192 # -----------
6193 # find a working dd
6194 m4_defun([_LT_PATH_DD],
6195 [AC_CACHE_CHECK([for a working dd], [ac_cv_path_lt_DD],
6196 [printf 0123456789abcdef0123456789abcdef >conftest.i
6197 cat conftest.i conftest.i >conftest2.i
6198 : ${lt_DD:=$DD}
6199 AC_PATH_PROGS_FEATURE_CHECK([lt_DD], [dd],
6200 [if "$ac_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then
6201 cmp -s conftest.i conftest.out \
6202 && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=:
6203 fi])
6204 rm -f conftest.i conftest2.i conftest.out])
6205 ])# _LT_PATH_DD
6206
6207
6208 # _LT_CMD_TRUNCATE
6209 # ----------------
6210 # find command to truncate a binary pipe
6211 m4_defun([_LT_CMD_TRUNCATE],
6212 [m4_require([_LT_PATH_DD])
6213 AC_CACHE_CHECK([how to truncate binary pipes], [lt_cv_truncate_bin],
6214 [printf 0123456789abcdef0123456789abcdef >conftest.i
6215 cat conftest.i conftest.i >conftest2.i
6216 lt_cv_truncate_bin=
6217 if "$ac_cv_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then
6218 cmp -s conftest.i conftest.out \
6219 && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1"
6220 fi
6221 rm -f conftest.i conftest2.i conftest.out
6222 test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q"])
6223 _LT_DECL([lt_truncate_bin], [lt_cv_truncate_bin], [1],
6224 [Command to truncate a binary pipe])
6225 ])# _LT_CMD_TRUNCATE
6226
6227
6228 # _LT_CHECK_MAGIC_METHOD
6229 # ----------------------
6230 # how to check for library dependencies
6231 # -- PORTME fill in with the dynamic library characteristics
6232 m4_defun([_LT_CHECK_MAGIC_METHOD],
6233 [m4_require([_LT_DECL_EGREP])
6234 m4_require([_LT_DECL_OBJDUMP])
6235 AC_CACHE_CHECK([how to recognize dependent libraries],
6236 lt_cv_deplibs_check_method,
6237 [lt_cv_file_magic_cmd='$MAGIC_CMD'
6238 lt_cv_file_magic_test_file=
6239 lt_cv_deplibs_check_method='unknown'
6240 # Need to set the preceding variable on all platforms that support
6241 # interlibrary dependencies.
6242 # 'none' -- dependencies not supported.
6243 # 'unknown' -- same as none, but documents that we really don't know.
6244 # 'pass_all' -- all dependencies passed with no checks.
6245 # 'test_compile' -- check by making test program.
6246 # 'file_magic [[regex]]' -- check by looking for files in library path
6247 # that responds to the $file_magic_cmd with a given extended regex.
6248 # If you have 'file' or equivalent on your system and you're not sure
6249 # whether 'pass_all' will *always* work, you probably want this one.
6250
6251 case $host_os in
6252 aix[[4-9]]*)
6253 lt_cv_deplibs_check_method=pass_all
6254 ;;
6255
6256 beos*)
6257 lt_cv_deplibs_check_method=pass_all
6258 ;;
6259
6260 bsdi[[45]]*)
6261 lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
6262 lt_cv_file_magic_cmd='/usr/bin/file -L'
6263 lt_cv_file_magic_test_file=/shlib/libc.so
6264 ;;
6265
6266 cygwin*)
6267 # func_win32_libid is a shell function defined in ltmain.sh
6268 lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
6269 lt_cv_file_magic_cmd='func_win32_libid'
6270 ;;
6271
6272 mingw* | pw32*)
6273 # Base MSYS/MinGW do not provide the 'file' command needed by
6274 # func_win32_libid shell function, so use a weaker test based on 'objdump',
6275 # unless we find 'file', for example because we are cross-compiling.
6276 if ( file / ) >/dev/null 2>&1; then
6277 lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
6278 lt_cv_file_magic_cmd='func_win32_libid'
6279 else
6280 # Keep this pattern in sync with the one in func_win32_libid.
6281 lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
6282 lt_cv_file_magic_cmd='$OBJDUMP -f'
6283 fi
6284 ;;
6285
6286 cegcc*)
6287 # use the weaker test based on 'objdump'. See mingw*.
6288 lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
6289 lt_cv_file_magic_cmd='$OBJDUMP -f'
6290 ;;
6291
6292 darwin* | rhapsody*)
6293 lt_cv_deplibs_check_method=pass_all
6294 ;;
6295
6296 freebsd* | dragonfly*)
6297 if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
6298 case $host_cpu in
6299 i*86 )
6300 # Not sure whether the presence of OpenBSD here was a mistake.
6301 # Let's accept both of them until this is cleared up.
6302 lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
6303 lt_cv_file_magic_cmd=/usr/bin/file
6304 lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
6305 ;;
6306 esac
6307 else
6308 lt_cv_deplibs_check_method=pass_all
6309 fi
6310 ;;
6311
6312 haiku*)
6313 lt_cv_deplibs_check_method=pass_all
6314 ;;
6315
6316 hpux10.20* | hpux11*)
6317 lt_cv_file_magic_cmd=/usr/bin/file
6318 case $host_cpu in
6319 ia64*)
6320 lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
6321 lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
6322 ;;
6323 hppa*64*)
6324 [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]']
6325 lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
6326 ;;
6327 *)
6328 lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library'
6329 lt_cv_file_magic_test_file=/usr/lib/libc.sl
6330 ;;
6331 esac
6332 ;;
6333
6334 interix[[3-9]]*)
6335 # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
6336 lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
6337 ;;
6338
6339 irix5* | irix6* | nonstopux*)
6340 case $LD in
6341 *-32|*"-32 ") libmagic=32-bit;;
6342 *-n32|*"-n32 ") libmagic=N32;;
6343 *-64|*"-64 ") libmagic=64-bit;;
6344 *) libmagic=never-match;;
6345 esac
6346 lt_cv_deplibs_check_method=pass_all
6347 ;;
6348
6349 # This must be glibc/ELF.
6350 linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
6351 lt_cv_deplibs_check_method=pass_all
6352 ;;
6353
6354 netbsd*)
6355 if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
6356 lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
6357 else
6358 lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
6359 fi
6360 ;;
6361
6362 newos6*)
6363 lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
6364 lt_cv_file_magic_cmd=/usr/bin/file
6365 lt_cv_file_magic_test_file=/usr/lib/libnls.so
6366 ;;
6367
6368 *nto* | *qnx*)
6369 lt_cv_deplibs_check_method=pass_all
6370 ;;
6371
6372 openbsd* | bitrig*)
6373 if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
6374 lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
6375 else
6376 lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
6377 fi
6378 ;;
6379
6380 osf3* | osf4* | osf5*)
6381 lt_cv_deplibs_check_method=pass_all
6382 ;;
6383
6384 rdos*)
6385 lt_cv_deplibs_check_method=pass_all
6386 ;;
6387
6388 solaris*)
6389 lt_cv_deplibs_check_method=pass_all
6390 ;;
6391
6392 sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
6393 lt_cv_deplibs_check_method=pass_all
6394 ;;
6395
6396 sysv4 | sysv4.3*)
6397 case $host_vendor in
6398 motorola)
6399 lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]'
6400 lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
6401 ;;
6402 ncr)
6403 lt_cv_deplibs_check_method=pass_all
6404 ;;
6405 sequent)
6406 lt_cv_file_magic_cmd='/bin/file'
6407 lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
6408 ;;
6409 sni)
6410 lt_cv_file_magic_cmd='/bin/file'
6411 lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
6412 lt_cv_file_magic_test_file=/lib/libc.so
6413 ;;
6414 siemens)
6415 lt_cv_deplibs_check_method=pass_all
6416 ;;
6417 pc)
6418 lt_cv_deplibs_check_method=pass_all
6419 ;;
6420 esac
6421 ;;
6422
6423 tpf*)
6424 lt_cv_deplibs_check_method=pass_all
6425 ;;
6426 os2*)
6427 lt_cv_deplibs_check_method=pass_all
6428 ;;
6429 esac
6430 ])
6431
6432 file_magic_glob=
6433 want_nocaseglob=no
6434 if test "$build" = "$host"; then
6435 case $host_os in
6436 mingw* | pw32*)
6437 if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
6438 want_nocaseglob=yes
6439 else
6440 file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"`
6441 fi
6442 ;;
6443 esac
6444 fi
6445
6446 file_magic_cmd=$lt_cv_file_magic_cmd
6447 deplibs_check_method=$lt_cv_deplibs_check_method
6448 test -z "$deplibs_check_method" && deplibs_check_method=unknown
6449
6450 _LT_DECL([], [deplibs_check_method], [1],
6451 [Method to check whether dependent libraries are shared objects])
6452 _LT_DECL([], [file_magic_cmd], [1],
6453 [Command to use when deplibs_check_method = "file_magic"])
6454 _LT_DECL([], [file_magic_glob], [1],
6455 [How to find potential files when deplibs_check_method = "file_magic"])
6456 _LT_DECL([], [want_nocaseglob], [1],
6457 [Find potential files using nocaseglob when deplibs_check_method = "file_magic"])
6458 ])# _LT_CHECK_MAGIC_METHOD
6459
6460
6461 # LT_PATH_NM
6462 # ----------
6463 # find the pathname to a BSD- or MS-compatible name lister
6464 AC_DEFUN([LT_PATH_NM],
6465 [AC_REQUIRE([AC_PROG_CC])dnl
6466 AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
6467 [if test -n "$NM"; then
6468 # Let the user override the test.
6469 lt_cv_path_NM=$NM
6470 else
6471 lt_nm_to_check=${ac_tool_prefix}nm
6472 if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
6473 lt_nm_to_check="$lt_nm_to_check nm"
6474 fi
6475 for lt_tmp_nm in $lt_nm_to_check; do
6476 lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
6477 for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
6478 IFS=$lt_save_ifs
6479 test -z "$ac_dir" && ac_dir=.
6480 tmp_nm=$ac_dir/$lt_tmp_nm
6481 if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then
6482 # Check to see if the nm accepts a BSD-compat flag.
6483 # Adding the 'sed 1q' prevents false positives on HP-UX, which says:
6484 # nm: unknown option "B" ignored
6485 # Tru64's nm complains that /dev/null is an invalid object file
6486 # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty
6487 case $build_os in
6488 mingw*) lt_bad_file=conftest.nm/nofile ;;
6489 *) lt_bad_file=/dev/null ;;
6490 esac
6491 case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in
6492 *$lt_bad_file* | *'Invalid file or object type'*)
6493 lt_cv_path_NM="$tmp_nm -B"
6494 break 2
6495 ;;
6496 *)
6497 case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
6498 */dev/null*)
6499 lt_cv_path_NM="$tmp_nm -p"
6500 break 2
6501 ;;
6502 *)
6503 lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
6504 continue # so that we can try to find one that supports BSD flags
6505 ;;
6506 esac
6507 ;;
6508 esac
6509 fi
6510 done
6511 IFS=$lt_save_ifs
6512 done
6513 : ${lt_cv_path_NM=no}
6514 fi])
6515 if test no != "$lt_cv_path_NM"; then
6516 NM=$lt_cv_path_NM
6517 else
6518 # Didn't find any BSD compatible name lister, look for dumpbin.
6519 if test -n "$DUMPBIN"; then :
6520 # Let the user override the test.
6521 else
6522 AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :)
6523 case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in
6524 *COFF*)
6525 DUMPBIN="$DUMPBIN -symbols -headers"
6526 ;;
6527 *)
6528 DUMPBIN=:
6529 ;;
6530 esac
6531 fi
6532 AC_SUBST([DUMPBIN])
6533 if test : != "$DUMPBIN"; then
6534 NM=$DUMPBIN
6535 fi
6536 fi
6537 test -z "$NM" && NM=nm
6538 AC_SUBST([NM])
6539 _LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
6540
6541 AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
6542 [lt_cv_nm_interface="BSD nm"
6543 echo "int some_variable = 0;" > conftest.$ac_ext
6544 (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
6545 (eval "$ac_compile" 2>conftest.err)
6546 cat conftest.err >&AS_MESSAGE_LOG_FD
6547 (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
6548 (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
6549 cat conftest.err >&AS_MESSAGE_LOG_FD
6550 (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD)
6551 cat conftest.out >&AS_MESSAGE_LOG_FD
6552 if $GREP 'External.*some_variable' conftest.out > /dev/null; then
6553 lt_cv_nm_interface="MS dumpbin"
6554 fi
6555 rm -f conftest*])
6556 ])# LT_PATH_NM
6557
6558 # Old names:
6559 AU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
6560 AU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
6561 dnl aclocal-1.4 backwards compatibility:
6562 dnl AC_DEFUN([AM_PROG_NM], [])
6563 dnl AC_DEFUN([AC_PROG_NM], [])
6564
6565 # _LT_CHECK_SHAREDLIB_FROM_LINKLIB
6566 # --------------------------------
6567 # how to determine the name of the shared library
6568 # associated with a specific link library.
6569 # -- PORTME fill in with the dynamic library characteristics
6570 m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB],
6571 [m4_require([_LT_DECL_EGREP])
6572 m4_require([_LT_DECL_OBJDUMP])
6573 m4_require([_LT_DECL_DLLTOOL])
6574 AC_CACHE_CHECK([how to associate runtime and link libraries],
6575 lt_cv_sharedlib_from_linklib_cmd,
6576 [lt_cv_sharedlib_from_linklib_cmd='unknown'
6577
6578 case $host_os in
6579 cygwin* | mingw* | pw32* | cegcc*)
6580 # two different shell functions defined in ltmain.sh;
6581 # decide which one to use based on capabilities of $DLLTOOL
6582 case `$DLLTOOL --help 2>&1` in
6583 *--identify-strict*)
6584 lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
6585 ;;
6586 *)
6587 lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
6588 ;;
6589 esac
6590 ;;
6591 *)
6592 # fallback: assume linklib IS sharedlib
6593 lt_cv_sharedlib_from_linklib_cmd=$ECHO
6594 ;;
6595 esac
6596 ])
6597 sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
6598 test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
6599
6600 _LT_DECL([], [sharedlib_from_linklib_cmd], [1],
6601 [Command to associate shared and link libraries])
6602 ])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
6603
6604
6605 # _LT_PATH_MANIFEST_TOOL
6606 # ----------------------
6607 # locate the manifest tool
6608 m4_defun([_LT_PATH_MANIFEST_TOOL],
6609 [AC_CHECK_TOOL(MANIFEST_TOOL, mt, :)
6610 test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
6611 AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool],
6612 [lt_cv_path_mainfest_tool=no
6613 echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD
6614 $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
6615 cat conftest.err >&AS_MESSAGE_LOG_FD
6616 if $GREP 'Manifest Tool' conftest.out > /dev/null; then
6617 lt_cv_path_mainfest_tool=yes
6618 fi
6619 rm -f conftest*])
6620 if test yes != "$lt_cv_path_mainfest_tool"; then
6621 MANIFEST_TOOL=:
6622 fi
6623 _LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl
6624 ])# _LT_PATH_MANIFEST_TOOL
6625
6626
6627 # _LT_DLL_DEF_P([FILE])
6628 # ---------------------
6629 # True iff FILE is a Windows DLL '.def' file.
6630 # Keep in sync with func_dll_def_p in the libtool script
6631 AC_DEFUN([_LT_DLL_DEF_P],
6632 [dnl
6633 test DEF = "`$SED -n dnl
6634 -e '\''s/^[[ ]]*//'\'' dnl Strip leading whitespace
6635 -e '\''/^\(;.*\)*$/d'\'' dnl Delete empty lines and comments
6636 -e '\''s/^\(EXPORTS\|LIBRARY\)\([[ ]].*\)*$/DEF/p'\'' dnl
6637 -e q dnl Only consider the first "real" line
6638 $1`" dnl
6639 ])# _LT_DLL_DEF_P
6640
6641
6642 # LT_LIB_M
6643 # --------
6644 # check for math library
6645 AC_DEFUN([LT_LIB_M],
6646 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
6647 LIBM=
6648 case $host in
6649 *-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*)
6650 # These system don't have libm, or don't need it
6651 ;;
6652 *-ncr-sysv4.3*)
6653 AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM=-lmw)
6654 AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
6655 ;;
6656 *)
6657 AC_CHECK_LIB(m, cos, LIBM=-lm)
6658 ;;
6659 esac
6660 AC_SUBST([LIBM])
6661 ])# LT_LIB_M
6662
6663 # Old name:
6664 AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
6665 dnl aclocal-1.4 backwards compatibility:
6666 dnl AC_DEFUN([AC_CHECK_LIBM], [])
6667
6668
6669 # _LT_COMPILER_NO_RTTI([TAGNAME])
6670 # -------------------------------
6671 m4_defun([_LT_COMPILER_NO_RTTI],
6672 [m4_require([_LT_TAG_COMPILER])dnl
6673
6674 _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
6675
6676 if test yes = "$GCC"; then
6677 case $cc_basename in
6678 nvcc*)
6679 _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;;
6680 *)
6681 _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;;
6682 esac
6683
6684 _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
6685 lt_cv_prog_compiler_rtti_exceptions,
6686 [-fno-rtti -fno-exceptions], [],
6687 [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
6688 fi
6689 _LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
6690 [Compiler flag to turn off builtin functions])
6691 ])# _LT_COMPILER_NO_RTTI
6692
6693
6694 # _LT_CMD_GLOBAL_SYMBOLS
6695 # ----------------------
6696 m4_defun([_LT_CMD_GLOBAL_SYMBOLS],
6697 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
6698 AC_REQUIRE([AC_PROG_CC])dnl
6699 AC_REQUIRE([AC_PROG_AWK])dnl
6700 AC_REQUIRE([LT_PATH_NM])dnl
6701 AC_REQUIRE([LT_PATH_LD])dnl
6702 m4_require([_LT_DECL_SED])dnl
6703 m4_require([_LT_DECL_EGREP])dnl
6704 m4_require([_LT_TAG_COMPILER])dnl
6705
6706 # Check for command to grab the raw symbol name followed by C symbol from nm.
6707 AC_MSG_CHECKING([command to parse $NM output from $compiler object])
6708 AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
6709 [
6710 # These are sane defaults that work on at least a few old systems.
6711 # [They come from Ultrix. What could be older than Ultrix?!! ;)]
6712
6713 # Character class describing NM global symbol codes.
6714 symcode='[[BCDEGRST]]'
6715
6716 # Regexp to match symbols that can be accessed directly from C.
6717 sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
6718
6719 # Define system-specific variables.
6720 case $host_os in
6721 aix*)
6722 symcode='[[BCDT]]'
6723 ;;
6724 cygwin* | mingw* | pw32* | cegcc*)
6725 symcode='[[ABCDGISTW]]'
6726 ;;
6727 hpux*)
6728 if test ia64 = "$host_cpu"; then
6729 symcode='[[ABCDEGRST]]'
6730 fi
6731 ;;
6732 irix* | nonstopux*)
6733 symcode='[[BCDEGRST]]'
6734 ;;
6735 osf*)
6736 symcode='[[BCDEGQRST]]'
6737 ;;
6738 solaris*)
6739 symcode='[[BDRT]]'
6740 ;;
6741 sco3.2v5*)
6742 symcode='[[DT]]'
6743 ;;
6744 sysv4.2uw2*)
6745 symcode='[[DT]]'
6746 ;;
6747 sysv5* | sco5v6* | unixware* | OpenUNIX*)
6748 symcode='[[ABDT]]'
6749 ;;
6750 sysv4)
6751 symcode='[[DFNSTU]]'
6752 ;;
6753 esac
6754
6755 # If we're using GNU nm, then use its standard symbol codes.
6756 case `$NM -V 2>&1` in
6757 *GNU* | *'with BFD'*)
6758 symcode='[[ABCDGIRSTW]]' ;;
6759 esac
6760
6761 if test "$lt_cv_nm_interface" = "MS dumpbin"; then
6762 # Gets list of data symbols to import.
6763 lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'"
6764 # Adjust the below global symbol transforms to fixup imported variables.
6765 lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'"
6766 lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'"
6767 lt_c_name_lib_hook="\
6768 -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\
6769 -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'"
6770 else
6771 # Disable hooks by default.
6772 lt_cv_sys_global_symbol_to_import=
6773 lt_cdecl_hook=
6774 lt_c_name_hook=
6775 lt_c_name_lib_hook=
6776 fi
6777
6778 # Transform an extracted symbol line into a proper C declaration.
6779 # Some systems (esp. on ia64) link data and code symbols differently,
6780 # so use this general approach.
6781 lt_cv_sys_global_symbol_to_cdecl="sed -n"\
6782 $lt_cdecl_hook\
6783 " -e 's/^T .* \(.*\)$/extern int \1();/p'"\
6784 " -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'"
6785
6786 # Transform an extracted symbol line into symbol name and symbol address
6787 lt_cv_sys_global_symbol_to_c_name_address="sed -n"\
6788 $lt_c_name_hook\
6789 " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\
6790 " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'"
6791
6792 # Transform an extracted symbol line into symbol name with lib prefix and
6793 # symbol address.
6794 lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\
6795 $lt_c_name_lib_hook\
6796 " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\
6797 " -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\
6798 " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/p'"
6799
6800 # Handle CRLF in mingw tool chain
6801 opt_cr=
6802 case $build_os in
6803 mingw*)
6804 opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
6805 ;;
6806 esac
6807
6808 # Try without a prefix underscore, then with it.
6809 for ac_symprfx in "" "_"; do
6810
6811 # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
6812 symxfrm="\\1 $ac_symprfx\\2 \\2"
6813
6814 # Write the raw and C identifiers.
6815 if test "$lt_cv_nm_interface" = "MS dumpbin"; then
6816 # Fake it for dumpbin and say T for any non-static function,
6817 # D for any global variable and I for any imported variable.
6818 # Also find C++ and __fastcall symbols from MSVC++,
6819 # which start with @ or ?.
6820 lt_cv_sys_global_symbol_pipe="$AWK ['"\
6821 " {last_section=section; section=\$ 3};"\
6822 " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
6823 " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
6824 " /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\
6825 " /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\
6826 " /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\
6827 " \$ 0!~/External *\|/{next};"\
6828 " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
6829 " {if(hide[section]) next};"\
6830 " {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\
6831 " {split(\$ 0,a,/\||\r/); split(a[2],s)};"\
6832 " s[1]~/^[@?]/{print f,s[1],s[1]; next};"\
6833 " s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\
6834 " ' prfx=^$ac_symprfx]"
6835 else
6836 lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
6837 fi
6838 lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
6839
6840 # Check to see that the pipe works correctly.
6841 pipe_works=no
6842
6843 rm -f conftest*
6844 cat > conftest.$ac_ext <<_LT_EOF
6845 #ifdef __cplusplus
6846 extern "C" {
6847 #endif
6848 char nm_test_var;
6849 void nm_test_func(void);
6850 void nm_test_func(void){}
6851 #ifdef __cplusplus
6852 }
6853 #endif
6854 int main(){nm_test_var='a';nm_test_func();return(0);}
6855 _LT_EOF
6856
6857 if AC_TRY_EVAL(ac_compile); then
6858 # Now try to grab the symbols.
6859 nlist=conftest.nm
6860 if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then
6861 # Try sorting and uniquifying the output.
6862 if sort "$nlist" | uniq > "$nlist"T; then
6863 mv -f "$nlist"T "$nlist"
6864 else
6865 rm -f "$nlist"T
6866 fi
6867
6868 # Make sure that we snagged all the symbols we need.
6869 if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
6870 if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
6871 cat <<_LT_EOF > conftest.$ac_ext
6872 /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */
6873 #if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE
6874 /* DATA imports from DLLs on WIN32 can't be const, because runtime
6875 relocations are performed -- see ld's documentation on pseudo-relocs. */
6876 # define LT@&t@_DLSYM_CONST
6877 #elif defined __osf__
6878 /* This system does not cope well with relocations in const data. */
6879 # define LT@&t@_DLSYM_CONST
6880 #else
6881 # define LT@&t@_DLSYM_CONST const
6882 #endif
6883
6884 #ifdef __cplusplus
6885 extern "C" {
6886 #endif
6887
6888 _LT_EOF
6889 # Now generate the symbol file.
6890 eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
6891
6892 cat <<_LT_EOF >> conftest.$ac_ext
6893
6894 /* The mapping between symbol names and symbols. */
6895 LT@&t@_DLSYM_CONST struct {
6896 const char *name;
6897 void *address;
6898 }
6899 lt__PROGRAM__LTX_preloaded_symbols[[]] =
6900 {
6901 { "@PROGRAM@", (void *) 0 },
6902 _LT_EOF
6903 $SED "s/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
6904 cat <<\_LT_EOF >> conftest.$ac_ext
6905 {0, (void *) 0}
6906 };
6907
6908 /* This works around a problem in FreeBSD linker */
6909 #ifdef FREEBSD_WORKAROUND
6910 static const void *lt_preloaded_setup() {
6911 return lt__PROGRAM__LTX_preloaded_symbols;
6912 }
6913 #endif
6914
6915 #ifdef __cplusplus
6916 }
6917 #endif
6918 _LT_EOF
6919 # Now try linking the two files.
6920 mv conftest.$ac_objext conftstm.$ac_objext
6921 lt_globsym_save_LIBS=$LIBS
6922 lt_globsym_save_CFLAGS=$CFLAGS
6923 LIBS=conftstm.$ac_objext
6924 CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
6925 if AC_TRY_EVAL(ac_link) && test -s conftest$ac_exeext; then
6926 pipe_works=yes
6927 fi
6928 LIBS=$lt_globsym_save_LIBS
6929 CFLAGS=$lt_globsym_save_CFLAGS
6930 else
6931 echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
6932 fi
6933 else
6934 echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
6935 fi
6936 else
6937 echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
6938 fi
6939 else
6940 echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
6941 cat conftest.$ac_ext >&5
6942 fi
6943 rm -rf conftest* conftst*
6944
6945 # Do not use the global_symbol_pipe unless it works.
6946 if test yes = "$pipe_works"; then
6947 break
6948 else
6949 lt_cv_sys_global_symbol_pipe=
6950 fi
6951 done
6952 ])
6953 if test -z "$lt_cv_sys_global_symbol_pipe"; then
6954 lt_cv_sys_global_symbol_to_cdecl=
6955 fi
6956 if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
6957 AC_MSG_RESULT(failed)
6958 else
6959 AC_MSG_RESULT(ok)
6960 fi
6961
6962 # Response file support.
6963 if test "$lt_cv_nm_interface" = "MS dumpbin"; then
6964 nm_file_list_spec='@'
6965 elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then
6966 nm_file_list_spec='@'
6967 fi
6968
6969 _LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
6970 [Take the output of nm and produce a listing of raw symbols and C names])
6971 _LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
6972 [Transform the output of nm in a proper C declaration])
6973 _LT_DECL([global_symbol_to_import], [lt_cv_sys_global_symbol_to_import], [1],
6974 [Transform the output of nm into a list of symbols to manually relocate])
6975 _LT_DECL([global_symbol_to_c_name_address],
6976 [lt_cv_sys_global_symbol_to_c_name_address], [1],
6977 [Transform the output of nm in a C name address pair])
6978 _LT_DECL([global_symbol_to_c_name_address_lib_prefix],
6979 [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
6980 [Transform the output of nm in a C name address pair when lib prefix is needed])
6981 _LT_DECL([nm_interface], [lt_cv_nm_interface], [1],
6982 [The name lister interface])
6983 _LT_DECL([], [nm_file_list_spec], [1],
6984 [Specify filename containing input files for $NM])
6985 ]) # _LT_CMD_GLOBAL_SYMBOLS
6986
6987
6988 # _LT_COMPILER_PIC([TAGNAME])
6989 # ---------------------------
6990 m4_defun([_LT_COMPILER_PIC],
6991 [m4_require([_LT_TAG_COMPILER])dnl
6992 _LT_TAGVAR(lt_prog_compiler_wl, $1)=
6993 _LT_TAGVAR(lt_prog_compiler_pic, $1)=
6994 _LT_TAGVAR(lt_prog_compiler_static, $1)=
6995
6996 m4_if([$1], [CXX], [
6997 # C++ specific cases for pic, static, wl, etc.
6998 if test yes = "$GXX"; then
6999 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
7000 _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
7001
7002 case $host_os in
7003 aix*)
7004 # All AIX code is PIC.
7005 if test ia64 = "$host_cpu"; then
7006 # AIX 5 now supports IA64 processor
7007 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
7008 fi
7009 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
7010 ;;
7011
7012 amigaos*)
7013 case $host_cpu in
7014 powerpc)
7015 # see comment about AmigaOS4 .so support
7016 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
7017 ;;
7018 m68k)
7019 # FIXME: we need at least 68020 code to build shared libraries, but
7020 # adding the '-m68020' flag to GCC prevents building anything better,
7021 # like '-m68040'.
7022 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
7023 ;;
7024 esac
7025 ;;
7026
7027 beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
7028 # PIC is the default for these OSes.
7029 ;;
7030 mingw* | cygwin* | os2* | pw32* | cegcc*)
7031 # This hack is so that the source file can tell whether it is being
7032 # built for inclusion in a dll (and should export symbols for example).
7033 # Although the cygwin gcc ignores -fPIC, still need this for old-style
7034 # (--disable-auto-import) libraries
7035 m4_if([$1], [GCJ], [],
7036 [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
7037 case $host_os in
7038 os2*)
7039 _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'
7040 ;;
7041 esac
7042 ;;
7043 darwin* | rhapsody*)
7044 # PIC is the default on this platform
7045 # Common symbols not allowed in MH_DYLIB files
7046 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
7047 ;;
7048 *djgpp*)
7049 # DJGPP does not support shared libraries at all
7050 _LT_TAGVAR(lt_prog_compiler_pic, $1)=
7051 ;;
7052 haiku*)
7053 # PIC is the default for Haiku.
7054 # The "-static" flag exists, but is broken.
7055 _LT_TAGVAR(lt_prog_compiler_static, $1)=
7056 ;;
7057 interix[[3-9]]*)
7058 # Interix 3.x gcc -fpic/-fPIC options generate broken code.
7059 # Instead, we relocate shared libraries at runtime.
7060 ;;
7061 sysv4*MP*)
7062 if test -d /usr/nec; then
7063 _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
7064 fi
7065 ;;
7066 hpux*)
7067 # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
7068 # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag
7069 # sets the default TLS model and affects inlining.
7070 case $host_cpu in
7071 hppa*64*)
7072 ;;
7073 *)
7074 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
7075 ;;
7076 esac
7077 ;;
7078 *qnx* | *nto*)
7079 # QNX uses GNU C++, but need to define -shared option too, otherwise
7080 # it will coredump.
7081 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
7082 ;;
7083 *)
7084 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
7085 ;;
7086 esac
7087 else
7088 case $host_os in
7089 aix[[4-9]]*)
7090 # All AIX code is PIC.
7091 if test ia64 = "$host_cpu"; then
7092 # AIX 5 now supports IA64 processor
7093 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
7094 else
7095 _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
7096 fi
7097 ;;
7098 chorus*)
7099 case $cc_basename in
7100 cxch68*)
7101 # Green Hills C++ Compiler
7102 # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
7103 ;;
7104 esac
7105 ;;
7106 mingw* | cygwin* | os2* | pw32* | cegcc*)
7107 # This hack is so that the source file can tell whether it is being
7108 # built for inclusion in a dll (and should export symbols for example).
7109 m4_if([$1], [GCJ], [],
7110 [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
7111 ;;
7112 dgux*)
7113 case $cc_basename in
7114 ec++*)
7115 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
7116 ;;
7117 ghcx*)
7118 # Green Hills C++ Compiler
7119 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
7120 ;;
7121 *)
7122 ;;
7123 esac
7124 ;;
7125 freebsd* | dragonfly*)
7126 # FreeBSD uses GNU C++
7127 ;;
7128 hpux9* | hpux10* | hpux11*)
7129 case $cc_basename in
7130 CC*)
7131 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
7132 _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'
7133 if test ia64 != "$host_cpu"; then
7134 _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
7135 fi
7136 ;;
7137 aCC*)
7138 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
7139 _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'
7140 case $host_cpu in
7141 hppa*64*|ia64*)
7142 # +Z the default
7143 ;;
7144 *)
7145 _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
7146 ;;
7147 esac
7148 ;;
7149 *)
7150 ;;
7151 esac
7152 ;;
7153 interix*)
7154 # This is c89, which is MS Visual C++ (no shared libs)
7155 # Anyone wants to do a port?
7156 ;;
7157 irix5* | irix6* | nonstopux*)
7158 case $cc_basename in
7159 CC*)
7160 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
7161 _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
7162 # CC pic flag -KPIC is the default.
7163 ;;
7164 *)
7165 ;;
7166 esac
7167 ;;
7168 linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
7169 case $cc_basename in
7170 KCC*)
7171 # KAI C++ Compiler
7172 _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
7173 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
7174 ;;
7175 ecpc* )
7176 # old Intel C++ for x86_64, which still supported -KPIC.
7177 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
7178 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
7179 _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
7180 ;;
7181 icpc* )
7182 # Intel C++, used to be incompatible with GCC.
7183 # ICC 10 doesn't accept -KPIC any more.
7184 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
7185 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
7186 _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
7187 ;;
7188 pgCC* | pgcpp*)
7189 # Portland Group C++ compiler
7190 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
7191 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
7192 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
7193 ;;
7194 cxx*)
7195 # Compaq C++
7196 # Make sure the PIC flag is empty. It appears that all Alpha
7197 # Linux and Compaq Tru64 Unix objects are PIC.
7198 _LT_TAGVAR(lt_prog_compiler_pic, $1)=
7199 _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
7200 ;;
7201 xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*)
7202 # IBM XL 8.0, 9.0 on PPC and BlueGene
7203 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
7204 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
7205 _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
7206 ;;
7207 *)
7208 case `$CC -V 2>&1 | sed 5q` in
7209 *Sun\ C*)
7210 # Sun C++ 5.9
7211 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
7212 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
7213 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
7214 ;;
7215 esac
7216 ;;
7217 esac
7218 ;;
7219 lynxos*)
7220 ;;
7221 m88k*)
7222 ;;
7223 mvs*)
7224 case $cc_basename in
7225 cxx*)
7226 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
7227 ;;
7228 *)
7229 ;;
7230 esac
7231 ;;
7232 netbsd*)
7233 ;;
7234 *qnx* | *nto*)
7235 # QNX uses GNU C++, but need to define -shared option too, otherwise
7236 # it will coredump.
7237 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
7238 ;;
7239 osf3* | osf4* | osf5*)
7240 case $cc_basename in
7241 KCC*)
7242 _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
7243 ;;
7244 RCC*)
7245 # Rational C++ 2.4.1
7246 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
7247 ;;
7248 cxx*)
7249 # Digital/Compaq C++
7250 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
7251 # Make sure the PIC flag is empty. It appears that all Alpha
7252 # Linux and Compaq Tru64 Unix objects are PIC.
7253 _LT_TAGVAR(lt_prog_compiler_pic, $1)=
7254 _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
7255 ;;
7256 *)
7257 ;;
7258 esac
7259 ;;
7260 psos*)
7261 ;;
7262 solaris*)
7263 case $cc_basename in
7264 CC* | sunCC*)
7265 # Sun C++ 4.2, 5.x and Centerline C++
7266 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
7267 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
7268 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
7269 ;;
7270 gcx*)
7271 # Green Hills C++ Compiler
7272 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
7273 ;;
7274 *)
7275 ;;
7276 esac
7277 ;;
7278 sunos4*)
7279 case $cc_basename in
7280 CC*)
7281 # Sun C++ 4.x
7282 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
7283 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
7284 ;;
7285 lcc*)
7286 # Lucid
7287 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
7288 ;;
7289 *)
7290 ;;
7291 esac
7292 ;;
7293 sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
7294 case $cc_basename in
7295 CC*)
7296 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
7297 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
7298 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
7299 ;;
7300 esac
7301 ;;
7302 tandem*)
7303 case $cc_basename in
7304 NCC*)
7305 # NonStop-UX NCC 3.20
7306 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
7307 ;;
7308 *)
7309 ;;
7310 esac
7311 ;;
7312 vxworks*)
7313 ;;
7314 *)
7315 _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
7316 ;;
7317 esac
7318 fi
7319 ],
7320 [
7321 if test yes = "$GCC"; then
7322 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
7323 _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
7324
7325 case $host_os in
7326 aix*)
7327 # All AIX code is PIC.
7328 if test ia64 = "$host_cpu"; then
7329 # AIX 5 now supports IA64 processor
7330 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
7331 fi
7332 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
7333 ;;
7334
7335 amigaos*)
7336 case $host_cpu in
7337 powerpc)
7338 # see comment about AmigaOS4 .so support
7339 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
7340 ;;
7341 m68k)
7342 # FIXME: we need at least 68020 code to build shared libraries, but
7343 # adding the '-m68020' flag to GCC prevents building anything better,
7344 # like '-m68040'.
7345 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
7346 ;;
7347 esac
7348 ;;
7349
7350 beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
7351 # PIC is the default for these OSes.
7352 ;;
7353
7354 mingw* | cygwin* | pw32* | os2* | cegcc*)
7355 # This hack is so that the source file can tell whether it is being
7356 # built for inclusion in a dll (and should export symbols for example).
7357 # Although the cygwin gcc ignores -fPIC, still need this for old-style
7358 # (--disable-auto-import) libraries
7359 m4_if([$1], [GCJ], [],
7360 [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
7361 case $host_os in
7362 os2*)
7363 _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'
7364 ;;
7365 esac
7366 ;;
7367
7368 darwin* | rhapsody*)
7369 # PIC is the default on this platform
7370 # Common symbols not allowed in MH_DYLIB files
7371 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
7372 ;;
7373
7374 haiku*)
7375 # PIC is the default for Haiku.
7376 # The "-static" flag exists, but is broken.
7377 _LT_TAGVAR(lt_prog_compiler_static, $1)=
7378 ;;
7379
7380 hpux*)
7381 # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
7382 # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag
7383 # sets the default TLS model and affects inlining.
7384 case $host_cpu in
7385 hppa*64*)
7386 # +Z the default
7387 ;;
7388 *)
7389 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
7390 ;;
7391 esac
7392 ;;
7393
7394 interix[[3-9]]*)
7395 # Interix 3.x gcc -fpic/-fPIC options generate broken code.
7396 # Instead, we relocate shared libraries at runtime.
7397 ;;
7398
7399 msdosdjgpp*)
7400 # Just because we use GCC doesn't mean we suddenly get shared libraries
7401 # on systems that don't support them.
7402 _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
7403 enable_shared=no
7404 ;;
7405
7406 *nto* | *qnx*)
7407 # QNX uses GNU C++, but need to define -shared option too, otherwise
7408 # it will coredump.
7409 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
7410 ;;
7411
7412 sysv4*MP*)
7413 if test -d /usr/nec; then
7414 _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
7415 fi
7416 ;;
7417
7418 *)
7419 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
7420 ;;
7421 esac
7422
7423 case $cc_basename in
7424 nvcc*) # Cuda Compiler Driver 2.2
7425 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker '
7426 if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
7427 _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)"
7428 fi
7429 ;;
7430 esac
7431 else
7432 # PORTME Check for flag to pass linker flags through the system compiler.
7433 case $host_os in
7434 aix*)
7435 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
7436 if test ia64 = "$host_cpu"; then
7437 # AIX 5 now supports IA64 processor
7438 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
7439 else
7440 _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
7441 fi
7442 ;;
7443
7444 darwin* | rhapsody*)
7445 # PIC is the default on this platform
7446 # Common symbols not allowed in MH_DYLIB files
7447 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
7448 case $cc_basename in
7449 nagfor*)
7450 # NAG Fortran compiler
7451 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
7452 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
7453 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
7454 ;;
7455 esac
7456 ;;
7457
7458 mingw* | cygwin* | pw32* | os2* | cegcc*)
7459 # This hack is so that the source file can tell whether it is being
7460 # built for inclusion in a dll (and should export symbols for example).
7461 m4_if([$1], [GCJ], [],
7462 [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
7463 case $host_os in
7464 os2*)
7465 _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'
7466 ;;
7467 esac
7468 ;;
7469
7470 hpux9* | hpux10* | hpux11*)
7471 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
7472 # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
7473 # not for PA HP-UX.
7474 case $host_cpu in
7475 hppa*64*|ia64*)
7476 # +Z the default
7477 ;;
7478 *)
7479 _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
7480 ;;
7481 esac
7482 # Is there a better lt_prog_compiler_static that works with the bundled CC?
7483 _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'
7484 ;;
7485
7486 irix5* | irix6* | nonstopux*)
7487 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
7488 # PIC (with -KPIC) is the default.
7489 _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
7490 ;;
7491
7492 linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
7493 case $cc_basename in
7494 # old Intel for x86_64, which still supported -KPIC.
7495 ecc*)
7496 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
7497 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
7498 _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
7499 ;;
7500 # icc used to be incompatible with GCC.
7501 # ICC 10 doesn't accept -KPIC any more.
7502 icc* | ifort*)
7503 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
7504 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
7505 _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
7506 ;;
7507 # Lahey Fortran 8.1.
7508 lf95*)
7509 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
7510 _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
7511 _LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
7512 ;;
7513 nagfor*)
7514 # NAG Fortran compiler
7515 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
7516 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
7517 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
7518 ;;
7519 tcc*)
7520 # Fabrice Bellard et al's Tiny C Compiler
7521 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
7522 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
7523 _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
7524 ;;
7525 pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
7526 # Portland Group compilers (*not* the Pentium gcc compiler,
7527 # which looks to be a dead project)
7528 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
7529 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
7530 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
7531 ;;
7532 ccc*)
7533 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
7534 # All Alpha code is PIC.
7535 _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
7536 ;;
7537 xl* | bgxl* | bgf* | mpixl*)
7538 # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
7539 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
7540 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
7541 _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
7542 ;;
7543 *)
7544 case `$CC -V 2>&1 | sed 5q` in
7545 *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*)
7546 # Sun Fortran 8.3 passes all unrecognized flags to the linker
7547 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
7548 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
7549 _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
7550 ;;
7551 *Sun\ F* | *Sun*Fortran*)
7552 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
7553 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
7554 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
7555 ;;
7556 *Sun\ C*)
7557 # Sun C 5.9
7558 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
7559 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
7560 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
7561 ;;
7562 *Intel*\ [[CF]]*Compiler*)
7563 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
7564 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
7565 _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
7566 ;;
7567 *Portland\ Group*)
7568 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
7569 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
7570 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
7571 ;;
7572 esac
7573 ;;
7574 esac
7575 ;;
7576
7577 newsos6)
7578 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
7579 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
7580 ;;
7581
7582 *nto* | *qnx*)
7583 # QNX uses GNU C++, but need to define -shared option too, otherwise
7584 # it will coredump.
7585 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
7586 ;;
7587
7588 osf3* | osf4* | osf5*)
7589 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
7590 # All OSF/1 code is PIC.
7591 _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
7592 ;;
7593
7594 rdos*)
7595 _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
7596 ;;
7597
7598 solaris*)
7599 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
7600 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
7601 case $cc_basename in
7602 f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
7603 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
7604 *)
7605 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
7606 esac
7607 ;;
7608
7609 sunos4*)
7610 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
7611 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
7612 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
7613 ;;
7614
7615 sysv4 | sysv4.2uw2* | sysv4.3*)
7616 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
7617 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
7618 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
7619 ;;
7620
7621 sysv4*MP*)
7622 if test -d /usr/nec; then
7623 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
7624 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
7625 fi
7626 ;;
7627
7628 sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
7629 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
7630 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
7631 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
7632 ;;
7633
7634 unicos*)
7635 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
7636 _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
7637 ;;
7638
7639 uts4*)
7640 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
7641 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
7642 ;;
7643
7644 *)
7645 _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
7646 ;;
7647 esac
7648 fi
7649 ])
7650 case $host_os in
7651 # For platforms that do not support PIC, -DPIC is meaningless:
7652 *djgpp*)
7653 _LT_TAGVAR(lt_prog_compiler_pic, $1)=
7654 ;;
7655 *)
7656 _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
7657 ;;
7658 esac
7659
7660 AC_CACHE_CHECK([for $compiler option to produce PIC],
7661 [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)],
7662 [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
7663 _LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)
7664
7665 #
7666 # Check to make sure the PIC flag actually works.
7667 #
7668 if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
7669 _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],
7670 [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],
7671 [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],
7672 [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in
7673 "" | " "*) ;;
7674 *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;
7675 esac],
7676 [_LT_TAGVAR(lt_prog_compiler_pic, $1)=
7677 _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
7678 fi
7679 _LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
7680 [Additional compiler flags for building library objects])
7681
7682 _LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
7683 [How to pass a linker flag through the compiler])
7684 #
7685 # Check to make sure the static flag actually works.
7686 #
7687 wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"
7688 _LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
7689 _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),
7690 $lt_tmp_static_flag,
7691 [],
7692 [_LT_TAGVAR(lt_prog_compiler_static, $1)=])
7693 _LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
7694 [Compiler flag to prevent dynamic linking])
7695 ])# _LT_COMPILER_PIC
7696
7697
7698 # _LT_LINKER_SHLIBS([TAGNAME])
7699 # ----------------------------
7700 # See if the linker supports building shared libraries.
7701 m4_defun([_LT_LINKER_SHLIBS],
7702 [AC_REQUIRE([LT_PATH_LD])dnl
7703 AC_REQUIRE([LT_PATH_NM])dnl
7704 m4_require([_LT_PATH_MANIFEST_TOOL])dnl
7705 m4_require([_LT_FILEUTILS_DEFAULTS])dnl
7706 m4_require([_LT_DECL_EGREP])dnl
7707 m4_require([_LT_DECL_SED])dnl
7708 m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
7709 m4_require([_LT_TAG_COMPILER])dnl
7710 AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
7711 m4_if([$1], [CXX], [
7712 _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
7713 _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
7714 case $host_os in
7715 aix[[4-9]]*)
7716 # If we're using GNU nm, then we don't want the "-C" option.
7717 # -C means demangle to GNU nm, but means don't demangle to AIX nm.
7718 # Without the "-l" option, or with the "-B" option, AIX nm treats
7719 # weak defined symbols like other global defined symbols, whereas
7720 # GNU nm marks them as "W".
7721 # While the 'weak' keyword is ignored in the Export File, we need
7722 # it in the Import File for the 'aix-soname' feature, so we have
7723 # to replace the "-B" option with "-P" for AIX nm.
7724 if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
7725 _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols'
7726 else
7727 _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
7728 fi
7729 ;;
7730 pw32*)
7731 _LT_TAGVAR(export_symbols_cmds, $1)=$ltdll_cmds
7732 ;;
7733 cygwin* | mingw* | cegcc*)
7734 case $cc_basename in
7735 cl*)
7736 _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
7737 ;;
7738 *)
7739 _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
7740 _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
7741 ;;
7742 esac
7743 ;;
7744 *)
7745 _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
7746 ;;
7747 esac
7748 ], [
7749 runpath_var=
7750 _LT_TAGVAR(allow_undefined_flag, $1)=
7751 _LT_TAGVAR(always_export_symbols, $1)=no
7752 _LT_TAGVAR(archive_cmds, $1)=
7753 _LT_TAGVAR(archive_expsym_cmds, $1)=
7754 _LT_TAGVAR(compiler_needs_object, $1)=no
7755 _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
7756 _LT_TAGVAR(export_dynamic_flag_spec, $1)=
7757 _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
7758 _LT_TAGVAR(hardcode_automatic, $1)=no
7759 _LT_TAGVAR(hardcode_direct, $1)=no
7760 _LT_TAGVAR(hardcode_direct_absolute, $1)=no
7761 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
7762 _LT_TAGVAR(hardcode_libdir_separator, $1)=
7763 _LT_TAGVAR(hardcode_minus_L, $1)=no
7764 _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
7765 _LT_TAGVAR(inherit_rpath, $1)=no
7766 _LT_TAGVAR(link_all_deplibs, $1)=unknown
7767 _LT_TAGVAR(module_cmds, $1)=
7768 _LT_TAGVAR(module_expsym_cmds, $1)=
7769 _LT_TAGVAR(old_archive_from_new_cmds, $1)=
7770 _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
7771 _LT_TAGVAR(thread_safe_flag_spec, $1)=
7772 _LT_TAGVAR(whole_archive_flag_spec, $1)=
7773 # include_expsyms should be a list of space-separated symbols to be *always*
7774 # included in the symbol list
7775 _LT_TAGVAR(include_expsyms, $1)=
7776 # exclude_expsyms can be an extended regexp of symbols to exclude
7777 # it will be wrapped by ' (' and ')$', so one must not match beginning or
7778 # end of line. Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc',
7779 # as well as any symbol that contains 'd'.
7780 _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
7781 # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
7782 # platforms (ab)use it in PIC code, but their linkers get confused if
7783 # the symbol is explicitly referenced. Since portable code cannot
7784 # rely on this symbol name, it's probably fine to never include it in
7785 # preloaded symbol tables.
7786 # Exclude shared library initialization/finalization symbols.
7787 dnl Note also adjust exclude_expsyms for C++ above.
7788 extract_expsyms_cmds=
7789
7790 case $host_os in
7791 cygwin* | mingw* | pw32* | cegcc*)
7792 # FIXME: the MSVC++ port hasn't been tested in a loooong time
7793 # When not using gcc, we currently assume that we are using
7794 # Microsoft Visual C++.
7795 if test yes != "$GCC"; then
7796 with_gnu_ld=no
7797 fi
7798 ;;
7799 interix*)
7800 # we just hope/assume this is gcc and not c89 (= MSVC++)
7801 with_gnu_ld=yes
7802 ;;
7803 openbsd* | bitrig*)
7804 with_gnu_ld=no
7805 ;;
7806 esac
7807
7808 _LT_TAGVAR(ld_shlibs, $1)=yes
7809
7810 # On some targets, GNU ld is compatible enough with the native linker
7811 # that we're better off using the native interface for both.
7812 lt_use_gnu_ld_interface=no
7813 if test yes = "$with_gnu_ld"; then
7814 case $host_os in
7815 aix*)
7816 # The AIX port of GNU ld has always aspired to compatibility
7817 # with the native linker. However, as the warning in the GNU ld
7818 # block says, versions before 2.19.5* couldn't really create working
7819 # shared libraries, regardless of the interface used.
7820 case `$LD -v 2>&1` in
7821 *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
7822 *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;;
7823 *\ \(GNU\ Binutils\)\ [[3-9]]*) ;;
7824 *)
7825 lt_use_gnu_ld_interface=yes
7826 ;;
7827 esac
7828 ;;
7829 *)
7830 lt_use_gnu_ld_interface=yes
7831 ;;
7832 esac
7833 fi
7834
7835 if test yes = "$lt_use_gnu_ld_interface"; then
7836 # If archive_cmds runs LD, not CC, wlarc should be empty
7837 wlarc='$wl'
7838
7839 # Set some defaults for GNU ld with shared library support. These
7840 # are reset later if shared libraries are not supported. Putting them
7841 # here allows them to be overridden if necessary.
7842 runpath_var=LD_RUN_PATH
7843 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
7844 _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
7845 # ancient GNU ld didn't support --whole-archive et. al.
7846 if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
7847 _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
7848 else
7849 _LT_TAGVAR(whole_archive_flag_spec, $1)=
7850 fi
7851 supports_anon_versioning=no
7852 case `$LD -v | $SED -e 's/([^)]\+)\s\+//' 2>&1` in
7853 *GNU\ gold*) supports_anon_versioning=yes ;;
7854 *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
7855 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
7856 *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
7857 *\ 2.11.*) ;; # other 2.11 versions
7858 *) supports_anon_versioning=yes ;;
7859 esac
7860
7861 # See if GNU ld supports shared libraries.
7862 case $host_os in
7863 aix[[3-9]]*)
7864 # On AIX/PPC, the GNU linker is very broken
7865 if test ia64 != "$host_cpu"; then
7866 _LT_TAGVAR(ld_shlibs, $1)=no
7867 cat <<_LT_EOF 1>&2
7868
7869 *** Warning: the GNU linker, at least up to release 2.19, is reported
7870 *** to be unable to reliably create shared libraries on AIX.
7871 *** Therefore, libtool is disabling shared libraries support. If you
7872 *** really care for shared libraries, you may want to install binutils
7873 *** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
7874 *** You will then need to restart the configuration process.
7875
7876 _LT_EOF
7877 fi
7878 ;;
7879
7880 amigaos*)
7881 case $host_cpu in
7882 powerpc)
7883 # see comment about AmigaOS4 .so support
7884 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
7885 _LT_TAGVAR(archive_expsym_cmds, $1)=''
7886 ;;
7887 m68k)
7888 _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
7889 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
7890 _LT_TAGVAR(hardcode_minus_L, $1)=yes
7891 ;;
7892 esac
7893 ;;
7894
7895 beos*)
7896 if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
7897 _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
7898 # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
7899 # support --undefined. This deserves some investigation. FIXME
7900 _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
7901 else
7902 _LT_TAGVAR(ld_shlibs, $1)=no
7903 fi
7904 ;;
7905
7906 cygwin* | mingw* | pw32* | cegcc*)
7907 # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
7908 # as there is no search path for DLLs.
7909 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
7910 _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols'
7911 _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
7912 _LT_TAGVAR(always_export_symbols, $1)=no
7913 _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
7914 _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
7915 _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
7916
7917 if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
7918 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
7919 # If the export-symbols file already is a .def file, use it as
7920 # is; otherwise, prepend EXPORTS...
7921 _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
7922 cp $export_symbols $output_objdir/$soname.def;
7923 else
7924 echo EXPORTS > $output_objdir/$soname.def;
7925 cat $export_symbols >> $output_objdir/$soname.def;
7926 fi~
7927 $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
7928 else
7929 _LT_TAGVAR(ld_shlibs, $1)=no
7930 fi
7931 ;;
7932
7933 haiku*)
7934 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
7935 _LT_TAGVAR(link_all_deplibs, $1)=yes
7936 ;;
7937
7938 os2*)
7939 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
7940 _LT_TAGVAR(hardcode_minus_L, $1)=yes
7941 _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
7942 shrext_cmds=.dll
7943 _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
7944 $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
7945 $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
7946 $ECHO EXPORTS >> $output_objdir/$libname.def~
7947 emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
7948 $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
7949 emximp -o $lib $output_objdir/$libname.def'
7950 _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
7951 $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
7952 $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
7953 $ECHO EXPORTS >> $output_objdir/$libname.def~
7954 prefix_cmds="$SED"~
7955 if test EXPORTS = "`$SED 1q $export_symbols`"; then
7956 prefix_cmds="$prefix_cmds -e 1d";
7957 fi~
7958 prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
7959 cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
7960 $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
7961 emximp -o $lib $output_objdir/$libname.def'
7962 _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
7963 _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
7964 ;;
7965
7966 interix[[3-9]]*)
7967 _LT_TAGVAR(hardcode_direct, $1)=no
7968 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7969 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
7970 _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
7971 # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
7972 # Instead, shared libraries are loaded at an image base (0x10000000 by
7973 # default) and relocated if they conflict, which is a slow very memory
7974 # consuming and fragmenting process. To avoid this, we pick a random,
7975 # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
7976 # time. Moving up from 0x10000000 also allows more sbrk(2) space.
7977 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
7978 _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
7979 ;;
7980
7981 gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
7982 tmp_diet=no
7983 if test linux-dietlibc = "$host_os"; then
7984 case $cc_basename in
7985 diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn)
7986 esac
7987 fi
7988 if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
7989 && test no = "$tmp_diet"
7990 then
7991 tmp_addflag=' $pic_flag'
7992 tmp_sharedflag='-shared'
7993 case $cc_basename,$host_cpu in
7994 pgcc*) # Portland Group C compiler
7995 _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
7996 tmp_addflag=' $pic_flag'
7997 ;;
7998 pgf77* | pgf90* | pgf95* | pgfortran*)
7999 # Portland Group f77 and f90 compilers
8000 _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
8001 tmp_addflag=' $pic_flag -Mnomain' ;;
8002 ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64
8003 tmp_addflag=' -i_dynamic' ;;
8004 efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64
8005 tmp_addflag=' -i_dynamic -nofor_main' ;;
8006 ifc* | ifort*) # Intel Fortran compiler
8007 tmp_addflag=' -nofor_main' ;;
8008 lf95*) # Lahey Fortran 8.1
8009 _LT_TAGVAR(whole_archive_flag_spec, $1)=
8010 tmp_sharedflag='--shared' ;;
8011 nagfor*) # NAGFOR 5.3
8012 tmp_sharedflag='-Wl,-shared' ;;
8013 xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
8014 tmp_sharedflag='-qmkshrobj'
8015 tmp_addflag= ;;
8016 nvcc*) # Cuda Compiler Driver 2.2
8017 _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
8018 _LT_TAGVAR(compiler_needs_object, $1)=yes
8019 ;;
8020 esac
8021 case `$CC -V 2>&1 | sed 5q` in
8022 *Sun\ C*) # Sun C 5.9
8023 _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
8024 _LT_TAGVAR(compiler_needs_object, $1)=yes
8025 tmp_sharedflag='-G' ;;
8026 *Sun\ F*) # Sun Fortran 8.3
8027 tmp_sharedflag='-G' ;;
8028 esac
8029 _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
8030
8031 if test yes = "$supports_anon_versioning"; then
8032 _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
8033 cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
8034 echo "local: *; };" >> $output_objdir/$libname.ver~
8035 $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
8036 fi
8037
8038 case $cc_basename in
8039 tcc*)
8040 _LT_TAGVAR(export_dynamic_flag_spec, $1)='-rdynamic'
8041 ;;
8042 xlf* | bgf* | bgxlf* | mpixlf*)
8043 # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
8044 _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
8045 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
8046 _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
8047 if test yes = "$supports_anon_versioning"; then
8048 _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
8049 cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
8050 echo "local: *; };" >> $output_objdir/$libname.ver~
8051 $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
8052 fi
8053 ;;
8054 esac
8055 else
8056 _LT_TAGVAR(ld_shlibs, $1)=no
8057 fi
8058 ;;
8059
8060 netbsd*)
8061 if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
8062 _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
8063 wlarc=
8064 else
8065 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
8066 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
8067 fi
8068 ;;
8069
8070 solaris*)
8071 if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
8072 _LT_TAGVAR(ld_shlibs, $1)=no
8073 cat <<_LT_EOF 1>&2
8074
8075 *** Warning: The releases 2.8.* of the GNU linker cannot reliably
8076 *** create shared libraries on Solaris systems. Therefore, libtool
8077 *** is disabling shared libraries support. We urge you to upgrade GNU
8078 *** binutils to release 2.9.1 or newer. Another option is to modify
8079 *** your PATH or compiler configuration so that the native linker is
8080 *** used, and then restart.
8081
8082 _LT_EOF
8083 elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
8084 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
8085 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
8086 else
8087 _LT_TAGVAR(ld_shlibs, $1)=no
8088 fi
8089 ;;
8090
8091 sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
8092 case `$LD -v 2>&1` in
8093 *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
8094 _LT_TAGVAR(ld_shlibs, $1)=no
8095 cat <<_LT_EOF 1>&2
8096
8097 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot
8098 *** reliably create shared libraries on SCO systems. Therefore, libtool
8099 *** is disabling shared libraries support. We urge you to upgrade GNU
8100 *** binutils to release 2.16.91.0.3 or newer. Another option is to modify
8101 *** your PATH or compiler configuration so that the native linker is
8102 *** used, and then restart.
8103
8104 _LT_EOF
8105 ;;
8106 *)
8107 # For security reasons, it is highly recommended that you always
8108 # use absolute paths for naming shared libraries, and exclude the
8109 # DT_RUNPATH tag from executables and libraries. But doing so
8110 # requires that you compile everything twice, which is a pain.
8111 if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
8112 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
8113 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
8114 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
8115 else
8116 _LT_TAGVAR(ld_shlibs, $1)=no
8117 fi
8118 ;;
8119 esac
8120 ;;
8121
8122 sunos4*)
8123 _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
8124 wlarc=
8125 _LT_TAGVAR(hardcode_direct, $1)=yes
8126 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
8127 ;;
8128
8129 *)
8130 if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
8131 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
8132 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
8133 else
8134 _LT_TAGVAR(ld_shlibs, $1)=no
8135 fi
8136 ;;
8137 esac
8138
8139 if test no = "$_LT_TAGVAR(ld_shlibs, $1)"; then
8140 runpath_var=
8141 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
8142 _LT_TAGVAR(export_dynamic_flag_spec, $1)=
8143 _LT_TAGVAR(whole_archive_flag_spec, $1)=
8144 fi
8145 else
8146 # PORTME fill in a description of your system's linker (not GNU ld)
8147 case $host_os in
8148 aix3*)
8149 _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
8150 _LT_TAGVAR(always_export_symbols, $1)=yes
8151 _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
8152 # Note: this linker hardcodes the directories in LIBPATH if there
8153 # are no directories specified by -L.
8154 _LT_TAGVAR(hardcode_minus_L, $1)=yes
8155 if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then
8156 # Neither direct hardcoding nor static linking is supported with a
8157 # broken collect2.
8158 _LT_TAGVAR(hardcode_direct, $1)=unsupported
8159 fi
8160 ;;
8161
8162 aix[[4-9]]*)
8163 if test ia64 = "$host_cpu"; then
8164 # On IA64, the linker does run time linking by default, so we don't
8165 # have to do anything special.
8166 aix_use_runtimelinking=no
8167 exp_sym_flag='-Bexport'
8168 no_entry_flag=
8169 else
8170 # If we're using GNU nm, then we don't want the "-C" option.
8171 # -C means demangle to GNU nm, but means don't demangle to AIX nm.
8172 # Without the "-l" option, or with the "-B" option, AIX nm treats
8173 # weak defined symbols like other global defined symbols, whereas
8174 # GNU nm marks them as "W".
8175 # While the 'weak' keyword is ignored in the Export File, we need
8176 # it in the Import File for the 'aix-soname' feature, so we have
8177 # to replace the "-B" option with "-P" for AIX nm.
8178 if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
8179 _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols'
8180 else
8181 _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
8182 fi
8183 aix_use_runtimelinking=no
8184
8185 # Test if we are trying to use run time linking or normal
8186 # AIX style linking. If -brtl is somewhere in LDFLAGS, we
8187 # have runtime linking enabled, and use it for executables.
8188 # For shared libraries, we enable/disable runtime linking
8189 # depending on the kind of the shared library created -
8190 # when "with_aix_soname,aix_use_runtimelinking" is:
8191 # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables
8192 # "aix,yes" lib.so shared, rtl:yes, for executables
8193 # lib.a static archive
8194 # "both,no" lib.so.V(shr.o) shared, rtl:yes
8195 # lib.a(lib.so.V) shared, rtl:no, for executables
8196 # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables
8197 # lib.a(lib.so.V) shared, rtl:no
8198 # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables
8199 # lib.a static archive
8200 case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
8201 for ld_flag in $LDFLAGS; do
8202 if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then
8203 aix_use_runtimelinking=yes
8204 break
8205 fi
8206 done
8207 if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then
8208 # With aix-soname=svr4, we create the lib.so.V shared archives only,
8209 # so we don't have lib.a shared libs to link our executables.
8210 # We have to force runtime linking in this case.
8211 aix_use_runtimelinking=yes
8212 LDFLAGS="$LDFLAGS -Wl,-brtl"
8213 fi
8214 ;;
8215 esac
8216
8217 exp_sym_flag='-bexport'
8218 no_entry_flag='-bnoentry'
8219 fi
8220
8221 # When large executables or shared objects are built, AIX ld can
8222 # have problems creating the table of contents. If linking a library
8223 # or program results in "error TOC overflow" add -mminimal-toc to
8224 # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
8225 # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
8226
8227 _LT_TAGVAR(archive_cmds, $1)=''
8228 _LT_TAGVAR(hardcode_direct, $1)=yes
8229 _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
8230 _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
8231 _LT_TAGVAR(link_all_deplibs, $1)=yes
8232 _LT_TAGVAR(file_list_spec, $1)='$wl-f,'
8233 case $with_aix_soname,$aix_use_runtimelinking in
8234 aix,*) ;; # traditional, no import file
8235 svr4,* | *,yes) # use import file
8236 # The Import File defines what to hardcode.
8237 _LT_TAGVAR(hardcode_direct, $1)=no
8238 _LT_TAGVAR(hardcode_direct_absolute, $1)=no
8239 ;;
8240 esac
8241
8242 if test yes = "$GCC"; then
8243 case $host_os in aix4.[[012]]|aix4.[[012]].*)
8244 # We only want to do this on AIX 4.2 and lower, the check
8245 # below for broken collect2 doesn't work under 4.3+
8246 collect2name=`$CC -print-prog-name=collect2`
8247 if test -f "$collect2name" &&
8248 strings "$collect2name" | $GREP resolve_lib_name >/dev/null
8249 then
8250 # We have reworked collect2
8251 :
8252 else
8253 # We have old collect2
8254 _LT_TAGVAR(hardcode_direct, $1)=unsupported
8255 # It fails to find uninstalled libraries when the uninstalled
8256 # path is not listed in the libpath. Setting hardcode_minus_L
8257 # to unsupported forces relinking
8258 _LT_TAGVAR(hardcode_minus_L, $1)=yes
8259 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
8260 _LT_TAGVAR(hardcode_libdir_separator, $1)=
8261 fi
8262 ;;
8263 esac
8264 shared_flag='-shared'
8265 if test yes = "$aix_use_runtimelinking"; then
8266 shared_flag="$shared_flag "'$wl-G'
8267 fi
8268 # Need to ensure runtime linking is disabled for the traditional
8269 # shared library, or the linker may eventually find shared libraries
8270 # /with/ Import File - we do not want to mix them.
8271 shared_flag_aix='-shared'
8272 shared_flag_svr4='-shared $wl-G'
8273 else
8274 # not using gcc
8275 if test ia64 = "$host_cpu"; then
8276 # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
8277 # chokes on -Wl,-G. The following line is correct:
8278 shared_flag='-G'
8279 else
8280 if test yes = "$aix_use_runtimelinking"; then
8281 shared_flag='$wl-G'
8282 else
8283 shared_flag='$wl-bM:SRE'
8284 fi
8285 shared_flag_aix='$wl-bM:SRE'
8286 shared_flag_svr4='$wl-G'
8287 fi
8288 fi
8289
8290 _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall'
8291 # It seems that -bexpall does not export symbols beginning with
8292 # underscore (_), so it is better to generate a list of symbols to export.
8293 _LT_TAGVAR(always_export_symbols, $1)=yes
8294 if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then
8295 # Warning - without using the other runtime loading flags (-brtl),
8296 # -berok will link without error, but may produce a broken library.
8297 _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
8298 # Determine the default libpath from the value encoded in an
8299 # empty executable.
8300 _LT_SYS_MODULE_PATH_AIX([$1])
8301 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
8302 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag
8303 else
8304 if test ia64 = "$host_cpu"; then
8305 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib'
8306 _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
8307 _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols"
8308 else
8309 # Determine the default libpath from the value encoded in an
8310 # empty executable.
8311 _LT_SYS_MODULE_PATH_AIX([$1])
8312 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
8313 # Warning - without using the other run time loading flags,
8314 # -berok will link without error, but may produce a broken library.
8315 _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok'
8316 _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok'
8317 if test yes = "$with_gnu_ld"; then
8318 # We only use this code for GNU lds that support --whole-archive.
8319 _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
8320 else
8321 # Exported symbols can be pulled into shared objects from archives
8322 _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
8323 fi
8324 _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
8325 _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d'
8326 # -brtl affects multiple linker settings, -berok does not and is overridden later
8327 compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`'
8328 if test svr4 != "$with_aix_soname"; then
8329 # This is similar to how AIX traditionally builds its shared libraries.
8330 _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname'
8331 fi
8332 if test aix != "$with_aix_soname"; then
8333 _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp'
8334 else
8335 # used by -dlpreopen to get the symbols
8336 _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV $output_objdir/$realname.d/$soname $output_objdir'
8337 fi
8338 _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d'
8339 fi
8340 fi
8341 ;;
8342
8343 amigaos*)
8344 case $host_cpu in
8345 powerpc)
8346 # see comment about AmigaOS4 .so support
8347 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
8348 _LT_TAGVAR(archive_expsym_cmds, $1)=''
8349 ;;
8350 m68k)
8351 _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
8352 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
8353 _LT_TAGVAR(hardcode_minus_L, $1)=yes
8354 ;;
8355 esac
8356 ;;
8357
8358 bsdi[[45]]*)
8359 _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
8360 ;;
8361
8362 cygwin* | mingw* | pw32* | cegcc*)
8363 # When not using gcc, we currently assume that we are using
8364 # Microsoft Visual C++.
8365 # hardcode_libdir_flag_spec is actually meaningless, as there is
8366 # no search path for DLLs.
8367 case $cc_basename in
8368 cl*)
8369 # Native MSVC
8370 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
8371 _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
8372 _LT_TAGVAR(always_export_symbols, $1)=yes
8373 _LT_TAGVAR(file_list_spec, $1)='@'
8374 # Tell ltmain to make .lib files, not .a files.
8375 libext=lib
8376 # Tell ltmain to make .dll files, not .so files.
8377 shrext_cmds=.dll
8378 # FIXME: Setting linknames here is a bad hack.
8379 _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames='
8380 _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
8381 cp "$export_symbols" "$output_objdir/$soname.def";
8382 echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp";
8383 else
8384 $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp;
8385 fi~
8386 $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
8387 linknames='
8388 # The linker will not automatically build a static lib if we build a DLL.
8389 # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
8390 _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
8391 _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
8392 _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols'
8393 # Don't use ranlib
8394 _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
8395 _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
8396 lt_tool_outputfile="@TOOL_OUTPUT@"~
8397 case $lt_outputfile in
8398 *.exe|*.EXE) ;;
8399 *)
8400 lt_outputfile=$lt_outputfile.exe
8401 lt_tool_outputfile=$lt_tool_outputfile.exe
8402 ;;
8403 esac~
8404 if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then
8405 $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
8406 $RM "$lt_outputfile.manifest";
8407 fi'
8408 ;;
8409 *)
8410 # Assume MSVC wrapper
8411 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
8412 _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
8413 # Tell ltmain to make .lib files, not .a files.
8414 libext=lib
8415 # Tell ltmain to make .dll files, not .so files.
8416 shrext_cmds=.dll
8417 # FIXME: Setting linknames here is a bad hack.
8418 _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
8419 # The linker will automatically build a .lib file if we build a DLL.
8420 _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
8421 # FIXME: Should let the user specify the lib program.
8422 _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
8423 _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
8424 ;;
8425 esac
8426 ;;
8427
8428 darwin* | rhapsody*)
8429 _LT_DARWIN_LINKER_FEATURES($1)
8430 ;;
8431
8432 dgux*)
8433 _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
8434 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
8435 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
8436 ;;
8437
8438 # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
8439 # support. Future versions do this automatically, but an explicit c++rt0.o
8440 # does not break anything, and helps significantly (at the cost of a little
8441 # extra space).
8442 freebsd2.2*)
8443 _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
8444 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
8445 _LT_TAGVAR(hardcode_direct, $1)=yes
8446 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
8447 ;;
8448
8449 # Unfortunately, older versions of FreeBSD 2 do not have this feature.
8450 freebsd2.*)
8451 _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
8452 _LT_TAGVAR(hardcode_direct, $1)=yes
8453 _LT_TAGVAR(hardcode_minus_L, $1)=yes
8454 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
8455 ;;
8456
8457 # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
8458 freebsd* | dragonfly*)
8459 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
8460 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
8461 _LT_TAGVAR(hardcode_direct, $1)=yes
8462 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
8463 ;;
8464
8465 hpux9*)
8466 if test yes = "$GCC"; then
8467 _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
8468 else
8469 _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
8470 fi
8471 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
8472 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
8473 _LT_TAGVAR(hardcode_direct, $1)=yes
8474
8475 # hardcode_minus_L: Not really in the search PATH,
8476 # but as the default location of the library.
8477 _LT_TAGVAR(hardcode_minus_L, $1)=yes
8478 _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
8479 ;;
8480
8481 hpux10*)
8482 if test yes,no = "$GCC,$with_gnu_ld"; then
8483 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
8484 else
8485 _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
8486 fi
8487 if test no = "$with_gnu_ld"; then
8488 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
8489 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
8490 _LT_TAGVAR(hardcode_direct, $1)=yes
8491 _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
8492 _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
8493 # hardcode_minus_L: Not really in the search PATH,
8494 # but as the default location of the library.
8495 _LT_TAGVAR(hardcode_minus_L, $1)=yes
8496 fi
8497 ;;
8498
8499 hpux11*)
8500 if test yes,no = "$GCC,$with_gnu_ld"; then
8501 case $host_cpu in
8502 hppa*64*)
8503 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
8504 ;;
8505 ia64*)
8506 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
8507 ;;
8508 *)
8509 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
8510 ;;
8511 esac
8512 else
8513 case $host_cpu in
8514 hppa*64*)
8515 _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
8516 ;;
8517 ia64*)
8518 _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
8519 ;;
8520 *)
8521 m4_if($1, [], [
8522 # Older versions of the 11.00 compiler do not understand -b yet
8523 # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
8524 _LT_LINKER_OPTION([if $CC understands -b],
8525 _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b],
8526 [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],
8527 [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])],
8528 [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'])
8529 ;;
8530 esac
8531 fi
8532 if test no = "$with_gnu_ld"; then
8533 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
8534 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
8535
8536 case $host_cpu in
8537 hppa*64*|ia64*)
8538 _LT_TAGVAR(hardcode_direct, $1)=no
8539 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
8540 ;;
8541 *)
8542 _LT_TAGVAR(hardcode_direct, $1)=yes
8543 _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
8544 _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
8545
8546 # hardcode_minus_L: Not really in the search PATH,
8547 # but as the default location of the library.
8548 _LT_TAGVAR(hardcode_minus_L, $1)=yes
8549 ;;
8550 esac
8551 fi
8552 ;;
8553
8554 irix5* | irix6* | nonstopux*)
8555 if test yes = "$GCC"; then
8556 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
8557 # Try to use the -exported_symbol ld option, if it does not
8558 # work, assume that -exports_file does not work either and
8559 # implicitly export all symbols.
8560 # This should be the same for all languages, so no per-tag cache variable.
8561 AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol],
8562 [lt_cv_irix_exported_symbol],
8563 [save_LDFLAGS=$LDFLAGS
8564 LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null"
8565 AC_LINK_IFELSE(
8566 [AC_LANG_SOURCE(
8567 [AC_LANG_CASE([C], [[int foo (void) { return 0; }]],
8568 [C++], [[int foo (void) { return 0; }]],
8569 [Fortran 77], [[
8570 subroutine foo
8571 end]],
8572 [Fortran], [[
8573 subroutine foo
8574 end]])])],
8575 [lt_cv_irix_exported_symbol=yes],
8576 [lt_cv_irix_exported_symbol=no])
8577 LDFLAGS=$save_LDFLAGS])
8578 if test yes = "$lt_cv_irix_exported_symbol"; then
8579 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib'
8580 fi
8581 else
8582 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
8583 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib'
8584 fi
8585 _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
8586 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
8587 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
8588 _LT_TAGVAR(inherit_rpath, $1)=yes
8589 _LT_TAGVAR(link_all_deplibs, $1)=yes
8590 ;;
8591
8592 linux*)
8593 case $cc_basename in
8594 tcc*)
8595 # Fabrice Bellard et al's Tiny C Compiler
8596 _LT_TAGVAR(ld_shlibs, $1)=yes
8597 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
8598 ;;
8599 esac
8600 ;;
8601
8602 netbsd*)
8603 if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
8604 _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
8605 else
8606 _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
8607 fi
8608 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
8609 _LT_TAGVAR(hardcode_direct, $1)=yes
8610 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
8611 ;;
8612
8613 newsos6)
8614 _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
8615 _LT_TAGVAR(hardcode_direct, $1)=yes
8616 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
8617 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
8618 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
8619 ;;
8620
8621 *nto* | *qnx*)
8622 ;;
8623
8624 openbsd* | bitrig*)
8625 if test -f /usr/libexec/ld.so; then
8626 _LT_TAGVAR(hardcode_direct, $1)=yes
8627 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
8628 _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
8629 if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
8630 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
8631 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols'
8632 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
8633 _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
8634 else
8635 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
8636 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
8637 fi
8638 else
8639 _LT_TAGVAR(ld_shlibs, $1)=no
8640 fi
8641 ;;
8642
8643 os2*)
8644 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
8645 _LT_TAGVAR(hardcode_minus_L, $1)=yes
8646 _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
8647 shrext_cmds=.dll
8648 _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
8649 $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
8650 $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
8651 $ECHO EXPORTS >> $output_objdir/$libname.def~
8652 emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
8653 $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
8654 emximp -o $lib $output_objdir/$libname.def'
8655 _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
8656 $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
8657 $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
8658 $ECHO EXPORTS >> $output_objdir/$libname.def~
8659 prefix_cmds="$SED"~
8660 if test EXPORTS = "`$SED 1q $export_symbols`"; then
8661 prefix_cmds="$prefix_cmds -e 1d";
8662 fi~
8663 prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
8664 cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
8665 $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
8666 emximp -o $lib $output_objdir/$libname.def'
8667 _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
8668 _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
8669 ;;
8670
8671 osf3*)
8672 if test yes = "$GCC"; then
8673 _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
8674 _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
8675 else
8676 _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
8677 _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
8678 fi
8679 _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
8680 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
8681 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
8682 ;;
8683
8684 osf4* | osf5*) # as osf3* with the addition of -msym flag
8685 if test yes = "$GCC"; then
8686 _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
8687 _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
8688 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
8689 else
8690 _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
8691 _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
8692 _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
8693 $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp'
8694
8695 # Both c and cxx compiler support -rpath directly
8696 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
8697 fi
8698 _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
8699 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
8700 ;;
8701
8702 solaris*)
8703 _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
8704 if test yes = "$GCC"; then
8705 wlarc='$wl'
8706 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
8707 _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
8708 $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
8709 else
8710 case `$CC -V 2>&1` in
8711 *"Compilers 5.0"*)
8712 wlarc=''
8713 _LT_TAGVAR(archive_cmds, $1)='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags'
8714 _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
8715 $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
8716 ;;
8717 *)
8718 wlarc='$wl'
8719 _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags'
8720 _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
8721 $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
8722 ;;
8723 esac
8724 fi
8725 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
8726 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
8727 case $host_os in
8728 solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
8729 *)
8730 # The compiler driver will combine and reorder linker options,
8731 # but understands '-z linker_flag'. GCC discards it without '$wl',
8732 # but is careful enough not to reorder.
8733 # Supported since Solaris 2.6 (maybe 2.5.1?)
8734 if test yes = "$GCC"; then
8735 _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract'
8736 else
8737 _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
8738 fi
8739 ;;
8740 esac
8741 _LT_TAGVAR(link_all_deplibs, $1)=yes
8742 ;;
8743
8744 sunos4*)
8745 if test sequent = "$host_vendor"; then
8746 # Use $CC to link under sequent, because it throws in some extra .o
8747 # files that make .init and .fini sections work.
8748 _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags'
8749 else
8750 _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
8751 fi
8752 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
8753 _LT_TAGVAR(hardcode_direct, $1)=yes
8754 _LT_TAGVAR(hardcode_minus_L, $1)=yes
8755 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
8756 ;;
8757
8758 sysv4)
8759 case $host_vendor in
8760 sni)
8761 _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
8762 _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
8763 ;;
8764 siemens)
8765 ## LD is ld it makes a PLAMLIB
8766 ## CC just makes a GrossModule.
8767 _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
8768 _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
8769 _LT_TAGVAR(hardcode_direct, $1)=no
8770 ;;
8771 motorola)
8772 _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
8773 _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
8774 ;;
8775 esac
8776 runpath_var='LD_RUN_PATH'
8777 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
8778 ;;
8779
8780 sysv4.3*)
8781 _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
8782 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
8783 _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
8784 ;;
8785
8786 sysv4*MP*)
8787 if test -d /usr/nec; then
8788 _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
8789 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
8790 runpath_var=LD_RUN_PATH
8791 hardcode_runpath_var=yes
8792 _LT_TAGVAR(ld_shlibs, $1)=yes
8793 fi
8794 ;;
8795
8796 sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
8797 _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
8798 _LT_TAGVAR(archive_cmds_need_lc, $1)=no
8799 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
8800 runpath_var='LD_RUN_PATH'
8801
8802 if test yes = "$GCC"; then
8803 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
8804 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
8805 else
8806 _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
8807 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
8808 fi
8809 ;;
8810
8811 sysv5* | sco3.2v5* | sco5v6*)
8812 # Note: We CANNOT use -z defs as we might desire, because we do not
8813 # link with -lc, and that would cause any symbols used from libc to
8814 # always be unresolved, which means just about no library would
8815 # ever link correctly. If we're not using GNU ld we use -z text
8816 # though, which does catch some bad symbols but isn't as heavy-handed
8817 # as -z defs.
8818 _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
8819 _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs'
8820 _LT_TAGVAR(archive_cmds_need_lc, $1)=no
8821 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
8822 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir'
8823 _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
8824 _LT_TAGVAR(link_all_deplibs, $1)=yes
8825 _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport'
8826 runpath_var='LD_RUN_PATH'
8827
8828 if test yes = "$GCC"; then
8829 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
8830 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
8831 else
8832 _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
8833 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
8834 fi
8835 ;;
8836
8837 uts4*)
8838 _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
8839 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
8840 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
8841 ;;
8842
8843 *)
8844 _LT_TAGVAR(ld_shlibs, $1)=no
8845 ;;
8846 esac
8847
8848 if test sni = "$host_vendor"; then
8849 case $host in
8850 sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
8851 _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Blargedynsym'
8852 ;;
8853 esac
8854 fi
8855 fi
8856 ])
8857 AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
8858 test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no
8859
8860 _LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
8861
8862 _LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
8863 _LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
8864 _LT_DECL([], [extract_expsyms_cmds], [2],
8865 [The commands to extract the exported symbol list from a shared archive])
8866
8867 #
8868 # Do we need to explicitly link libc?
8869 #
8870 case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
8871 x|xyes)
8872 # Assume -lc should be added
8873 _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
8874
8875 if test yes,yes = "$GCC,$enable_shared"; then
8876 case $_LT_TAGVAR(archive_cmds, $1) in
8877 *'~'*)
8878 # FIXME: we may have to deal with multi-command sequences.
8879 ;;
8880 '$CC '*)
8881 # Test whether the compiler implicitly links with -lc since on some
8882 # systems, -lgcc has to come before -lc. If gcc already passes -lc
8883 # to ld, don't add -lc before -lgcc.
8884 AC_CACHE_CHECK([whether -lc should be explicitly linked in],
8885 [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1),
8886 [$RM conftest*
8887 echo "$lt_simple_compile_test_code" > conftest.$ac_ext
8888
8889 if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
8890 soname=conftest
8891 lib=conftest
8892 libobjs=conftest.$ac_objext
8893 deplibs=
8894 wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
8895 pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
8896 compiler_flags=-v
8897 linker_flags=-v
8898 verstring=
8899 output_objdir=.
8900 libname=conftest
8901 lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
8902 _LT_TAGVAR(allow_undefined_flag, $1)=
8903 if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
8904 then
8905 lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no
8906 else
8907 lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes
8908 fi
8909 _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
8910 else
8911 cat conftest.err 1>&5
8912 fi
8913 $RM conftest*
8914 ])
8915 _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)
8916 ;;
8917 esac
8918 fi
8919 ;;
8920 esac
8921
8922 _LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
8923 [Whether or not to add -lc for building shared libraries])
8924 _LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
8925 [enable_shared_with_static_runtimes], [0],
8926 [Whether or not to disallow shared libs when runtime libs are static])
8927 _LT_TAGDECL([], [export_dynamic_flag_spec], [1],
8928 [Compiler flag to allow reflexive dlopens])
8929 _LT_TAGDECL([], [whole_archive_flag_spec], [1],
8930 [Compiler flag to generate shared objects directly from archives])
8931 _LT_TAGDECL([], [compiler_needs_object], [1],
8932 [Whether the compiler copes with passing no objects directly])
8933 _LT_TAGDECL([], [old_archive_from_new_cmds], [2],
8934 [Create an old-style archive from a shared archive])
8935 _LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
8936 [Create a temporary old-style archive to link instead of a shared archive])
8937 _LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
8938 _LT_TAGDECL([], [archive_expsym_cmds], [2])
8939 _LT_TAGDECL([], [module_cmds], [2],
8940 [Commands used to build a loadable module if different from building
8941 a shared archive.])
8942 _LT_TAGDECL([], [module_expsym_cmds], [2])
8943 _LT_TAGDECL([], [with_gnu_ld], [1],
8944 [Whether we are building with GNU ld or not])
8945 _LT_TAGDECL([], [allow_undefined_flag], [1],
8946 [Flag that allows shared libraries with undefined symbols to be built])
8947 _LT_TAGDECL([], [no_undefined_flag], [1],
8948 [Flag that enforces no undefined symbols])
8949 _LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
8950 [Flag to hardcode $libdir into a binary during linking.
8951 This must work even if $libdir does not exist])
8952 _LT_TAGDECL([], [hardcode_libdir_separator], [1],
8953 [Whether we need a single "-rpath" flag with a separated argument])
8954 _LT_TAGDECL([], [hardcode_direct], [0],
8955 [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
8956 DIR into the resulting binary])
8957 _LT_TAGDECL([], [hardcode_direct_absolute], [0],
8958 [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
8959 DIR into the resulting binary and the resulting library dependency is
8960 "absolute", i.e impossible to change by setting $shlibpath_var if the
8961 library is relocated])
8962 _LT_TAGDECL([], [hardcode_minus_L], [0],
8963 [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
8964 into the resulting binary])
8965 _LT_TAGDECL([], [hardcode_shlibpath_var], [0],
8966 [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
8967 into the resulting binary])
8968 _LT_TAGDECL([], [hardcode_automatic], [0],
8969 [Set to "yes" if building a shared library automatically hardcodes DIR
8970 into the library and all subsequent libraries and executables linked
8971 against it])
8972 _LT_TAGDECL([], [inherit_rpath], [0],
8973 [Set to yes if linker adds runtime paths of dependent libraries
8974 to runtime path list])
8975 _LT_TAGDECL([], [link_all_deplibs], [0],
8976 [Whether libtool must link a program against all its dependency libraries])
8977 _LT_TAGDECL([], [always_export_symbols], [0],
8978 [Set to "yes" if exported symbols are required])
8979 _LT_TAGDECL([], [export_symbols_cmds], [2],
8980 [The commands to list exported symbols])
8981 _LT_TAGDECL([], [exclude_expsyms], [1],
8982 [Symbols that should not be listed in the preloaded symbols])
8983 _LT_TAGDECL([], [include_expsyms], [1],
8984 [Symbols that must always be exported])
8985 _LT_TAGDECL([], [prelink_cmds], [2],
8986 [Commands necessary for linking programs (against libraries) with templates])
8987 _LT_TAGDECL([], [postlink_cmds], [2],
8988 [Commands necessary for finishing linking programs])
8989 _LT_TAGDECL([], [file_list_spec], [1],
8990 [Specify filename containing input files])
8991 dnl FIXME: Not yet implemented
8992 dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
8993 dnl [Compiler flag to generate thread safe objects])
8994 ])# _LT_LINKER_SHLIBS
8995
8996
8997 # _LT_LANG_C_CONFIG([TAG])
8998 # ------------------------
8999 # Ensure that the configuration variables for a C compiler are suitably
9000 # defined. These variables are subsequently used by _LT_CONFIG to write
9001 # the compiler configuration to 'libtool'.
9002 m4_defun([_LT_LANG_C_CONFIG],
9003 [m4_require([_LT_DECL_EGREP])dnl
9004 lt_save_CC=$CC
9005 AC_LANG_PUSH(C)
9006
9007 # Source file extension for C test sources.
9008 ac_ext=c
9009
9010 # Object file extension for compiled C test sources.
9011 objext=o
9012 _LT_TAGVAR(objext, $1)=$objext
9013
9014 # Code to be used in simple compile tests
9015 lt_simple_compile_test_code="int some_variable = 0;"
9016
9017 # Code to be used in simple link tests
9018 lt_simple_link_test_code='int main(){return(0);}'
9019
9020 _LT_TAG_COMPILER
9021 # Save the default compiler, since it gets overwritten when the other
9022 # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
9023 compiler_DEFAULT=$CC
9024
9025 # save warnings/boilerplate of simple test code
9026 _LT_COMPILER_BOILERPLATE
9027 _LT_LINKER_BOILERPLATE
9028
9029 if test -n "$compiler"; then
9030 _LT_COMPILER_NO_RTTI($1)
9031 _LT_COMPILER_PIC($1)
9032 _LT_COMPILER_C_O($1)
9033 _LT_COMPILER_FILE_LOCKS($1)
9034 _LT_LINKER_SHLIBS($1)
9035 _LT_SYS_DYNAMIC_LINKER($1)
9036 _LT_LINKER_HARDCODE_LIBPATH($1)
9037 LT_SYS_DLOPEN_SELF
9038 _LT_CMD_STRIPLIB
9039
9040 # Report what library types will actually be built
9041 AC_MSG_CHECKING([if libtool supports shared libraries])
9042 AC_MSG_RESULT([$can_build_shared])
9043
9044 AC_MSG_CHECKING([whether to build shared libraries])
9045 test no = "$can_build_shared" && enable_shared=no
9046
9047 # On AIX, shared libraries and static libraries use the same namespace, and
9048 # are all built from PIC.
9049 case $host_os in
9050 aix3*)
9051 test yes = "$enable_shared" && enable_static=no
9052 if test -n "$RANLIB"; then
9053 archive_cmds="$archive_cmds~\$RANLIB \$lib"
9054 postinstall_cmds='$RANLIB $lib'
9055 fi
9056 ;;
9057
9058 aix[[4-9]]*)
9059 if test ia64 != "$host_cpu"; then
9060 case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
9061 yes,aix,yes) ;; # shared object as lib.so file only
9062 yes,svr4,*) ;; # shared object as lib.so archive member only
9063 yes,*) enable_static=no ;; # shared object in lib.a archive as well
9064 esac
9065 fi
9066 ;;
9067 esac
9068 AC_MSG_RESULT([$enable_shared])
9069
9070 AC_MSG_CHECKING([whether to build static libraries])
9071 # Make sure either enable_shared or enable_static is yes.
9072 test yes = "$enable_shared" || enable_static=yes
9073 AC_MSG_RESULT([$enable_static])
9074
9075 _LT_CONFIG($1)
9076 fi
9077 AC_LANG_POP
9078 CC=$lt_save_CC
9079 ])# _LT_LANG_C_CONFIG
9080
9081
9082 # _LT_LANG_CXX_CONFIG([TAG])
9083 # --------------------------
9084 # Ensure that the configuration variables for a C++ compiler are suitably
9085 # defined. These variables are subsequently used by _LT_CONFIG to write
9086 # the compiler configuration to 'libtool'.
9087 m4_defun([_LT_LANG_CXX_CONFIG],
9088 [m4_require([_LT_FILEUTILS_DEFAULTS])dnl
9089 m4_require([_LT_DECL_EGREP])dnl
9090 m4_require([_LT_PATH_MANIFEST_TOOL])dnl
9091 if test -n "$CXX" && ( test no != "$CXX" &&
9092 ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) ||
9093 (test g++ != "$CXX"))); then
9094 AC_PROG_CXXCPP
9095 else
9096 _lt_caught_CXX_error=yes
9097 fi
9098
9099 AC_LANG_PUSH(C++)
9100 _LT_TAGVAR(archive_cmds_need_lc, $1)=no
9101 _LT_TAGVAR(allow_undefined_flag, $1)=
9102 _LT_TAGVAR(always_export_symbols, $1)=no
9103 _LT_TAGVAR(archive_expsym_cmds, $1)=
9104 _LT_TAGVAR(compiler_needs_object, $1)=no
9105 _LT_TAGVAR(export_dynamic_flag_spec, $1)=
9106 _LT_TAGVAR(hardcode_direct, $1)=no
9107 _LT_TAGVAR(hardcode_direct_absolute, $1)=no
9108 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
9109 _LT_TAGVAR(hardcode_libdir_separator, $1)=
9110 _LT_TAGVAR(hardcode_minus_L, $1)=no
9111 _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
9112 _LT_TAGVAR(hardcode_automatic, $1)=no
9113 _LT_TAGVAR(inherit_rpath, $1)=no
9114 _LT_TAGVAR(module_cmds, $1)=
9115 _LT_TAGVAR(module_expsym_cmds, $1)=
9116 _LT_TAGVAR(link_all_deplibs, $1)=unknown
9117 _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
9118 _LT_TAGVAR(reload_flag, $1)=$reload_flag
9119 _LT_TAGVAR(reload_cmds, $1)=$reload_cmds
9120 _LT_TAGVAR(no_undefined_flag, $1)=
9121 _LT_TAGVAR(whole_archive_flag_spec, $1)=
9122 _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
9123
9124 # Source file extension for C++ test sources.
9125 ac_ext=cpp
9126
9127 # Object file extension for compiled C++ test sources.
9128 objext=o
9129 _LT_TAGVAR(objext, $1)=$objext
9130
9131 # No sense in running all these tests if we already determined that
9132 # the CXX compiler isn't working. Some variables (like enable_shared)
9133 # are currently assumed to apply to all compilers on this platform,
9134 # and will be corrupted by setting them based on a non-working compiler.
9135 if test yes != "$_lt_caught_CXX_error"; then
9136 # Code to be used in simple compile tests
9137 lt_simple_compile_test_code="int some_variable = 0;"
9138
9139 # Code to be used in simple link tests
9140 lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
9141
9142 # ltmain only uses $CC for tagged configurations so make sure $CC is set.
9143 _LT_TAG_COMPILER
9144
9145 # save warnings/boilerplate of simple test code
9146 _LT_COMPILER_BOILERPLATE
9147 _LT_LINKER_BOILERPLATE
9148
9149 # Allow CC to be a program name with arguments.
9150 lt_save_CC=$CC
9151 lt_save_CFLAGS=$CFLAGS
9152 lt_save_LD=$LD
9153 lt_save_GCC=$GCC
9154 GCC=$GXX
9155 lt_save_with_gnu_ld=$with_gnu_ld
9156 lt_save_path_LD=$lt_cv_path_LD
9157 if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
9158 lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
9159 else
9160 $as_unset lt_cv_prog_gnu_ld
9161 fi
9162 if test -n "${lt_cv_path_LDCXX+set}"; then
9163 lt_cv_path_LD=$lt_cv_path_LDCXX
9164 else
9165 $as_unset lt_cv_path_LD
9166 fi
9167 test -z "${LDCXX+set}" || LD=$LDCXX
9168 CC=${CXX-"c++"}
9169 CFLAGS=$CXXFLAGS
9170 compiler=$CC
9171 _LT_TAGVAR(compiler, $1)=$CC
9172 _LT_CC_BASENAME([$compiler])
9173
9174 if test -n "$compiler"; then
9175 # We don't want -fno-exception when compiling C++ code, so set the
9176 # no_builtin_flag separately
9177 if test yes = "$GXX"; then
9178 _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
9179 else
9180 _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
9181 fi
9182
9183 if test yes = "$GXX"; then
9184 # Set up default GNU C++ configuration
9185
9186 LT_PATH_LD
9187
9188 # Check if GNU C++ uses GNU ld as the underlying linker, since the
9189 # archiving commands below assume that GNU ld is being used.
9190 if test yes = "$with_gnu_ld"; then
9191 _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
9192 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
9193
9194 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
9195 _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
9196
9197 # If archive_cmds runs LD, not CC, wlarc should be empty
9198 # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
9199 # investigate it a little bit more. (MM)
9200 wlarc='$wl'
9201
9202 # ancient GNU ld didn't support --whole-archive et. al.
9203 if eval "`$CC -print-prog-name=ld` --help 2>&1" |
9204 $GREP 'no-whole-archive' > /dev/null; then
9205 _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
9206 else
9207 _LT_TAGVAR(whole_archive_flag_spec, $1)=
9208 fi
9209 else
9210 with_gnu_ld=no
9211 wlarc=
9212
9213 # A generic and very simple default shared library creation
9214 # command for GNU C++ for the case where it uses the native
9215 # linker, instead of GNU ld. If possible, this setting should
9216 # overridden to take advantage of the native linker features on
9217 # the platform it is being used on.
9218 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
9219 fi
9220
9221 # Commands to make compiler produce verbose output that lists
9222 # what "hidden" libraries, object files and flags are used when
9223 # linking a shared library.
9224 output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
9225
9226 else
9227 GXX=no
9228 with_gnu_ld=no
9229 wlarc=
9230 fi
9231
9232 # PORTME: fill in a description of your system's C++ link characteristics
9233 AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
9234 _LT_TAGVAR(ld_shlibs, $1)=yes
9235 case $host_os in
9236 aix3*)
9237 # FIXME: insert proper C++ library support
9238 _LT_TAGVAR(ld_shlibs, $1)=no
9239 ;;
9240 aix[[4-9]]*)
9241 if test ia64 = "$host_cpu"; then
9242 # On IA64, the linker does run time linking by default, so we don't
9243 # have to do anything special.
9244 aix_use_runtimelinking=no
9245 exp_sym_flag='-Bexport'
9246 no_entry_flag=
9247 else
9248 aix_use_runtimelinking=no
9249
9250 # Test if we are trying to use run time linking or normal
9251 # AIX style linking. If -brtl is somewhere in LDFLAGS, we
9252 # have runtime linking enabled, and use it for executables.
9253 # For shared libraries, we enable/disable runtime linking
9254 # depending on the kind of the shared library created -
9255 # when "with_aix_soname,aix_use_runtimelinking" is:
9256 # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables
9257 # "aix,yes" lib.so shared, rtl:yes, for executables
9258 # lib.a static archive
9259 # "both,no" lib.so.V(shr.o) shared, rtl:yes
9260 # lib.a(lib.so.V) shared, rtl:no, for executables
9261 # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables
9262 # lib.a(lib.so.V) shared, rtl:no
9263 # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables
9264 # lib.a static archive
9265 case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
9266 for ld_flag in $LDFLAGS; do
9267 case $ld_flag in
9268 *-brtl*)
9269 aix_use_runtimelinking=yes
9270 break
9271 ;;
9272 esac
9273 done
9274 if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then
9275 # With aix-soname=svr4, we create the lib.so.V shared archives only,
9276 # so we don't have lib.a shared libs to link our executables.
9277 # We have to force runtime linking in this case.
9278 aix_use_runtimelinking=yes
9279 LDFLAGS="$LDFLAGS -Wl,-brtl"
9280 fi
9281 ;;
9282 esac
9283
9284 exp_sym_flag='-bexport'
9285 no_entry_flag='-bnoentry'
9286 fi
9287
9288 # When large executables or shared objects are built, AIX ld can
9289 # have problems creating the table of contents. If linking a library
9290 # or program results in "error TOC overflow" add -mminimal-toc to
9291 # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
9292 # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
9293
9294 _LT_TAGVAR(archive_cmds, $1)=''
9295 _LT_TAGVAR(hardcode_direct, $1)=yes
9296 _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
9297 _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
9298 _LT_TAGVAR(link_all_deplibs, $1)=yes
9299 _LT_TAGVAR(file_list_spec, $1)='$wl-f,'
9300 case $with_aix_soname,$aix_use_runtimelinking in
9301 aix,*) ;; # no import file
9302 svr4,* | *,yes) # use import file
9303 # The Import File defines what to hardcode.
9304 _LT_TAGVAR(hardcode_direct, $1)=no
9305 _LT_TAGVAR(hardcode_direct_absolute, $1)=no
9306 ;;
9307 esac
9308
9309 if test yes = "$GXX"; then
9310 case $host_os in aix4.[[012]]|aix4.[[012]].*)
9311 # We only want to do this on AIX 4.2 and lower, the check
9312 # below for broken collect2 doesn't work under 4.3+
9313 collect2name=`$CC -print-prog-name=collect2`
9314 if test -f "$collect2name" &&
9315 strings "$collect2name" | $GREP resolve_lib_name >/dev/null
9316 then
9317 # We have reworked collect2
9318 :
9319 else
9320 # We have old collect2
9321 _LT_TAGVAR(hardcode_direct, $1)=unsupported
9322 # It fails to find uninstalled libraries when the uninstalled
9323 # path is not listed in the libpath. Setting hardcode_minus_L
9324 # to unsupported forces relinking
9325 _LT_TAGVAR(hardcode_minus_L, $1)=yes
9326 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
9327 _LT_TAGVAR(hardcode_libdir_separator, $1)=
9328 fi
9329 esac
9330 shared_flag='-shared'
9331 if test yes = "$aix_use_runtimelinking"; then
9332 shared_flag=$shared_flag' $wl-G'
9333 fi
9334 # Need to ensure runtime linking is disabled for the traditional
9335 # shared library, or the linker may eventually find shared libraries
9336 # /with/ Import File - we do not want to mix them.
9337 shared_flag_aix='-shared'
9338 shared_flag_svr4='-shared $wl-G'
9339 else
9340 # not using gcc
9341 if test ia64 = "$host_cpu"; then
9342 # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
9343 # chokes on -Wl,-G. The following line is correct:
9344 shared_flag='-G'
9345 else
9346 if test yes = "$aix_use_runtimelinking"; then
9347 shared_flag='$wl-G'
9348 else
9349 shared_flag='$wl-bM:SRE'
9350 fi
9351 shared_flag_aix='$wl-bM:SRE'
9352 shared_flag_svr4='$wl-G'
9353 fi
9354 fi
9355
9356 _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall'
9357 # It seems that -bexpall does not export symbols beginning with
9358 # underscore (_), so it is better to generate a list of symbols to
9359 # export.
9360 _LT_TAGVAR(always_export_symbols, $1)=yes
9361 if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then
9362 # Warning - without using the other runtime loading flags (-brtl),
9363 # -berok will link without error, but may produce a broken library.
9364 # The "-G" linker flag allows undefined symbols.
9365 _LT_TAGVAR(no_undefined_flag, $1)='-bernotok'
9366 # Determine the default libpath from the value encoded in an empty
9367 # executable.
9368 _LT_SYS_MODULE_PATH_AIX([$1])
9369 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
9370
9371 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag
9372 else
9373 if test ia64 = "$host_cpu"; then
9374 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib'
9375 _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
9376 _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols"
9377 else
9378 # Determine the default libpath from the value encoded in an
9379 # empty executable.
9380 _LT_SYS_MODULE_PATH_AIX([$1])
9381 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
9382 # Warning - without using the other run time loading flags,
9383 # -berok will link without error, but may produce a broken library.
9384 _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok'
9385 _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok'
9386 if test yes = "$with_gnu_ld"; then
9387 # We only use this code for GNU lds that support --whole-archive.
9388 _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
9389 else
9390 # Exported symbols can be pulled into shared objects from archives
9391 _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
9392 fi
9393 _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
9394 _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d'
9395 # -brtl affects multiple linker settings, -berok does not and is overridden later
9396 compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`'
9397 if test svr4 != "$with_aix_soname"; then
9398 # This is similar to how AIX traditionally builds its shared
9399 # libraries. Need -bnortl late, we may have -brtl in LDFLAGS.
9400 _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname'
9401 fi
9402 if test aix != "$with_aix_soname"; then
9403 _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp'
9404 else
9405 # used by -dlpreopen to get the symbols
9406 _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV $output_objdir/$realname.d/$soname $output_objdir'
9407 fi
9408 _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d'
9409 fi
9410 fi
9411 ;;
9412
9413 beos*)
9414 if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
9415 _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
9416 # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
9417 # support --undefined. This deserves some investigation. FIXME
9418 _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
9419 else
9420 _LT_TAGVAR(ld_shlibs, $1)=no
9421 fi
9422 ;;
9423
9424 chorus*)
9425 case $cc_basename in
9426 *)
9427 # FIXME: insert proper C++ library support
9428 _LT_TAGVAR(ld_shlibs, $1)=no
9429 ;;
9430 esac
9431 ;;
9432
9433 cygwin* | mingw* | pw32* | cegcc*)
9434 case $GXX,$cc_basename in
9435 ,cl* | no,cl*)
9436 # Native MSVC
9437 # hardcode_libdir_flag_spec is actually meaningless, as there is
9438 # no search path for DLLs.
9439 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
9440 _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
9441 _LT_TAGVAR(always_export_symbols, $1)=yes
9442 _LT_TAGVAR(file_list_spec, $1)='@'
9443 # Tell ltmain to make .lib files, not .a files.
9444 libext=lib
9445 # Tell ltmain to make .dll files, not .so files.
9446 shrext_cmds=.dll
9447 # FIXME: Setting linknames here is a bad hack.
9448 _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames='
9449 _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
9450 cp "$export_symbols" "$output_objdir/$soname.def";
9451 echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp";
9452 else
9453 $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp;
9454 fi~
9455 $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
9456 linknames='
9457 # The linker will not automatically build a static lib if we build a DLL.
9458 # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
9459 _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
9460 # Don't use ranlib
9461 _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
9462 _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
9463 lt_tool_outputfile="@TOOL_OUTPUT@"~
9464 case $lt_outputfile in
9465 *.exe|*.EXE) ;;
9466 *)
9467 lt_outputfile=$lt_outputfile.exe
9468 lt_tool_outputfile=$lt_tool_outputfile.exe
9469 ;;
9470 esac~
9471 func_to_tool_file "$lt_outputfile"~
9472 if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then
9473 $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
9474 $RM "$lt_outputfile.manifest";
9475 fi'
9476 ;;
9477 *)
9478 # g++
9479 # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
9480 # as there is no search path for DLLs.
9481 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
9482 _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols'
9483 _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
9484 _LT_TAGVAR(always_export_symbols, $1)=no
9485 _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
9486
9487 if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
9488 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
9489 # If the export-symbols file already is a .def file, use it as
9490 # is; otherwise, prepend EXPORTS...
9491 _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
9492 cp $export_symbols $output_objdir/$soname.def;
9493 else
9494 echo EXPORTS > $output_objdir/$soname.def;
9495 cat $export_symbols >> $output_objdir/$soname.def;
9496 fi~
9497 $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
9498 else
9499 _LT_TAGVAR(ld_shlibs, $1)=no
9500 fi
9501 ;;
9502 esac
9503 ;;
9504 darwin* | rhapsody*)
9505 _LT_DARWIN_LINKER_FEATURES($1)
9506 ;;
9507
9508 os2*)
9509 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
9510 _LT_TAGVAR(hardcode_minus_L, $1)=yes
9511 _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
9512 shrext_cmds=.dll
9513 _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
9514 $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
9515 $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
9516 $ECHO EXPORTS >> $output_objdir/$libname.def~
9517 emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
9518 $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
9519 emximp -o $lib $output_objdir/$libname.def'
9520 _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
9521 $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
9522 $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
9523 $ECHO EXPORTS >> $output_objdir/$libname.def~
9524 prefix_cmds="$SED"~
9525 if test EXPORTS = "`$SED 1q $export_symbols`"; then
9526 prefix_cmds="$prefix_cmds -e 1d";
9527 fi~
9528 prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
9529 cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
9530 $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
9531 emximp -o $lib $output_objdir/$libname.def'
9532 _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
9533 _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
9534 ;;
9535
9536 dgux*)
9537 case $cc_basename in
9538 ec++*)
9539 # FIXME: insert proper C++ library support
9540 _LT_TAGVAR(ld_shlibs, $1)=no
9541 ;;
9542 ghcx*)
9543 # Green Hills C++ Compiler
9544 # FIXME: insert proper C++ library support
9545 _LT_TAGVAR(ld_shlibs, $1)=no
9546 ;;
9547 *)
9548 # FIXME: insert proper C++ library support
9549 _LT_TAGVAR(ld_shlibs, $1)=no
9550 ;;
9551 esac
9552 ;;
9553
9554 freebsd2.*)
9555 # C++ shared libraries reported to be fairly broken before
9556 # switch to ELF
9557 _LT_TAGVAR(ld_shlibs, $1)=no
9558 ;;
9559
9560 freebsd-elf*)
9561 _LT_TAGVAR(archive_cmds_need_lc, $1)=no
9562 ;;
9563
9564 freebsd* | dragonfly*)
9565 # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
9566 # conventions
9567 _LT_TAGVAR(ld_shlibs, $1)=yes
9568 ;;
9569
9570 haiku*)
9571 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
9572 _LT_TAGVAR(link_all_deplibs, $1)=yes
9573 ;;
9574
9575 hpux9*)
9576 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
9577 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
9578 _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
9579 _LT_TAGVAR(hardcode_direct, $1)=yes
9580 _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
9581 # but as the default
9582 # location of the library.
9583
9584 case $cc_basename in
9585 CC*)
9586 # FIXME: insert proper C++ library support
9587 _LT_TAGVAR(ld_shlibs, $1)=no
9588 ;;
9589 aCC*)
9590 _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
9591 # Commands to make compiler produce verbose output that lists
9592 # what "hidden" libraries, object files and flags are used when
9593 # linking a shared library.
9594 #
9595 # There doesn't appear to be a way to prevent this compiler from
9596 # explicitly linking system object files so we need to strip them
9597 # from the output so that they don't get included in the library
9598 # dependencies.
9599 output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
9600 ;;
9601 *)
9602 if test yes = "$GXX"; then
9603 _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
9604 else
9605 # FIXME: insert proper C++ library support
9606 _LT_TAGVAR(ld_shlibs, $1)=no
9607 fi
9608 ;;
9609 esac
9610 ;;
9611
9612 hpux10*|hpux11*)
9613 if test no = "$with_gnu_ld"; then
9614 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
9615 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
9616
9617 case $host_cpu in
9618 hppa*64*|ia64*)
9619 ;;
9620 *)
9621 _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
9622 ;;
9623 esac
9624 fi
9625 case $host_cpu in
9626 hppa*64*|ia64*)
9627 _LT_TAGVAR(hardcode_direct, $1)=no
9628 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
9629 ;;
9630 *)
9631 _LT_TAGVAR(hardcode_direct, $1)=yes
9632 _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
9633 _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
9634 # but as the default
9635 # location of the library.
9636 ;;
9637 esac
9638
9639 case $cc_basename in
9640 CC*)
9641 # FIXME: insert proper C++ library support
9642 _LT_TAGVAR(ld_shlibs, $1)=no
9643 ;;
9644 aCC*)
9645 case $host_cpu in
9646 hppa*64*)
9647 _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
9648 ;;
9649 ia64*)
9650 _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
9651 ;;
9652 *)
9653 _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
9654 ;;
9655 esac
9656 # Commands to make compiler produce verbose output that lists
9657 # what "hidden" libraries, object files and flags are used when
9658 # linking a shared library.
9659 #
9660 # There doesn't appear to be a way to prevent this compiler from
9661 # explicitly linking system object files so we need to strip them
9662 # from the output so that they don't get included in the library
9663 # dependencies.
9664 output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
9665 ;;
9666 *)
9667 if test yes = "$GXX"; then
9668 if test no = "$with_gnu_ld"; then
9669 case $host_cpu in
9670 hppa*64*)
9671 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
9672 ;;
9673 ia64*)
9674 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
9675 ;;
9676 *)
9677 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
9678 ;;
9679 esac
9680 fi
9681 else
9682 # FIXME: insert proper C++ library support
9683 _LT_TAGVAR(ld_shlibs, $1)=no
9684 fi
9685 ;;
9686 esac
9687 ;;
9688
9689 interix[[3-9]]*)
9690 _LT_TAGVAR(hardcode_direct, $1)=no
9691 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
9692 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
9693 _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
9694 # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
9695 # Instead, shared libraries are loaded at an image base (0x10000000 by
9696 # default) and relocated if they conflict, which is a slow very memory
9697 # consuming and fragmenting process. To avoid this, we pick a random,
9698 # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
9699 # time. Moving up from 0x10000000 also allows more sbrk(2) space.
9700 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
9701 _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
9702 ;;
9703 irix5* | irix6*)
9704 case $cc_basename in
9705 CC*)
9706 # SGI C++
9707 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
9708
9709 # Archives containing C++ object files must be created using
9710 # "CC -ar", where "CC" is the IRIX C++ compiler. This is
9711 # necessary to make sure instantiated templates are included
9712 # in the archive.
9713 _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
9714 ;;
9715 *)
9716 if test yes = "$GXX"; then
9717 if test no = "$with_gnu_ld"; then
9718 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
9719 else
9720 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` -o $lib'
9721 fi
9722 fi
9723 _LT_TAGVAR(link_all_deplibs, $1)=yes
9724 ;;
9725 esac
9726 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
9727 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
9728 _LT_TAGVAR(inherit_rpath, $1)=yes
9729 ;;
9730
9731 linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
9732 case $cc_basename in
9733 KCC*)
9734 # Kuck and Associates, Inc. (KAI) C++ Compiler
9735
9736 # KCC will only create a shared library if the output file
9737 # ends with ".so" (or ".sl" for HP-UX), so rename the library
9738 # to its proper name (with version) after linking.
9739 _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
9740 _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib $wl-retain-symbols-file,$export_symbols; mv \$templib $lib'
9741 # Commands to make compiler produce verbose output that lists
9742 # what "hidden" libraries, object files and flags are used when
9743 # linking a shared library.
9744 #
9745 # There doesn't appear to be a way to prevent this compiler from
9746 # explicitly linking system object files so we need to strip them
9747 # from the output so that they don't get included in the library
9748 # dependencies.
9749 output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
9750
9751 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
9752 _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
9753
9754 # Archives containing C++ object files must be created using
9755 # "CC -Bstatic", where "CC" is the KAI C++ compiler.
9756 _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
9757 ;;
9758 icpc* | ecpc* )
9759 # Intel C++
9760 with_gnu_ld=yes
9761 # version 8.0 and above of icpc choke on multiply defined symbols
9762 # if we add $predep_objects and $postdep_objects, however 7.1 and
9763 # earlier do not add the objects themselves.
9764 case `$CC -V 2>&1` in
9765 *"Version 7."*)
9766 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
9767 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
9768 ;;
9769 *) # Version 8.0 or newer
9770 tmp_idyn=
9771 case $host_cpu in
9772 ia64*) tmp_idyn=' -i_dynamic';;
9773 esac
9774 _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
9775 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
9776 ;;
9777 esac
9778 _LT_TAGVAR(archive_cmds_need_lc, $1)=no
9779 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
9780 _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
9781 _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
9782 ;;
9783 pgCC* | pgcpp*)
9784 # Portland Group C++ compiler
9785 case `$CC -V` in
9786 *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*)
9787 _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
9788 rm -rf $tpldir~
9789 $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
9790 compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
9791 _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
9792 rm -rf $tpldir~
9793 $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
9794 $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
9795 $RANLIB $oldlib'
9796 _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
9797 rm -rf $tpldir~
9798 $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
9799 $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
9800 _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
9801 rm -rf $tpldir~
9802 $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
9803 $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
9804 ;;
9805 *) # Version 6 and above use weak symbols
9806 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
9807 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
9808 ;;
9809 esac
9810
9811 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl--rpath $wl$libdir'
9812 _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
9813 _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
9814 ;;
9815 cxx*)
9816 # Compaq C++
9817 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
9818 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib $wl-retain-symbols-file $wl$export_symbols'
9819
9820 runpath_var=LD_RUN_PATH
9821 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
9822 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
9823
9824 # Commands to make compiler produce verbose output that lists
9825 # what "hidden" libraries, object files and flags are used when
9826 # linking a shared library.
9827 #
9828 # There doesn't appear to be a way to prevent this compiler from
9829 # explicitly linking system object files so we need to strip them
9830 # from the output so that they don't get included in the library
9831 # dependencies.
9832 output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed'
9833 ;;
9834 xl* | mpixl* | bgxl*)
9835 # IBM XL 8.0 on PPC, with GNU ld
9836 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
9837 _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
9838 _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
9839 if test yes = "$supports_anon_versioning"; then
9840 _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
9841 cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
9842 echo "local: *; };" >> $output_objdir/$libname.ver~
9843 $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
9844 fi
9845 ;;
9846 *)
9847 case `$CC -V 2>&1 | sed 5q` in
9848 *Sun\ C*)
9849 # Sun C++ 5.9
9850 _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
9851 _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
9852 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file $wl$export_symbols'
9853 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
9854 _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
9855 _LT_TAGVAR(compiler_needs_object, $1)=yes
9856
9857 # Not sure whether something based on
9858 # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
9859 # would be better.
9860 output_verbose_link_cmd='func_echo_all'
9861
9862 # Archives containing C++ object files must be created using
9863 # "CC -xar", where "CC" is the Sun C++ compiler. This is
9864 # necessary to make sure instantiated templates are included
9865 # in the archive.
9866 _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
9867 ;;
9868 esac
9869 ;;
9870 esac
9871 ;;
9872
9873 lynxos*)
9874 # FIXME: insert proper C++ library support
9875 _LT_TAGVAR(ld_shlibs, $1)=no
9876 ;;
9877
9878 m88k*)
9879 # FIXME: insert proper C++ library support
9880 _LT_TAGVAR(ld_shlibs, $1)=no
9881 ;;
9882
9883 mvs*)
9884 case $cc_basename in
9885 cxx*)
9886 # FIXME: insert proper C++ library support
9887 _LT_TAGVAR(ld_shlibs, $1)=no
9888 ;;
9889 *)
9890 # FIXME: insert proper C++ library support
9891 _LT_TAGVAR(ld_shlibs, $1)=no
9892 ;;
9893 esac
9894 ;;
9895
9896 netbsd*)
9897 if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
9898 _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
9899 wlarc=
9900 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
9901 _LT_TAGVAR(hardcode_direct, $1)=yes
9902 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
9903 fi
9904 # Workaround some broken pre-1.5 toolchains
9905 output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
9906 ;;
9907
9908 *nto* | *qnx*)
9909 _LT_TAGVAR(ld_shlibs, $1)=yes
9910 ;;
9911
9912 openbsd* | bitrig*)
9913 if test -f /usr/libexec/ld.so; then
9914 _LT_TAGVAR(hardcode_direct, $1)=yes
9915 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
9916 _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
9917 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
9918 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
9919 if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`"; then
9920 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file,$export_symbols -o $lib'
9921 _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
9922 _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
9923 fi
9924 output_verbose_link_cmd=func_echo_all
9925 else
9926 _LT_TAGVAR(ld_shlibs, $1)=no
9927 fi
9928 ;;
9929
9930 osf3* | osf4* | osf5*)
9931 case $cc_basename in
9932 KCC*)
9933 # Kuck and Associates, Inc. (KAI) C++ Compiler
9934
9935 # KCC will only create a shared library if the output file
9936 # ends with ".so" (or ".sl" for HP-UX), so rename the library
9937 # to its proper name (with version) after linking.
9938 _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
9939
9940 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
9941 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
9942
9943 # Archives containing C++ object files must be created using
9944 # the KAI C++ compiler.
9945 case $host in
9946 osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
9947 *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
9948 esac
9949 ;;
9950 RCC*)
9951 # Rational C++ 2.4.1
9952 # FIXME: insert proper C++ library support
9953 _LT_TAGVAR(ld_shlibs, $1)=no
9954 ;;
9955 cxx*)
9956 case $host in
9957 osf3*)
9958 _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
9959 _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $soname `test -n "$verstring" && func_echo_all "$wl-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
9960 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
9961 ;;
9962 *)
9963 _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
9964 _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
9965 _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
9966 echo "-hidden">> $lib.exp~
9967 $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname $wl-input $wl$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~
9968 $RM $lib.exp'
9969 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
9970 ;;
9971 esac
9972
9973 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
9974
9975 # Commands to make compiler produce verbose output that lists
9976 # what "hidden" libraries, object files and flags are used when
9977 # linking a shared library.
9978 #
9979 # There doesn't appear to be a way to prevent this compiler from
9980 # explicitly linking system object files so we need to strip them
9981 # from the output so that they don't get included in the library
9982 # dependencies.
9983 output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
9984 ;;
9985 *)
9986 if test yes,no = "$GXX,$with_gnu_ld"; then
9987 _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
9988 case $host in
9989 osf3*)
9990 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
9991 ;;
9992 *)
9993 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
9994 ;;
9995 esac
9996
9997 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
9998 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
9999
10000 # Commands to make compiler produce verbose output that lists
10001 # what "hidden" libraries, object files and flags are used when
10002 # linking a shared library.
10003 output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
10004
10005 else
10006 # FIXME: insert proper C++ library support
10007 _LT_TAGVAR(ld_shlibs, $1)=no
10008 fi
10009 ;;
10010 esac
10011 ;;
10012
10013 psos*)
10014 # FIXME: insert proper C++ library support
10015 _LT_TAGVAR(ld_shlibs, $1)=no
10016 ;;
10017
10018 sunos4*)
10019 case $cc_basename in
10020 CC*)
10021 # Sun C++ 4.x
10022 # FIXME: insert proper C++ library support
10023 _LT_TAGVAR(ld_shlibs, $1)=no
10024 ;;
10025 lcc*)
10026 # Lucid
10027 # FIXME: insert proper C++ library support
10028 _LT_TAGVAR(ld_shlibs, $1)=no
10029 ;;
10030 *)
10031 # FIXME: insert proper C++ library support
10032 _LT_TAGVAR(ld_shlibs, $1)=no
10033 ;;
10034 esac
10035 ;;
10036
10037 solaris*)
10038 case $cc_basename in
10039 CC* | sunCC*)
10040 # Sun C++ 4.2, 5.x and Centerline C++
10041 _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
10042 _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
10043 _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
10044 _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
10045 $CC -G$allow_undefined_flag $wl-M $wl$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
10046
10047 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
10048 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
10049 case $host_os in
10050 solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
10051 *)
10052 # The compiler driver will combine and reorder linker options,
10053 # but understands '-z linker_flag'.
10054 # Supported since Solaris 2.6 (maybe 2.5.1?)
10055 _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
10056 ;;
10057 esac
10058 _LT_TAGVAR(link_all_deplibs, $1)=yes
10059
10060 output_verbose_link_cmd='func_echo_all'
10061
10062 # Archives containing C++ object files must be created using
10063 # "CC -xar", where "CC" is the Sun C++ compiler. This is
10064 # necessary to make sure instantiated templates are included
10065 # in the archive.
10066 _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
10067 ;;
10068 gcx*)
10069 # Green Hills C++ Compiler
10070 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
10071
10072 # The C++ compiler must be used to create the archive.
10073 _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
10074 ;;
10075 *)
10076 # GNU C++ compiler with Solaris linker
10077 if test yes,no = "$GXX,$with_gnu_ld"; then
10078 _LT_TAGVAR(no_undefined_flag, $1)=' $wl-z ${wl}defs'
10079 if $CC --version | $GREP -v '^2\.7' > /dev/null; then
10080 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
10081 _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
10082 $CC -shared $pic_flag -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
10083
10084 # Commands to make compiler produce verbose output that lists
10085 # what "hidden" libraries, object files and flags are used when
10086 # linking a shared library.
10087 output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
10088 else
10089 # g++ 2.7 appears to require '-G' NOT '-shared' on this
10090 # platform.
10091 _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
10092 _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
10093 $CC -G -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
10094
10095 # Commands to make compiler produce verbose output that lists
10096 # what "hidden" libraries, object files and flags are used when
10097 # linking a shared library.
10098 output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
10099 fi
10100
10101 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $wl$libdir'
10102 case $host_os in
10103 solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
10104 *)
10105 _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract'
10106 ;;
10107 esac
10108 fi
10109 ;;
10110 esac
10111 ;;
10112
10113 sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
10114 _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
10115 _LT_TAGVAR(archive_cmds_need_lc, $1)=no
10116 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
10117 runpath_var='LD_RUN_PATH'
10118
10119 case $cc_basename in
10120 CC*)
10121 _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
10122 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
10123 ;;
10124 *)
10125 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
10126 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
10127 ;;
10128 esac
10129 ;;
10130
10131 sysv5* | sco3.2v5* | sco5v6*)
10132 # Note: We CANNOT use -z defs as we might desire, because we do not
10133 # link with -lc, and that would cause any symbols used from libc to
10134 # always be unresolved, which means just about no library would
10135 # ever link correctly. If we're not using GNU ld we use -z text
10136 # though, which does catch some bad symbols but isn't as heavy-handed
10137 # as -z defs.
10138 _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
10139 _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs'
10140 _LT_TAGVAR(archive_cmds_need_lc, $1)=no
10141 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
10142 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir'
10143 _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
10144 _LT_TAGVAR(link_all_deplibs, $1)=yes
10145 _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport'
10146 runpath_var='LD_RUN_PATH'
10147
10148 case $cc_basename in
10149 CC*)
10150 _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
10151 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
10152 _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~
10153 '"$_LT_TAGVAR(old_archive_cmds, $1)"
10154 _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~
10155 '"$_LT_TAGVAR(reload_cmds, $1)"
10156 ;;
10157 *)
10158 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
10159 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
10160 ;;
10161 esac
10162 ;;
10163
10164 tandem*)
10165 case $cc_basename in
10166 NCC*)
10167 # NonStop-UX NCC 3.20
10168 # FIXME: insert proper C++ library support
10169 _LT_TAGVAR(ld_shlibs, $1)=no
10170 ;;
10171 *)
10172 # FIXME: insert proper C++ library support
10173 _LT_TAGVAR(ld_shlibs, $1)=no
10174 ;;
10175 esac
10176 ;;
10177
10178 vxworks*)
10179 # FIXME: insert proper C++ library support
10180 _LT_TAGVAR(ld_shlibs, $1)=no
10181 ;;
10182
10183 *)
10184 # FIXME: insert proper C++ library support
10185 _LT_TAGVAR(ld_shlibs, $1)=no
10186 ;;
10187 esac
10188
10189 AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
10190 test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no
10191
10192 _LT_TAGVAR(GCC, $1)=$GXX
10193 _LT_TAGVAR(LD, $1)=$LD
10194
10195 ## CAVEAT EMPTOR:
10196 ## There is no encapsulation within the following macros, do not change
10197 ## the running order or otherwise move them around unless you know exactly
10198 ## what you are doing...
10199 _LT_SYS_HIDDEN_LIBDEPS($1)
10200 _LT_COMPILER_PIC($1)
10201 _LT_COMPILER_C_O($1)
10202 _LT_COMPILER_FILE_LOCKS($1)
10203 _LT_LINKER_SHLIBS($1)
10204 _LT_SYS_DYNAMIC_LINKER($1)
10205 _LT_LINKER_HARDCODE_LIBPATH($1)
10206
10207 _LT_CONFIG($1)
10208 fi # test -n "$compiler"
10209
10210 CC=$lt_save_CC
10211 CFLAGS=$lt_save_CFLAGS
10212 LDCXX=$LD
10213 LD=$lt_save_LD
10214 GCC=$lt_save_GCC
10215 with_gnu_ld=$lt_save_with_gnu_ld
10216 lt_cv_path_LDCXX=$lt_cv_path_LD
10217 lt_cv_path_LD=$lt_save_path_LD
10218 lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
10219 lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
10220 fi # test yes != "$_lt_caught_CXX_error"
10221
10222 AC_LANG_POP
10223 ])# _LT_LANG_CXX_CONFIG
10224
10225
10226 # _LT_FUNC_STRIPNAME_CNF
10227 # ----------------------
10228 # func_stripname_cnf prefix suffix name
10229 # strip PREFIX and SUFFIX off of NAME.
10230 # PREFIX and SUFFIX must not contain globbing or regex special
10231 # characters, hashes, percent signs, but SUFFIX may contain a leading
10232 # dot (in which case that matches only a dot).
10233 #
10234 # This function is identical to the (non-XSI) version of func_stripname,
10235 # except this one can be used by m4 code that may be executed by configure,
10236 # rather than the libtool script.
10237 m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl
10238 AC_REQUIRE([_LT_DECL_SED])
10239 AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])
10240 func_stripname_cnf ()
10241 {
10242 case @S|@2 in
10243 .*) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%\\\\@S|@2\$%%"`;;
10244 *) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%@S|@2\$%%"`;;
10245 esac
10246 } # func_stripname_cnf
10247 ])# _LT_FUNC_STRIPNAME_CNF
10248
10249
10250 # _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
10251 # ---------------------------------
10252 # Figure out "hidden" library dependencies from verbose
10253 # compiler output when linking a shared library.
10254 # Parse the compiler output and extract the necessary
10255 # objects, libraries and library flags.
10256 m4_defun([_LT_SYS_HIDDEN_LIBDEPS],
10257 [m4_require([_LT_FILEUTILS_DEFAULTS])dnl
10258 AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl
10259 # Dependencies to place before and after the object being linked:
10260 _LT_TAGVAR(predep_objects, $1)=
10261 _LT_TAGVAR(postdep_objects, $1)=
10262 _LT_TAGVAR(predeps, $1)=
10263 _LT_TAGVAR(postdeps, $1)=
10264 _LT_TAGVAR(compiler_lib_search_path, $1)=
10265
10266 dnl we can't use the lt_simple_compile_test_code here,
10267 dnl because it contains code intended for an executable,
10268 dnl not a library. It's possible we should let each
10269 dnl tag define a new lt_????_link_test_code variable,
10270 dnl but it's only used here...
10271 m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
10272 int a;
10273 void foo (void) { a = 0; }
10274 _LT_EOF
10275 ], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
10276 class Foo
10277 {
10278 public:
10279 Foo (void) { a = 0; }
10280 private:
10281 int a;
10282 };
10283 _LT_EOF
10284 ], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
10285 subroutine foo
10286 implicit none
10287 integer*4 a
10288 a=0
10289 return
10290 end
10291 _LT_EOF
10292 ], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
10293 subroutine foo
10294 implicit none
10295 integer a
10296 a=0
10297 return
10298 end
10299 _LT_EOF
10300 ], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
10301 public class foo {
10302 private int a;
10303 public void bar (void) {
10304 a = 0;
10305 }
10306 };
10307 _LT_EOF
10308 ], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF
10309 package foo
10310 func foo() {
10311 }
10312 _LT_EOF
10313 ])
10314
10315 _lt_libdeps_save_CFLAGS=$CFLAGS
10316 case "$CC $CFLAGS " in #(
10317 *\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
10318 *\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
10319 *\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;;
10320 esac
10321
10322 dnl Parse the compiler output and extract the necessary
10323 dnl objects, libraries and library flags.
10324 if AC_TRY_EVAL(ac_compile); then
10325 # Parse the compiler output and extract the necessary
10326 # objects, libraries and library flags.
10327
10328 # Sentinel used to keep track of whether or not we are before
10329 # the conftest object file.
10330 pre_test_object_deps_done=no
10331
10332 for p in `eval "$output_verbose_link_cmd"`; do
10333 case $prev$p in
10334
10335 -L* | -R* | -l*)
10336 # Some compilers place space between "-{L,R}" and the path.
10337 # Remove the space.
10338 if test x-L = "$p" ||
10339 test x-R = "$p"; then
10340 prev=$p
10341 continue
10342 fi
10343
10344 # Expand the sysroot to ease extracting the directories later.
10345 if test -z "$prev"; then
10346 case $p in
10347 -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
10348 -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
10349 -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
10350 esac
10351 fi
10352 case $p in
10353 =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
10354 esac
10355 if test no = "$pre_test_object_deps_done"; then
10356 case $prev in
10357 -L | -R)
10358 # Internal compiler library paths should come after those
10359 # provided the user. The postdeps already come after the
10360 # user supplied libs so there is no need to process them.
10361 if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
10362 _LT_TAGVAR(compiler_lib_search_path, $1)=$prev$p
10363 else
10364 _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} $prev$p"
10365 fi
10366 ;;
10367 # The "-l" case would never come before the object being
10368 # linked, so don't bother handling this case.
10369 esac
10370 else
10371 if test -z "$_LT_TAGVAR(postdeps, $1)"; then
10372 _LT_TAGVAR(postdeps, $1)=$prev$p
10373 else
10374 _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} $prev$p"
10375 fi
10376 fi
10377 prev=
10378 ;;
10379
10380 *.lto.$objext) ;; # Ignore GCC LTO objects
10381 *.$objext)
10382 # This assumes that the test object file only shows up
10383 # once in the compiler output.
10384 if test "$p" = "conftest.$objext"; then
10385 pre_test_object_deps_done=yes
10386 continue
10387 fi
10388
10389 if test no = "$pre_test_object_deps_done"; then
10390 if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
10391 _LT_TAGVAR(predep_objects, $1)=$p
10392 else
10393 _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
10394 fi
10395 else
10396 if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
10397 _LT_TAGVAR(postdep_objects, $1)=$p
10398 else
10399 _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
10400 fi
10401 fi
10402 ;;
10403
10404 *) ;; # Ignore the rest.
10405
10406 esac
10407 done
10408
10409 # Clean up.
10410 rm -f a.out a.exe
10411 else
10412 echo "libtool.m4: error: problem compiling $1 test program"
10413 fi
10414
10415 $RM -f confest.$objext
10416 CFLAGS=$_lt_libdeps_save_CFLAGS
10417
10418 # PORTME: override above test on systems where it is broken
10419 m4_if([$1], [CXX],
10420 [case $host_os in
10421 interix[[3-9]]*)
10422 # Interix 3.5 installs completely hosed .la files for C++, so rather than
10423 # hack all around it, let's just trust "g++" to DTRT.
10424 _LT_TAGVAR(predep_objects,$1)=
10425 _LT_TAGVAR(postdep_objects,$1)=
10426 _LT_TAGVAR(postdeps,$1)=
10427 ;;
10428 esac
10429 ])
10430
10431 case " $_LT_TAGVAR(postdeps, $1) " in
10432 *" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
10433 esac
10434 _LT_TAGVAR(compiler_lib_search_dirs, $1)=
10435 if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
10436 _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | $SED -e 's! -L! !g' -e 's!^ !!'`
10437 fi
10438 _LT_TAGDECL([], [compiler_lib_search_dirs], [1],
10439 [The directories searched by this compiler when creating a shared library])
10440 _LT_TAGDECL([], [predep_objects], [1],
10441 [Dependencies to place before and after the objects being linked to
10442 create a shared library])
10443 _LT_TAGDECL([], [postdep_objects], [1])
10444 _LT_TAGDECL([], [predeps], [1])
10445 _LT_TAGDECL([], [postdeps], [1])
10446 _LT_TAGDECL([], [compiler_lib_search_path], [1],
10447 [The library search path used internally by the compiler when linking
10448 a shared library])
10449 ])# _LT_SYS_HIDDEN_LIBDEPS
10450
10451
10452 # _LT_LANG_F77_CONFIG([TAG])
10453 # --------------------------
10454 # Ensure that the configuration variables for a Fortran 77 compiler are
10455 # suitably defined. These variables are subsequently used by _LT_CONFIG
10456 # to write the compiler configuration to 'libtool'.
10457 m4_defun([_LT_LANG_F77_CONFIG],
10458 [AC_LANG_PUSH(Fortran 77)
10459 if test -z "$F77" || test no = "$F77"; then
10460 _lt_disable_F77=yes
10461 fi
10462
10463 _LT_TAGVAR(archive_cmds_need_lc, $1)=no
10464 _LT_TAGVAR(allow_undefined_flag, $1)=
10465 _LT_TAGVAR(always_export_symbols, $1)=no
10466 _LT_TAGVAR(archive_expsym_cmds, $1)=
10467 _LT_TAGVAR(export_dynamic_flag_spec, $1)=
10468 _LT_TAGVAR(hardcode_direct, $1)=no
10469 _LT_TAGVAR(hardcode_direct_absolute, $1)=no
10470 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
10471 _LT_TAGVAR(hardcode_libdir_separator, $1)=
10472 _LT_TAGVAR(hardcode_minus_L, $1)=no
10473 _LT_TAGVAR(hardcode_automatic, $1)=no
10474 _LT_TAGVAR(inherit_rpath, $1)=no
10475 _LT_TAGVAR(module_cmds, $1)=
10476 _LT_TAGVAR(module_expsym_cmds, $1)=
10477 _LT_TAGVAR(link_all_deplibs, $1)=unknown
10478 _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
10479 _LT_TAGVAR(reload_flag, $1)=$reload_flag
10480 _LT_TAGVAR(reload_cmds, $1)=$reload_cmds
10481 _LT_TAGVAR(no_undefined_flag, $1)=
10482 _LT_TAGVAR(whole_archive_flag_spec, $1)=
10483 _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
10484
10485 # Source file extension for f77 test sources.
10486 ac_ext=f
10487
10488 # Object file extension for compiled f77 test sources.
10489 objext=o
10490 _LT_TAGVAR(objext, $1)=$objext
10491
10492 # No sense in running all these tests if we already determined that
10493 # the F77 compiler isn't working. Some variables (like enable_shared)
10494 # are currently assumed to apply to all compilers on this platform,
10495 # and will be corrupted by setting them based on a non-working compiler.
10496 if test yes != "$_lt_disable_F77"; then
10497 # Code to be used in simple compile tests
10498 lt_simple_compile_test_code="\
10499 subroutine t
10500 return
10501 end
10502 "
10503
10504 # Code to be used in simple link tests
10505 lt_simple_link_test_code="\
10506 program t
10507 end
10508 "
10509
10510 # ltmain only uses $CC for tagged configurations so make sure $CC is set.
10511 _LT_TAG_COMPILER
10512
10513 # save warnings/boilerplate of simple test code
10514 _LT_COMPILER_BOILERPLATE
10515 _LT_LINKER_BOILERPLATE
10516
10517 # Allow CC to be a program name with arguments.
10518 lt_save_CC=$CC
10519 lt_save_GCC=$GCC
10520 lt_save_CFLAGS=$CFLAGS
10521 CC=${F77-"f77"}
10522 CFLAGS=$FFLAGS
10523 compiler=$CC
10524 _LT_TAGVAR(compiler, $1)=$CC
10525 _LT_CC_BASENAME([$compiler])
10526 GCC=$G77
10527 if test -n "$compiler"; then
10528 AC_MSG_CHECKING([if libtool supports shared libraries])
10529 AC_MSG_RESULT([$can_build_shared])
10530
10531 AC_MSG_CHECKING([whether to build shared libraries])
10532 test no = "$can_build_shared" && enable_shared=no
10533
10534 # On AIX, shared libraries and static libraries use the same namespace, and
10535 # are all built from PIC.
10536 case $host_os in
10537 aix3*)
10538 test yes = "$enable_shared" && enable_static=no
10539 if test -n "$RANLIB"; then
10540 archive_cmds="$archive_cmds~\$RANLIB \$lib"
10541 postinstall_cmds='$RANLIB $lib'
10542 fi
10543 ;;
10544 aix[[4-9]]*)
10545 if test ia64 != "$host_cpu"; then
10546 case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
10547 yes,aix,yes) ;; # shared object as lib.so file only
10548 yes,svr4,*) ;; # shared object as lib.so archive member only
10549 yes,*) enable_static=no ;; # shared object in lib.a archive as well
10550 esac
10551 fi
10552 ;;
10553 esac
10554 AC_MSG_RESULT([$enable_shared])
10555
10556 AC_MSG_CHECKING([whether to build static libraries])
10557 # Make sure either enable_shared or enable_static is yes.
10558 test yes = "$enable_shared" || enable_static=yes
10559 AC_MSG_RESULT([$enable_static])
10560
10561 _LT_TAGVAR(GCC, $1)=$G77
10562 _LT_TAGVAR(LD, $1)=$LD
10563
10564 ## CAVEAT EMPTOR:
10565 ## There is no encapsulation within the following macros, do not change
10566 ## the running order or otherwise move them around unless you know exactly
10567 ## what you are doing...
10568 _LT_COMPILER_PIC($1)
10569 _LT_COMPILER_C_O($1)
10570 _LT_COMPILER_FILE_LOCKS($1)
10571 _LT_LINKER_SHLIBS($1)
10572 _LT_SYS_DYNAMIC_LINKER($1)
10573 _LT_LINKER_HARDCODE_LIBPATH($1)
10574
10575 _LT_CONFIG($1)
10576 fi # test -n "$compiler"
10577
10578 GCC=$lt_save_GCC
10579 CC=$lt_save_CC
10580 CFLAGS=$lt_save_CFLAGS
10581 fi # test yes != "$_lt_disable_F77"
10582
10583 AC_LANG_POP
10584 ])# _LT_LANG_F77_CONFIG
10585
10586
10587 # _LT_LANG_FC_CONFIG([TAG])
10588 # -------------------------
10589 # Ensure that the configuration variables for a Fortran compiler are
10590 # suitably defined. These variables are subsequently used by _LT_CONFIG
10591 # to write the compiler configuration to 'libtool'.
10592 m4_defun([_LT_LANG_FC_CONFIG],
10593 [AC_LANG_PUSH(Fortran)
10594
10595 if test -z "$FC" || test no = "$FC"; then
10596 _lt_disable_FC=yes
10597 fi
10598
10599 _LT_TAGVAR(archive_cmds_need_lc, $1)=no
10600 _LT_TAGVAR(allow_undefined_flag, $1)=
10601 _LT_TAGVAR(always_export_symbols, $1)=no
10602 _LT_TAGVAR(archive_expsym_cmds, $1)=
10603 _LT_TAGVAR(export_dynamic_flag_spec, $1)=
10604 _LT_TAGVAR(hardcode_direct, $1)=no
10605 _LT_TAGVAR(hardcode_direct_absolute, $1)=no
10606 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
10607 _LT_TAGVAR(hardcode_libdir_separator, $1)=
10608 _LT_TAGVAR(hardcode_minus_L, $1)=no
10609 _LT_TAGVAR(hardcode_automatic, $1)=no
10610 _LT_TAGVAR(inherit_rpath, $1)=no
10611 _LT_TAGVAR(module_cmds, $1)=
10612 _LT_TAGVAR(module_expsym_cmds, $1)=
10613 _LT_TAGVAR(link_all_deplibs, $1)=unknown
10614 _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
10615 _LT_TAGVAR(reload_flag, $1)=$reload_flag
10616 _LT_TAGVAR(reload_cmds, $1)=$reload_cmds
10617 _LT_TAGVAR(no_undefined_flag, $1)=
10618 _LT_TAGVAR(whole_archive_flag_spec, $1)=
10619 _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
10620
10621 # Source file extension for fc test sources.
10622 ac_ext=${ac_fc_srcext-f}
10623
10624 # Object file extension for compiled fc test sources.
10625 objext=o
10626 _LT_TAGVAR(objext, $1)=$objext
10627
10628 # No sense in running all these tests if we already determined that
10629 # the FC compiler isn't working. Some variables (like enable_shared)
10630 # are currently assumed to apply to all compilers on this platform,
10631 # and will be corrupted by setting them based on a non-working compiler.
10632 if test yes != "$_lt_disable_FC"; then
10633 # Code to be used in simple compile tests
10634 lt_simple_compile_test_code="\
10635 subroutine t
10636 return
10637 end
10638 "
10639
10640 # Code to be used in simple link tests
10641 lt_simple_link_test_code="\
10642 program t
10643 end
10644 "
10645
10646 # ltmain only uses $CC for tagged configurations so make sure $CC is set.
10647 _LT_TAG_COMPILER
10648
10649 # save warnings/boilerplate of simple test code
10650 _LT_COMPILER_BOILERPLATE
10651 _LT_LINKER_BOILERPLATE
10652
10653 # Allow CC to be a program name with arguments.
10654 lt_save_CC=$CC
10655 lt_save_GCC=$GCC
10656 lt_save_CFLAGS=$CFLAGS
10657 CC=${FC-"f95"}
10658 CFLAGS=$FCFLAGS
10659 compiler=$CC
10660 GCC=$ac_cv_fc_compiler_gnu
10661
10662 _LT_TAGVAR(compiler, $1)=$CC
10663 _LT_CC_BASENAME([$compiler])
10664
10665 if test -n "$compiler"; then
10666 AC_MSG_CHECKING([if libtool supports shared libraries])
10667 AC_MSG_RESULT([$can_build_shared])
10668
10669 AC_MSG_CHECKING([whether to build shared libraries])
10670 test no = "$can_build_shared" && enable_shared=no
10671
10672 # On AIX, shared libraries and static libraries use the same namespace, and
10673 # are all built from PIC.
10674 case $host_os in
10675 aix3*)
10676 test yes = "$enable_shared" && enable_static=no
10677 if test -n "$RANLIB"; then
10678 archive_cmds="$archive_cmds~\$RANLIB \$lib"
10679 postinstall_cmds='$RANLIB $lib'
10680 fi
10681 ;;
10682 aix[[4-9]]*)
10683 if test ia64 != "$host_cpu"; then
10684 case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
10685 yes,aix,yes) ;; # shared object as lib.so file only
10686 yes,svr4,*) ;; # shared object as lib.so archive member only
10687 yes,*) enable_static=no ;; # shared object in lib.a archive as well
10688 esac
10689 fi
10690 ;;
10691 esac
10692 AC_MSG_RESULT([$enable_shared])
10693
10694 AC_MSG_CHECKING([whether to build static libraries])
10695 # Make sure either enable_shared or enable_static is yes.
10696 test yes = "$enable_shared" || enable_static=yes
10697 AC_MSG_RESULT([$enable_static])
10698
10699 _LT_TAGVAR(GCC, $1)=$ac_cv_fc_compiler_gnu
10700 _LT_TAGVAR(LD, $1)=$LD
10701
10702 ## CAVEAT EMPTOR:
10703 ## There is no encapsulation within the following macros, do not change
10704 ## the running order or otherwise move them around unless you know exactly
10705 ## what you are doing...
10706 _LT_SYS_HIDDEN_LIBDEPS($1)
10707 _LT_COMPILER_PIC($1)
10708 _LT_COMPILER_C_O($1)
10709 _LT_COMPILER_FILE_LOCKS($1)
10710 _LT_LINKER_SHLIBS($1)
10711 _LT_SYS_DYNAMIC_LINKER($1)
10712 _LT_LINKER_HARDCODE_LIBPATH($1)
10713
10714 _LT_CONFIG($1)
10715 fi # test -n "$compiler"
10716
10717 GCC=$lt_save_GCC
10718 CC=$lt_save_CC
10719 CFLAGS=$lt_save_CFLAGS
10720 fi # test yes != "$_lt_disable_FC"
10721
10722 AC_LANG_POP
10723 ])# _LT_LANG_FC_CONFIG
10724
10725
10726 # _LT_LANG_GCJ_CONFIG([TAG])
10727 # --------------------------
10728 # Ensure that the configuration variables for the GNU Java Compiler compiler
10729 # are suitably defined. These variables are subsequently used by _LT_CONFIG
10730 # to write the compiler configuration to 'libtool'.
10731 m4_defun([_LT_LANG_GCJ_CONFIG],
10732 [AC_REQUIRE([LT_PROG_GCJ])dnl
10733 AC_LANG_SAVE
10734
10735 # Source file extension for Java test sources.
10736 ac_ext=java
10737
10738 # Object file extension for compiled Java test sources.
10739 objext=o
10740 _LT_TAGVAR(objext, $1)=$objext
10741
10742 # Code to be used in simple compile tests
10743 lt_simple_compile_test_code="class foo {}"
10744
10745 # Code to be used in simple link tests
10746 lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
10747
10748 # ltmain only uses $CC for tagged configurations so make sure $CC is set.
10749 _LT_TAG_COMPILER
10750
10751 # save warnings/boilerplate of simple test code
10752 _LT_COMPILER_BOILERPLATE
10753 _LT_LINKER_BOILERPLATE
10754
10755 # Allow CC to be a program name with arguments.
10756 lt_save_CC=$CC
10757 lt_save_CFLAGS=$CFLAGS
10758 lt_save_GCC=$GCC
10759 GCC=yes
10760 CC=${GCJ-"gcj"}
10761 CFLAGS=$GCJFLAGS
10762 compiler=$CC
10763 _LT_TAGVAR(compiler, $1)=$CC
10764 _LT_TAGVAR(LD, $1)=$LD
10765 _LT_CC_BASENAME([$compiler])
10766
10767 # GCJ did not exist at the time GCC didn't implicitly link libc in.
10768 _LT_TAGVAR(archive_cmds_need_lc, $1)=no
10769
10770 _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
10771 _LT_TAGVAR(reload_flag, $1)=$reload_flag
10772 _LT_TAGVAR(reload_cmds, $1)=$reload_cmds
10773
10774 if test -n "$compiler"; then
10775 _LT_COMPILER_NO_RTTI($1)
10776 _LT_COMPILER_PIC($1)
10777 _LT_COMPILER_C_O($1)
10778 _LT_COMPILER_FILE_LOCKS($1)
10779 _LT_LINKER_SHLIBS($1)
10780 _LT_LINKER_HARDCODE_LIBPATH($1)
10781
10782 _LT_CONFIG($1)
10783 fi
10784
10785 AC_LANG_RESTORE
10786
10787 GCC=$lt_save_GCC
10788 CC=$lt_save_CC
10789 CFLAGS=$lt_save_CFLAGS
10790 ])# _LT_LANG_GCJ_CONFIG
10791
10792
10793 # _LT_LANG_GO_CONFIG([TAG])
10794 # --------------------------
10795 # Ensure that the configuration variables for the GNU Go compiler
10796 # are suitably defined. These variables are subsequently used by _LT_CONFIG
10797 # to write the compiler configuration to 'libtool'.
10798 m4_defun([_LT_LANG_GO_CONFIG],
10799 [AC_REQUIRE([LT_PROG_GO])dnl
10800 AC_LANG_SAVE
10801
10802 # Source file extension for Go test sources.
10803 ac_ext=go
10804
10805 # Object file extension for compiled Go test sources.
10806 objext=o
10807 _LT_TAGVAR(objext, $1)=$objext
10808
10809 # Code to be used in simple compile tests
10810 lt_simple_compile_test_code="package main; func main() { }"
10811
10812 # Code to be used in simple link tests
10813 lt_simple_link_test_code='package main; func main() { }'
10814
10815 # ltmain only uses $CC for tagged configurations so make sure $CC is set.
10816 _LT_TAG_COMPILER
10817
10818 # save warnings/boilerplate of simple test code
10819 _LT_COMPILER_BOILERPLATE
10820 _LT_LINKER_BOILERPLATE
10821
10822 # Allow CC to be a program name with arguments.
10823 lt_save_CC=$CC
10824 lt_save_CFLAGS=$CFLAGS
10825 lt_save_GCC=$GCC
10826 GCC=yes
10827 CC=${GOC-"gccgo"}
10828 CFLAGS=$GOFLAGS
10829 compiler=$CC
10830 _LT_TAGVAR(compiler, $1)=$CC
10831 _LT_TAGVAR(LD, $1)=$LD
10832 _LT_CC_BASENAME([$compiler])
10833
10834 # Go did not exist at the time GCC didn't implicitly link libc in.
10835 _LT_TAGVAR(archive_cmds_need_lc, $1)=no
10836
10837 _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
10838 _LT_TAGVAR(reload_flag, $1)=$reload_flag
10839 _LT_TAGVAR(reload_cmds, $1)=$reload_cmds
10840
10841 if test -n "$compiler"; then
10842 _LT_COMPILER_NO_RTTI($1)
10843 _LT_COMPILER_PIC($1)
10844 _LT_COMPILER_C_O($1)
10845 _LT_COMPILER_FILE_LOCKS($1)
10846 _LT_LINKER_SHLIBS($1)
10847 _LT_LINKER_HARDCODE_LIBPATH($1)
10848
10849 _LT_CONFIG($1)
10850 fi
10851
10852 AC_LANG_RESTORE
10853
10854 GCC=$lt_save_GCC
10855 CC=$lt_save_CC
10856 CFLAGS=$lt_save_CFLAGS
10857 ])# _LT_LANG_GO_CONFIG
10858
10859
10860 # _LT_LANG_RC_CONFIG([TAG])
10861 # -------------------------
10862 # Ensure that the configuration variables for the Windows resource compiler
10863 # are suitably defined. These variables are subsequently used by _LT_CONFIG
10864 # to write the compiler configuration to 'libtool'.
10865 m4_defun([_LT_LANG_RC_CONFIG],
10866 [AC_REQUIRE([LT_PROG_RC])dnl
10867 AC_LANG_SAVE
10868
10869 # Source file extension for RC test sources.
10870 ac_ext=rc
10871
10872 # Object file extension for compiled RC test sources.
10873 objext=o
10874 _LT_TAGVAR(objext, $1)=$objext
10875
10876 # Code to be used in simple compile tests
10877 lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
10878
10879 # Code to be used in simple link tests
10880 lt_simple_link_test_code=$lt_simple_compile_test_code
10881
10882 # ltmain only uses $CC for tagged configurations so make sure $CC is set.
10883 _LT_TAG_COMPILER
10884
10885 # save warnings/boilerplate of simple test code
10886 _LT_COMPILER_BOILERPLATE
10887 _LT_LINKER_BOILERPLATE
10888
10889 # Allow CC to be a program name with arguments.
10890 lt_save_CC=$CC
10891 lt_save_CFLAGS=$CFLAGS
10892 lt_save_GCC=$GCC
10893 GCC=
10894 CC=${RC-"windres"}
10895 CFLAGS=
10896 compiler=$CC
10897 _LT_TAGVAR(compiler, $1)=$CC
10898 _LT_CC_BASENAME([$compiler])
10899 _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
10900
10901 if test -n "$compiler"; then
10902 :
10903 _LT_CONFIG($1)
10904 fi
10905
10906 GCC=$lt_save_GCC
10907 AC_LANG_RESTORE
10908 CC=$lt_save_CC
10909 CFLAGS=$lt_save_CFLAGS
10910 ])# _LT_LANG_RC_CONFIG
10911
10912
10913 # LT_PROG_GCJ
10914 # -----------
10915 AC_DEFUN([LT_PROG_GCJ],
10916 [m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
10917 [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
10918 [AC_CHECK_TOOL(GCJ, gcj,)
10919 test set = "${GCJFLAGS+set}" || GCJFLAGS="-g -O2"
10920 AC_SUBST(GCJFLAGS)])])[]dnl
10921 ])
10922
10923 # Old name:
10924 AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
10925 dnl aclocal-1.4 backwards compatibility:
10926 dnl AC_DEFUN([LT_AC_PROG_GCJ], [])
10927
10928
10929 # LT_PROG_GO
10930 # ----------
10931 AC_DEFUN([LT_PROG_GO],
10932 [AC_CHECK_TOOL(GOC, gccgo,)
10933 ])
10934
10935
10936 # LT_PROG_RC
10937 # ----------
10938 AC_DEFUN([LT_PROG_RC],
10939 [AC_CHECK_TOOL(RC, windres,)
10940 ])
10941
10942 # Old name:
10943 AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
10944 dnl aclocal-1.4 backwards compatibility:
10945 dnl AC_DEFUN([LT_AC_PROG_RC], [])
10946
10947
10948 # _LT_DECL_EGREP
10949 # --------------
10950 # If we don't have a new enough Autoconf to choose the best grep
10951 # available, choose the one first in the user's PATH.
10952 m4_defun([_LT_DECL_EGREP],
10953 [AC_REQUIRE([AC_PROG_EGREP])dnl
10954 AC_REQUIRE([AC_PROG_FGREP])dnl
10955 test -z "$GREP" && GREP=grep
10956 _LT_DECL([], [GREP], [1], [A grep program that handles long lines])
10957 _LT_DECL([], [EGREP], [1], [An ERE matcher])
10958 _LT_DECL([], [FGREP], [1], [A literal string matcher])
10959 dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
10960 AC_SUBST([GREP])
10961 ])
10962
10963
10964 # _LT_DECL_OBJDUMP
10965 # --------------
10966 # If we don't have a new enough Autoconf to choose the best objdump
10967 # available, choose the one first in the user's PATH.
10968 m4_defun([_LT_DECL_OBJDUMP],
10969 [AC_CHECK_TOOL(OBJDUMP, objdump, false)
10970 test -z "$OBJDUMP" && OBJDUMP=objdump
10971 _LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
10972 AC_SUBST([OBJDUMP])
10973 ])
10974
10975 # _LT_DECL_DLLTOOL
10976 # ----------------
10977 # Ensure DLLTOOL variable is set.
10978 m4_defun([_LT_DECL_DLLTOOL],
10979 [AC_CHECK_TOOL(DLLTOOL, dlltool, false)
10980 test -z "$DLLTOOL" && DLLTOOL=dlltool
10981 _LT_DECL([], [DLLTOOL], [1], [DLL creation program])
10982 AC_SUBST([DLLTOOL])
10983 ])
10984
10985 # _LT_DECL_SED
10986 # ------------
10987 # Check for a fully-functional sed program, that truncates
10988 # as few characters as possible. Prefer GNU sed if found.
10989 m4_defun([_LT_DECL_SED],
10990 [AC_PROG_SED
10991 test -z "$SED" && SED=sed
10992 Xsed="$SED -e 1s/^X//"
10993 _LT_DECL([], [SED], [1], [A sed program that does not truncate output])
10994 _LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
10995 [Sed that helps us avoid accidentally triggering echo(1) options like -n])
10996 ])# _LT_DECL_SED
10997
10998 m4_ifndef([AC_PROG_SED], [
10999 # NOTE: This macro has been submitted for inclusion into #
11000 # GNU Autoconf as AC_PROG_SED. When it is available in #
11001 # a released version of Autoconf we should remove this #
11002 # macro and use it instead. #
11003
11004 m4_defun([AC_PROG_SED],
11005 [AC_MSG_CHECKING([for a sed that does not truncate output])
11006 AC_CACHE_VAL(lt_cv_path_SED,
11007 [# Loop through the user's path and test for sed and gsed.
11008 # Then use that list of sed's as ones to test for truncation.
11009 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
11010 for as_dir in $PATH
11011 do
11012 IFS=$as_save_IFS
11013 test -z "$as_dir" && as_dir=.
11014 for lt_ac_prog in sed gsed; do
11015 for ac_exec_ext in '' $ac_executable_extensions; do
11016 if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
11017 lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
11018 fi
11019 done
11020 done
11021 done
11022 IFS=$as_save_IFS
11023 lt_ac_max=0
11024 lt_ac_count=0
11025 # Add /usr/xpg4/bin/sed as it is typically found on Solaris
11026 # along with /bin/sed that truncates output.
11027 for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
11028 test ! -f "$lt_ac_sed" && continue
11029 cat /dev/null > conftest.in
11030 lt_ac_count=0
11031 echo $ECHO_N "0123456789$ECHO_C" >conftest.in
11032 # Check for GNU sed and select it if it is found.
11033 if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
11034 lt_cv_path_SED=$lt_ac_sed
11035 break
11036 fi
11037 while true; do
11038 cat conftest.in conftest.in >conftest.tmp
11039 mv conftest.tmp conftest.in
11040 cp conftest.in conftest.nl
11041 echo >>conftest.nl
11042 $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
11043 cmp -s conftest.out conftest.nl || break
11044 # 10000 chars as input seems more than enough
11045 test 10 -lt "$lt_ac_count" && break
11046 lt_ac_count=`expr $lt_ac_count + 1`
11047 if test "$lt_ac_count" -gt "$lt_ac_max"; then
11048 lt_ac_max=$lt_ac_count
11049 lt_cv_path_SED=$lt_ac_sed
11050 fi
11051 done
11052 done
11053 ])
11054 SED=$lt_cv_path_SED
11055 AC_SUBST([SED])
11056 AC_MSG_RESULT([$SED])
11057 ])#AC_PROG_SED
11058 ])#m4_ifndef
11059
11060 # Old name:
11061 AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
11062 dnl aclocal-1.4 backwards compatibility:
11063 dnl AC_DEFUN([LT_AC_PROG_SED], [])
11064
11065
11066 # _LT_CHECK_SHELL_FEATURES
11067 # ------------------------
11068 # Find out whether the shell is Bourne or XSI compatible,
11069 # or has some other useful features.
11070 m4_defun([_LT_CHECK_SHELL_FEATURES],
11071 [if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
11072 lt_unset=unset
11073 else
11074 lt_unset=false
11075 fi
11076 _LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
11077
11078 # test EBCDIC or ASCII
11079 case `echo X|tr X '\101'` in
11080 A) # ASCII based system
11081 # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
11082 lt_SP2NL='tr \040 \012'
11083 lt_NL2SP='tr \015\012 \040\040'
11084 ;;
11085 *) # EBCDIC based system
11086 lt_SP2NL='tr \100 \n'
11087 lt_NL2SP='tr \r\n \100\100'
11088 ;;
11089 esac
11090 _LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
11091 _LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
11092 ])# _LT_CHECK_SHELL_FEATURES
11093
11094
11095 # _LT_PATH_CONVERSION_FUNCTIONS
11096 # -----------------------------
11097 # Determine what file name conversion functions should be used by
11098 # func_to_host_file (and, implicitly, by func_to_host_path). These are needed
11099 # for certain cross-compile configurations and native mingw.
11100 m4_defun([_LT_PATH_CONVERSION_FUNCTIONS],
11101 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
11102 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
11103 AC_MSG_CHECKING([how to convert $build file names to $host format])
11104 AC_CACHE_VAL(lt_cv_to_host_file_cmd,
11105 [case $host in
11106 *-*-mingw* )
11107 case $build in
11108 *-*-mingw* ) # actually msys
11109 lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
11110 ;;
11111 *-*-cygwin* )
11112 lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
11113 ;;
11114 * ) # otherwise, assume *nix
11115 lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
11116 ;;
11117 esac
11118 ;;
11119 *-*-cygwin* )
11120 case $build in
11121 *-*-mingw* ) # actually msys
11122 lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
11123 ;;
11124 *-*-cygwin* )
11125 lt_cv_to_host_file_cmd=func_convert_file_noop
11126 ;;
11127 * ) # otherwise, assume *nix
11128 lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
11129 ;;
11130 esac
11131 ;;
11132 * ) # unhandled hosts (and "normal" native builds)
11133 lt_cv_to_host_file_cmd=func_convert_file_noop
11134 ;;
11135 esac
11136 ])
11137 to_host_file_cmd=$lt_cv_to_host_file_cmd
11138 AC_MSG_RESULT([$lt_cv_to_host_file_cmd])
11139 _LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd],
11140 [0], [convert $build file names to $host format])dnl
11141
11142 AC_MSG_CHECKING([how to convert $build file names to toolchain format])
11143 AC_CACHE_VAL(lt_cv_to_tool_file_cmd,
11144 [#assume ordinary cross tools, or native build.
11145 lt_cv_to_tool_file_cmd=func_convert_file_noop
11146 case $host in
11147 *-*-mingw* )
11148 case $build in
11149 *-*-mingw* ) # actually msys
11150 lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
11151 ;;
11152 esac
11153 ;;
11154 esac
11155 ])
11156 to_tool_file_cmd=$lt_cv_to_tool_file_cmd
11157 AC_MSG_RESULT([$lt_cv_to_tool_file_cmd])
11158 _LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd],
11159 [0], [convert $build files to toolchain format])dnl
11160 ])# _LT_PATH_CONVERSION_FUNCTIONS
11161
11162 # Helper functions for option handling. -*- Autoconf -*-
11163 #
11164 # Copyright (C) 2004-2005, 2007-2009, 2011-2015 Free Software
11165 # Foundation, Inc.
11166 # Written by Gary V. Vaughan, 2004
11167 #
11168 # This file is free software; the Free Software Foundation gives
11169 # unlimited permission to copy and/or distribute it, with or without
11170 # modifications, as long as this notice is preserved.
11171
11172 # serial 8 ltoptions.m4
11173
11174 # This is to help aclocal find these macros, as it can't see m4_define.
11175 AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
11176
11177
11178 # _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
11179 # ------------------------------------------
11180 m4_define([_LT_MANGLE_OPTION],
11181 [[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
11182
11183
11184 # _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
11185 # ---------------------------------------
11186 # Set option OPTION-NAME for macro MACRO-NAME, and if there is a
11187 # matching handler defined, dispatch to it. Other OPTION-NAMEs are
11188 # saved as a flag.
11189 m4_define([_LT_SET_OPTION],
11190 [m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
11191 m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
11192 _LT_MANGLE_DEFUN([$1], [$2]),
11193 [m4_warning([Unknown $1 option '$2'])])[]dnl
11194 ])
11195
11196
11197 # _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
11198 # ------------------------------------------------------------
11199 # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
11200 m4_define([_LT_IF_OPTION],
11201 [m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
11202
11203
11204 # _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
11205 # -------------------------------------------------------
11206 # Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
11207 # are set.
11208 m4_define([_LT_UNLESS_OPTIONS],
11209 [m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
11210 [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
11211 [m4_define([$0_found])])])[]dnl
11212 m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
11213 ])[]dnl
11214 ])
11215
11216
11217 # _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
11218 # ----------------------------------------
11219 # OPTION-LIST is a space-separated list of Libtool options associated
11220 # with MACRO-NAME. If any OPTION has a matching handler declared with
11221 # LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
11222 # the unknown option and exit.
11223 m4_defun([_LT_SET_OPTIONS],
11224 [# Set options
11225 m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
11226 [_LT_SET_OPTION([$1], _LT_Option)])
11227
11228 m4_if([$1],[LT_INIT],[
11229 dnl
11230 dnl Simply set some default values (i.e off) if boolean options were not
11231 dnl specified:
11232 _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
11233 ])
11234 _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
11235 ])
11236 dnl
11237 dnl If no reference was made to various pairs of opposing options, then
11238 dnl we run the default mode handler for the pair. For example, if neither
11239 dnl 'shared' nor 'disable-shared' was passed, we enable building of shared
11240 dnl archives by default:
11241 _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
11242 _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
11243 _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
11244 _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
11245 [_LT_ENABLE_FAST_INSTALL])
11246 _LT_UNLESS_OPTIONS([LT_INIT], [aix-soname=aix aix-soname=both aix-soname=svr4],
11247 [_LT_WITH_AIX_SONAME([aix])])
11248 ])
11249 ])# _LT_SET_OPTIONS
11250
11251
11252
11253 # _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
11254 # -----------------------------------------
11255 m4_define([_LT_MANGLE_DEFUN],
11256 [[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
11257
11258
11259 # LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
11260 # -----------------------------------------------
11261 m4_define([LT_OPTION_DEFINE],
11262 [m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
11263 ])# LT_OPTION_DEFINE
11264
11265
11266 # dlopen
11267 # ------
11268 LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
11269 ])
11270
11271 AU_DEFUN([AC_LIBTOOL_DLOPEN],
11272 [_LT_SET_OPTION([LT_INIT], [dlopen])
11273 AC_DIAGNOSE([obsolete],
11274 [$0: Remove this warning and the call to _LT_SET_OPTION when you
11275 put the 'dlopen' option into LT_INIT's first parameter.])
11276 ])
11277
11278 dnl aclocal-1.4 backwards compatibility:
11279 dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
11280
11281
11282 # win32-dll
11283 # ---------
11284 # Declare package support for building win32 dll's.
11285 LT_OPTION_DEFINE([LT_INIT], [win32-dll],
11286 [enable_win32_dll=yes
11287
11288 case $host in
11289 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
11290 AC_CHECK_TOOL(AS, as, false)
11291 AC_CHECK_TOOL(DLLTOOL, dlltool, false)
11292 AC_CHECK_TOOL(OBJDUMP, objdump, false)
11293 ;;
11294 esac
11295
11296 test -z "$AS" && AS=as
11297 _LT_DECL([], [AS], [1], [Assembler program])dnl
11298
11299 test -z "$DLLTOOL" && DLLTOOL=dlltool
11300 _LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl
11301
11302 test -z "$OBJDUMP" && OBJDUMP=objdump
11303 _LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl
11304 ])# win32-dll
11305
11306 AU_DEFUN([AC_LIBTOOL_WIN32_DLL],
11307 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
11308 _LT_SET_OPTION([LT_INIT], [win32-dll])
11309 AC_DIAGNOSE([obsolete],
11310 [$0: Remove this warning and the call to _LT_SET_OPTION when you
11311 put the 'win32-dll' option into LT_INIT's first parameter.])
11312 ])
11313
11314 dnl aclocal-1.4 backwards compatibility:
11315 dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
11316
11317
11318 # _LT_ENABLE_SHARED([DEFAULT])
11319 # ----------------------------
11320 # implement the --enable-shared flag, and supports the 'shared' and
11321 # 'disable-shared' LT_INIT options.
11322 # DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'.
11323 m4_define([_LT_ENABLE_SHARED],
11324 [m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
11325 AC_ARG_ENABLE([shared],
11326 [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
11327 [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
11328 [p=${PACKAGE-default}
11329 case $enableval in
11330 yes) enable_shared=yes ;;
11331 no) enable_shared=no ;;
11332 *)
11333 enable_shared=no
11334 # Look at the argument we got. We use all the common list separators.
11335 lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
11336 for pkg in $enableval; do
11337 IFS=$lt_save_ifs
11338 if test "X$pkg" = "X$p"; then
11339 enable_shared=yes
11340 fi
11341 done
11342 IFS=$lt_save_ifs
11343 ;;
11344 esac],
11345 [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
11346
11347 _LT_DECL([build_libtool_libs], [enable_shared], [0],
11348 [Whether or not to build shared libraries])
11349 ])# _LT_ENABLE_SHARED
11350
11351 LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
11352 LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
11353
11354 # Old names:
11355 AC_DEFUN([AC_ENABLE_SHARED],
11356 [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
11357 ])
11358
11359 AC_DEFUN([AC_DISABLE_SHARED],
11360 [_LT_SET_OPTION([LT_INIT], [disable-shared])
11361 ])
11362
11363 AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
11364 AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
11365
11366 dnl aclocal-1.4 backwards compatibility:
11367 dnl AC_DEFUN([AM_ENABLE_SHARED], [])
11368 dnl AC_DEFUN([AM_DISABLE_SHARED], [])
11369
11370
11371
11372 # _LT_ENABLE_STATIC([DEFAULT])
11373 # ----------------------------
11374 # implement the --enable-static flag, and support the 'static' and
11375 # 'disable-static' LT_INIT options.
11376 # DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'.
11377 m4_define([_LT_ENABLE_STATIC],
11378 [m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
11379 AC_ARG_ENABLE([static],
11380 [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
11381 [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
11382 [p=${PACKAGE-default}
11383 case $enableval in
11384 yes) enable_static=yes ;;
11385 no) enable_static=no ;;
11386 *)
11387 enable_static=no
11388 # Look at the argument we got. We use all the common list separators.
11389 lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
11390 for pkg in $enableval; do
11391 IFS=$lt_save_ifs
11392 if test "X$pkg" = "X$p"; then
11393 enable_static=yes
11394 fi
11395 done
11396 IFS=$lt_save_ifs
11397 ;;
11398 esac],
11399 [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
11400
11401 _LT_DECL([build_old_libs], [enable_static], [0],
11402 [Whether or not to build static libraries])
11403 ])# _LT_ENABLE_STATIC
11404
11405 LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
11406 LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
11407
11408 # Old names:
11409 AC_DEFUN([AC_ENABLE_STATIC],
11410 [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
11411 ])
11412
11413 AC_DEFUN([AC_DISABLE_STATIC],
11414 [_LT_SET_OPTION([LT_INIT], [disable-static])
11415 ])
11416
11417 AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
11418 AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
11419
11420 dnl aclocal-1.4 backwards compatibility:
11421 dnl AC_DEFUN([AM_ENABLE_STATIC], [])
11422 dnl AC_DEFUN([AM_DISABLE_STATIC], [])
11423
11424
11425
11426 # _LT_ENABLE_FAST_INSTALL([DEFAULT])
11427 # ----------------------------------
11428 # implement the --enable-fast-install flag, and support the 'fast-install'
11429 # and 'disable-fast-install' LT_INIT options.
11430 # DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'.
11431 m4_define([_LT_ENABLE_FAST_INSTALL],
11432 [m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
11433 AC_ARG_ENABLE([fast-install],
11434 [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
11435 [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
11436 [p=${PACKAGE-default}
11437 case $enableval in
11438 yes) enable_fast_install=yes ;;
11439 no) enable_fast_install=no ;;
11440 *)
11441 enable_fast_install=no
11442 # Look at the argument we got. We use all the common list separators.
11443 lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
11444 for pkg in $enableval; do
11445 IFS=$lt_save_ifs
11446 if test "X$pkg" = "X$p"; then
11447 enable_fast_install=yes
11448 fi
11449 done
11450 IFS=$lt_save_ifs
11451 ;;
11452 esac],
11453 [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
11454
11455 _LT_DECL([fast_install], [enable_fast_install], [0],
11456 [Whether or not to optimize for fast installation])dnl
11457 ])# _LT_ENABLE_FAST_INSTALL
11458
11459 LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
11460 LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
11461
11462 # Old names:
11463 AU_DEFUN([AC_ENABLE_FAST_INSTALL],
11464 [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
11465 AC_DIAGNOSE([obsolete],
11466 [$0: Remove this warning and the call to _LT_SET_OPTION when you put
11467 the 'fast-install' option into LT_INIT's first parameter.])
11468 ])
11469
11470 AU_DEFUN([AC_DISABLE_FAST_INSTALL],
11471 [_LT_SET_OPTION([LT_INIT], [disable-fast-install])
11472 AC_DIAGNOSE([obsolete],
11473 [$0: Remove this warning and the call to _LT_SET_OPTION when you put
11474 the 'disable-fast-install' option into LT_INIT's first parameter.])
11475 ])
11476
11477 dnl aclocal-1.4 backwards compatibility:
11478 dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
11479 dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
11480
11481
11482 # _LT_WITH_AIX_SONAME([DEFAULT])
11483 # ----------------------------------
11484 # implement the --with-aix-soname flag, and support the `aix-soname=aix'
11485 # and `aix-soname=both' and `aix-soname=svr4' LT_INIT options. DEFAULT
11486 # is either `aix', `both' or `svr4'. If omitted, it defaults to `aix'.
11487 m4_define([_LT_WITH_AIX_SONAME],
11488 [m4_define([_LT_WITH_AIX_SONAME_DEFAULT], [m4_if($1, svr4, svr4, m4_if($1, both, both, aix))])dnl
11489 shared_archive_member_spec=
11490 case $host,$enable_shared in
11491 power*-*-aix[[5-9]]*,yes)
11492 AC_MSG_CHECKING([which variant of shared library versioning to provide])
11493 AC_ARG_WITH([aix-soname],
11494 [AS_HELP_STRING([--with-aix-soname=aix|svr4|both],
11495 [shared library versioning (aka "SONAME") variant to provide on AIX, @<:@default=]_LT_WITH_AIX_SONAME_DEFAULT[@:>@.])],
11496 [case $withval in
11497 aix|svr4|both)
11498 ;;
11499 *)
11500 AC_MSG_ERROR([Unknown argument to --with-aix-soname])
11501 ;;
11502 esac
11503 lt_cv_with_aix_soname=$with_aix_soname],
11504 [AC_CACHE_VAL([lt_cv_with_aix_soname],
11505 [lt_cv_with_aix_soname=]_LT_WITH_AIX_SONAME_DEFAULT)
11506 with_aix_soname=$lt_cv_with_aix_soname])
11507 AC_MSG_RESULT([$with_aix_soname])
11508 if test aix != "$with_aix_soname"; then
11509 # For the AIX way of multilib, we name the shared archive member
11510 # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o',
11511 # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File.
11512 # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag,
11513 # the AIX toolchain works better with OBJECT_MODE set (default 32).
11514 if test 64 = "${OBJECT_MODE-32}"; then
11515 shared_archive_member_spec=shr_64
11516 else
11517 shared_archive_member_spec=shr
11518 fi
11519 fi
11520 ;;
11521 *)
11522 with_aix_soname=aix
11523 ;;
11524 esac
11525
11526 _LT_DECL([], [shared_archive_member_spec], [0],
11527 [Shared archive member basename, for filename based shared library versioning on AIX])dnl
11528 ])# _LT_WITH_AIX_SONAME
11529
11530 LT_OPTION_DEFINE([LT_INIT], [aix-soname=aix], [_LT_WITH_AIX_SONAME([aix])])
11531 LT_OPTION_DEFINE([LT_INIT], [aix-soname=both], [_LT_WITH_AIX_SONAME([both])])
11532 LT_OPTION_DEFINE([LT_INIT], [aix-soname=svr4], [_LT_WITH_AIX_SONAME([svr4])])
11533
11534
11535 # _LT_WITH_PIC([MODE])
11536 # --------------------
11537 # implement the --with-pic flag, and support the 'pic-only' and 'no-pic'
11538 # LT_INIT options.
11539 # MODE is either 'yes' or 'no'. If omitted, it defaults to 'both'.
11540 m4_define([_LT_WITH_PIC],
11541 [AC_ARG_WITH([pic],
11542 [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@],
11543 [try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
11544 [lt_p=${PACKAGE-default}
11545 case $withval in
11546 yes|no) pic_mode=$withval ;;
11547 *)
11548 pic_mode=default
11549 # Look at the argument we got. We use all the common list separators.
11550 lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
11551 for lt_pkg in $withval; do
11552 IFS=$lt_save_ifs
11553 if test "X$lt_pkg" = "X$lt_p"; then
11554 pic_mode=yes
11555 fi
11556 done
11557 IFS=$lt_save_ifs
11558 ;;
11559 esac],
11560 [pic_mode=m4_default([$1], [default])])
11561
11562 _LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
11563 ])# _LT_WITH_PIC
11564
11565 LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
11566 LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
11567
11568 # Old name:
11569 AU_DEFUN([AC_LIBTOOL_PICMODE],
11570 [_LT_SET_OPTION([LT_INIT], [pic-only])
11571 AC_DIAGNOSE([obsolete],
11572 [$0: Remove this warning and the call to _LT_SET_OPTION when you
11573 put the 'pic-only' option into LT_INIT's first parameter.])
11574 ])
11575
11576 dnl aclocal-1.4 backwards compatibility:
11577 dnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
11578
11579
11580 m4_define([_LTDL_MODE], [])
11581 LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
11582 [m4_define([_LTDL_MODE], [nonrecursive])])
11583 LT_OPTION_DEFINE([LTDL_INIT], [recursive],
11584 [m4_define([_LTDL_MODE], [recursive])])
11585 LT_OPTION_DEFINE([LTDL_INIT], [subproject],
11586 [m4_define([_LTDL_MODE], [subproject])])
11587
11588 m4_define([_LTDL_TYPE], [])
11589 LT_OPTION_DEFINE([LTDL_INIT], [installable],
11590 [m4_define([_LTDL_TYPE], [installable])])
11591 LT_OPTION_DEFINE([LTDL_INIT], [convenience],
11592 [m4_define([_LTDL_TYPE], [convenience])])
11593
11594 # ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*-
11595 #
11596 # Copyright (C) 2004-2005, 2007-2008, 2011-2015 Free Software
11597 # Foundation, Inc.
11598 # Written by Gary V. Vaughan, 2004
11599 #
11600 # This file is free software; the Free Software Foundation gives
11601 # unlimited permission to copy and/or distribute it, with or without
11602 # modifications, as long as this notice is preserved.
11603
11604 # serial 6 ltsugar.m4
11605
11606 # This is to help aclocal find these macros, as it can't see m4_define.
11607 AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
11608
11609
11610 # lt_join(SEP, ARG1, [ARG2...])
11611 # -----------------------------
11612 # Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
11613 # associated separator.
11614 # Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
11615 # versions in m4sugar had bugs.
11616 m4_define([lt_join],
11617 [m4_if([$#], [1], [],
11618 [$#], [2], [[$2]],
11619 [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
11620 m4_define([_lt_join],
11621 [m4_if([$#$2], [2], [],
11622 [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
11623
11624
11625 # lt_car(LIST)
11626 # lt_cdr(LIST)
11627 # ------------
11628 # Manipulate m4 lists.
11629 # These macros are necessary as long as will still need to support
11630 # Autoconf-2.59, which quotes differently.
11631 m4_define([lt_car], [[$1]])
11632 m4_define([lt_cdr],
11633 [m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
11634 [$#], 1, [],
11635 [m4_dquote(m4_shift($@))])])
11636 m4_define([lt_unquote], $1)
11637
11638
11639 # lt_append(MACRO-NAME, STRING, [SEPARATOR])
11640 # ------------------------------------------
11641 # Redefine MACRO-NAME to hold its former content plus 'SEPARATOR''STRING'.
11642 # Note that neither SEPARATOR nor STRING are expanded; they are appended
11643 # to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
11644 # No SEPARATOR is output if MACRO-NAME was previously undefined (different
11645 # than defined and empty).
11646 #
11647 # This macro is needed until we can rely on Autoconf 2.62, since earlier
11648 # versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
11649 m4_define([lt_append],
11650 [m4_define([$1],
11651 m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
11652
11653
11654
11655 # lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
11656 # ----------------------------------------------------------
11657 # Produce a SEP delimited list of all paired combinations of elements of
11658 # PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list
11659 # has the form PREFIXmINFIXSUFFIXn.
11660 # Needed until we can rely on m4_combine added in Autoconf 2.62.
11661 m4_define([lt_combine],
11662 [m4_if(m4_eval([$# > 3]), [1],
11663 [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
11664 [[m4_foreach([_Lt_prefix], [$2],
11665 [m4_foreach([_Lt_suffix],
11666 ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
11667 [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
11668
11669
11670 # lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
11671 # -----------------------------------------------------------------------
11672 # Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
11673 # by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
11674 m4_define([lt_if_append_uniq],
11675 [m4_ifdef([$1],
11676 [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
11677 [lt_append([$1], [$2], [$3])$4],
11678 [$5])],
11679 [lt_append([$1], [$2], [$3])$4])])
11680
11681
11682 # lt_dict_add(DICT, KEY, VALUE)
11683 # -----------------------------
11684 m4_define([lt_dict_add],
11685 [m4_define([$1($2)], [$3])])
11686
11687
11688 # lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
11689 # --------------------------------------------
11690 m4_define([lt_dict_add_subkey],
11691 [m4_define([$1($2:$3)], [$4])])
11692
11693
11694 # lt_dict_fetch(DICT, KEY, [SUBKEY])
11695 # ----------------------------------
11696 m4_define([lt_dict_fetch],
11697 [m4_ifval([$3],
11698 m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
11699 m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
11700
11701
11702 # lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
11703 # -----------------------------------------------------------------
11704 m4_define([lt_if_dict_fetch],
11705 [m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
11706 [$5],
11707 [$6])])
11708
11709
11710 # lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
11711 # --------------------------------------------------------------
11712 m4_define([lt_dict_filter],
11713 [m4_if([$5], [], [],
11714 [lt_join(m4_quote(m4_default([$4], [[, ]])),
11715 lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
11716 [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
11717 ])
11718
11719 # ltversion.m4 -- version numbers -*- Autoconf -*-
11720 #
11721 # Copyright (C) 2004, 2011-2015 Free Software Foundation, Inc.
11722 # Written by Scott James Remnant, 2004
11723 #
11724 # This file is free software; the Free Software Foundation gives
11725 # unlimited permission to copy and/or distribute it, with or without
11726 # modifications, as long as this notice is preserved.
11727
11728 # @configure_input@
11729
11730 # serial 4179 ltversion.m4
11731 # This file is part of GNU Libtool
11732
11733 m4_define([LT_PACKAGE_VERSION], [2.4.6])
11734 m4_define([LT_PACKAGE_REVISION], [2.4.6])
11735
11736 AC_DEFUN([LTVERSION_VERSION],
11737 [macro_version='2.4.6'
11738 macro_revision='2.4.6'
11739 _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
11740 _LT_DECL(, macro_revision, 0)
11741 ])
11742
11743 # lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*-
11744 #
11745 # Copyright (C) 2004-2005, 2007, 2009, 2011-2015 Free Software
11746 # Foundation, Inc.
11747 # Written by Scott James Remnant, 2004.
11748 #
11749 # This file is free software; the Free Software Foundation gives
11750 # unlimited permission to copy and/or distribute it, with or without
11751 # modifications, as long as this notice is preserved.
11752
11753 # serial 5 lt~obsolete.m4
11754
11755 # These exist entirely to fool aclocal when bootstrapping libtool.
11756 #
11757 # In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN),
11758 # which have later been changed to m4_define as they aren't part of the
11759 # exported API, or moved to Autoconf or Automake where they belong.
11760 #
11761 # The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN
11762 # in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
11763 # using a macro with the same name in our local m4/libtool.m4 it'll
11764 # pull the old libtool.m4 in (it doesn't see our shiny new m4_define
11765 # and doesn't know about Autoconf macros at all.)
11766 #
11767 # So we provide this file, which has a silly filename so it's always
11768 # included after everything else. This provides aclocal with the
11769 # AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
11770 # because those macros already exist, or will be overwritten later.
11771 # We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6.
11772 #
11773 # Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
11774 # Yes, that means every name once taken will need to remain here until
11775 # we give up compatibility with versions before 1.7, at which point
11776 # we need to keep only those names which we still refer to.
11777
11778 # This is to help aclocal find these macros, as it can't see m4_define.
11779 AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
11780
11781 m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
11782 m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])])
11783 m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
11784 m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])])
11785 m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
11786 m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])])
11787 m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])])
11788 m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
11789 m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])])
11790 m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])])
11791 m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])])
11792 m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
11793 m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
11794 m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
11795 m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
11796 m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])])
11797 m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])])
11798 m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
11799 m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
11800 m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])])
11801 m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])])
11802 m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
11803 m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
11804 m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
11805 m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
11806 m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
11807 m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
11808 m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
11809 m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])])
11810 m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])])
11811 m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])])
11812 m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
11813 m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])])
11814 m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])])
11815 m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])])
11816 m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])])
11817 m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
11818 m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])])
11819 m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
11820 m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])])
11821 m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])])
11822 m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])])
11823 m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
11824 m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
11825 m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
11826 m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
11827 m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
11828 m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
11829 m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
11830 m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
11831 m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
11832 m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
11833 m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])])
11834 m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
11835 m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])])
11836 m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])])
11837 m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])])
11838 m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])])
11839 m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])])
11840 m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])])
11841 m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])])
11842
1539 m4_include([m4/ax_check_compile_flag.m4])
1540 m4_include([m4/ax_code_coverage.m4])
1541 m4_include([m4/ax_cxx_compile_stdcxx.m4])
1542 m4_include([m4/libtool.m4])
1543 m4_include([m4/ltoptions.m4])
1544 m4_include([m4/ltsugar.m4])
1545 m4_include([m4/ltversion.m4])
1546 m4_include([m4/lt~obsolete.m4])
00 #! /bin/sh
11 # Guess values for system-dependent variables and create Makefiles.
2 # Generated by GNU Autoconf 2.69 for dvisvgm 2.7.3.
2 # Generated by GNU Autoconf 2.69 for dvisvgm 2.8.
33 #
44 # Report bugs to <martin.gieseking@uos.de>.
55 #
589589 # Identity of this package.
590590 PACKAGE_NAME='dvisvgm'
591591 PACKAGE_TARNAME='dvisvgm'
592 PACKAGE_VERSION='2.7.3'
593 PACKAGE_STRING='dvisvgm 2.7.3'
592 PACKAGE_VERSION='2.8'
593 PACKAGE_STRING='dvisvgm 2.8'
594594 PACKAGE_BUGREPORT='martin.gieseking@uos.de'
595595 PACKAGE_URL=''
596596
14051405 # Omit some internal or obsolete options to make the list less imposing.
14061406 # This message is too long to be a string in the A/UX 3.1 sh.
14071407 cat <<_ACEOF
1408 \`configure' configures dvisvgm 2.7.3 to adapt to many kinds of systems.
1408 \`configure' configures dvisvgm 2.8 to adapt to many kinds of systems.
14091409
14101410 Usage: $0 [OPTION]... [VAR=VALUE]...
14111411
14761476
14771477 if test -n "$ac_init_help"; then
14781478 case $ac_init_help in
1479 short | recursive ) echo "Configuration of dvisvgm 2.7.3:";;
1479 short | recursive ) echo "Configuration of dvisvgm 2.8:";;
14801480 esac
14811481 cat <<\_ACEOF
14821482
16241624 test -n "$ac_init_help" && exit $ac_status
16251625 if $ac_init_version; then
16261626 cat <<\_ACEOF
1627 dvisvgm configure 2.7.3
1627 dvisvgm configure 2.8
16281628 generated by GNU Autoconf 2.69
16291629
16301630 Copyright (C) 2012 Free Software Foundation, Inc.
21682168 This file contains any messages produced by compilers while
21692169 running configure, to aid debugging if configure makes a mistake.
21702170
2171 It was created by dvisvgm $as_me 2.7.3, which was
2171 It was created by dvisvgm $as_me 2.8, which was
21722172 generated by GNU Autoconf 2.69. Invocation command line was
21732173
21742174 $ $0 $@
25262526 ac_compiler_gnu=$ac_cv_c_compiler_gnu
25272527
25282528
2529 DATE="July 2019"
2529 DATE="October 2019"
25302530
25312531 ac_config_headers="$ac_config_headers config.h"
25322532
31563156
31573157 # Define the identity of the package.
31583158 PACKAGE='dvisvgm'
3159 VERSION='2.7.3'
3159 VERSION='2.8'
31603160
31613161
31623162 cat >>confdefs.h <<_ACEOF
99289928 $RM -r conftest*
99299929
99309930
9931 ## CAVEAT EMPTOR:
9932 ## There is no encapsulation within the following macros, do not change
9933 ## the running order or otherwise move them around unless you know exactly
9934 ## what you are doing...
99319935 if test -n "$compiler"; then
99329936
99339937 lt_prog_compiler_no_builtin_flag=
2013320137 # report actual input values of CONFIG_FILES etc. instead of their
2013420138 # values after options handling.
2013520139 ac_log="
20136 This file was extended by dvisvgm $as_me 2.7.3, which was
20140 This file was extended by dvisvgm $as_me 2.8, which was
2013720141 generated by GNU Autoconf 2.69. Invocation command line was
2013820142
2013920143 CONFIG_FILES = $CONFIG_FILES
2019920203 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
2020020204 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
2020120205 ac_cs_version="\\
20202 dvisvgm config.status 2.7.3
20206 dvisvgm config.status 2.8
2020320207 configured by $0, generated by GNU Autoconf 2.69,
2020420208 with options \\"\$ac_cs_config\\"
2020520209
33 # Process this file with autoconf to produce a configure script.
44
55 AC_PREREQ(2.59)
6 AC_INIT([dvisvgm],[2.7.3],[martin.gieseking@uos.de])
7 DATE="July 2019"
6 AC_INIT([dvisvgm],[2.8],[martin.gieseking@uos.de])
7 DATE="October 2019"
88 AC_CONFIG_SRCDIR(src)
99 AC_CONFIG_HEADERS([config.h])
1010 AC_CONFIG_MACRO_DIR([m4])
99 man_MANS = dvisvgm.1
1010 endif
1111
12 EXTRA_DIST = $(man_MANS) conf-dblatex-man.xsl conf-dblatex-pdf.xsl dvisvgm.sty dvisvgm.txt.in tweak-dblatex-pdf.xsl tweak-db-refentry.xsl
12 EXTRA_DIST = $(man_MANS) \
13 conf-dblatex-man.xsl \
14 conf-dblatex-pdf.xsl \
15 dvisvgm.txt.in \
16 generate-dvisvgm-sty.xsl \
17 tweak-dblatex-pdf.xsl \
18 tweak-db-refentry.xsl
1319
1420 CONF_DBLATEX_MAN = $(dvisvgm_srcdir)/doc/conf-dblatex-man.xsl
1521 CONF_DBLATEX_PDF = $(dvisvgm_srcdir)/doc/conf-dblatex-pdf.xsl
1622 TWEAK_DBLATEX_PDF = $(dvisvgm_srcdir)/doc/tweak-dblatex-pdf.xsl
1723 TWEAK_DB_ARTICLE = $(dvisvgm_srcdir)/doc/tweak-db-article.xsl
1824 TWEAK_DB_REFENTRY = $(dvisvgm_srcdir)/doc/tweak-db-refentry.xsl
25 GEN_DBLATEX_STY = $(dvisvgm_srcdir)/doc/generate-dvisvgm-sty.xsl
1926
2027 DB_VARS = man.endnotes.list.enabled=0 man.endnotes.are.numbered=0 man.authors.section.enabled=0
2128
2229 dvisvgm.1: dvisvgm-man.xml $(CONF_DBLATEX_MAN)
2330 xmlto -m $(CONF_DBLATEX_MAN) $(addprefix --stringparam , $(DB_VARS)) man $<
2431
25 dvisvgm.pdf: dvisvgm-man.xml $(CONF_DBLATEX_PDF) $(TWEAK_DBLATEX_PDF)
32 dvisvgm.pdf: dvisvgm-man.xml dvisvgm.sty $(CONF_DBLATEX_PDF) $(TWEAK_DBLATEX_PDF)
2633 mv $< $<.tmp
2734 xsltproc -o $< $(TWEAK_DBLATEX_PDF) $<.tmp
2835 dblatex -bxetex --texstyle=./dvisvgm.sty -p $(CONF_DBLATEX_PDF) $<
4350 a2x -darticle -fepub -L --icons --icons-dir=. $<
4451 mv $(basename $<).epub $@
4552
46 .SECONDARY: dvisvgm-article.xml dvisvgm-man.xml
53 .SECONDARY: dvisvgm-article.xml dvisvgm-man.xml dvisvgm.sty
4754
4855 dvisvgm-man.xml: dvisvgm.txt $(TWEAK_DB_REFENTRY)
4956 asciidoc -a icons -a 'iconsdir=.' -a badges -a 'revnumber=@VERSION@' --unsafe -bdocbook -dmanpage -o $@.tmp $<
5057 xsltproc -o $@ $(TWEAK_DB_REFENTRY) $@.tmp
5158 rm $@.tmp
5259
53 dvisvgm-article.xml: dvisvgm.txt
60 dvisvgm-article.xml: dvisvgm.txt $(TWEAK_DB_ARTICLE)
5461 asciidoc -a icons -a 'iconsdir=.' -a badges -a 'revnumber=@VERSION@' --unsafe -bdocbook -darticle -o $@.tmp $<
5562 xsltproc -o $@ $(TWEAK_DB_ARTICLE) $@.tmp
5663 rm $@.tmp
5764 sed -i "s/{VERSION}/@VERSION@/" $@
65
66 dvisvgm.sty: dvisvgm-man.xml $(GEN_DBLATEX_STY)
67 xsltproc -o dvisvgm.sty $(GEN_DBLATEX_STY) $<
5868
5969 dvisvgm.txt: dvisvgm.txt.in ../configure.ac
6070 sed -e 's/@VERSION[@]/@VERSION@/g' -e 's/@PACKAGE_BUGREPORT[@]/@PACKAGE_BUGREPORT@/g' $< >$@
6979 pdf: dvisvgm.pdf
7080
7181 clean:
72 rm -f dvisvgm.pdf dvisvgm.html dvisvgm-man.xml dvisvgm-article.xml dvisvgm.txt dvisvgm.dvi dvisvgm.epub
82 rm -f dvisvgm.pdf dvisvgm.html dvisvgm-man.xml dvisvgm-article.xml dvisvgm.txt dvisvgm.sty dvisvgm.dvi dvisvgm.epub
7383
7484 distclean-local:
75 rm -f dvisvgm.pdf dvisvgm.html dvisvgm-man.xml dvisvgm-article.xml dvisvgm.txt dvisvgm.dvi dvisvgm.epub dvisvgm.1
85 rm -f dvisvgm.pdf dvisvgm.html dvisvgm-man.xml dvisvgm-article.xml dvisvgm.txt dvisvgm.sty dvisvgm.dvi dvisvgm.epub dvisvgm.1
7686
7787 # Ensure that distribution tarballs always contain a recent manpage, i.e.
7888 # let "make dist" and "make distcheck" fail if dvisvgm.1 can't be built.
8989 target_triplet = @target@
9090 subdir = doc
9191 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
92 am__aclocal_m4_deps = $(top_srcdir)/configure.ac
92 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_compile_flag.m4 \
93 $(top_srcdir)/m4/ax_code_coverage.m4 \
94 $(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \
95 $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
96 $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
97 $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac
9398 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
9499 $(ACLOCAL_M4)
95100 DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
313318 # However, the distribution tarball should always contain a recent manpage. We ensure
314319 # this by adding a dist-hook rule below.
315320 @BUILD_MANPAGE_TRUE@man_MANS = dvisvgm.1
316 EXTRA_DIST = $(man_MANS) conf-dblatex-man.xsl conf-dblatex-pdf.xsl dvisvgm.sty dvisvgm.txt.in tweak-dblatex-pdf.xsl tweak-db-refentry.xsl
321 EXTRA_DIST = $(man_MANS) \
322 conf-dblatex-man.xsl \
323 conf-dblatex-pdf.xsl \
324 dvisvgm.txt.in \
325 generate-dvisvgm-sty.xsl \
326 tweak-dblatex-pdf.xsl \
327 tweak-db-refentry.xsl
328
317329 CONF_DBLATEX_MAN = $(dvisvgm_srcdir)/doc/conf-dblatex-man.xsl
318330 CONF_DBLATEX_PDF = $(dvisvgm_srcdir)/doc/conf-dblatex-pdf.xsl
319331 TWEAK_DBLATEX_PDF = $(dvisvgm_srcdir)/doc/tweak-dblatex-pdf.xsl
320332 TWEAK_DB_ARTICLE = $(dvisvgm_srcdir)/doc/tweak-db-article.xsl
321333 TWEAK_DB_REFENTRY = $(dvisvgm_srcdir)/doc/tweak-db-refentry.xsl
334 GEN_DBLATEX_STY = $(dvisvgm_srcdir)/doc/generate-dvisvgm-sty.xsl
322335 DB_VARS = man.endnotes.list.enabled=0 man.endnotes.are.numbered=0 man.authors.section.enabled=0
323336 all: all-am
324337
332345 exit 1;; \
333346 esac; \
334347 done; \
335 echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/Makefile'; \
348 echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign doc/Makefile'; \
336349 $(am__cd) $(top_srcdir) && \
337 $(AUTOMAKE) --gnu doc/Makefile
350 $(AUTOMAKE) --foreign doc/Makefile
338351 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
339352 @case '$?' in \
340353 *config.status*) \
564577 dvisvgm.1: dvisvgm-man.xml $(CONF_DBLATEX_MAN)
565578 xmlto -m $(CONF_DBLATEX_MAN) $(addprefix --stringparam , $(DB_VARS)) man $<
566579
567 dvisvgm.pdf: dvisvgm-man.xml $(CONF_DBLATEX_PDF) $(TWEAK_DBLATEX_PDF)
580 dvisvgm.pdf: dvisvgm-man.xml dvisvgm.sty $(CONF_DBLATEX_PDF) $(TWEAK_DBLATEX_PDF)
568581 mv $< $<.tmp
569582 xsltproc -o $< $(TWEAK_DBLATEX_PDF) $<.tmp
570583 dblatex -bxetex --texstyle=./dvisvgm.sty -p $(CONF_DBLATEX_PDF) $<
585598 a2x -darticle -fepub -L --icons --icons-dir=. $<
586599 mv $(basename $<).epub $@
587600
588 .SECONDARY: dvisvgm-article.xml dvisvgm-man.xml
601 .SECONDARY: dvisvgm-article.xml dvisvgm-man.xml dvisvgm.sty
589602
590603 dvisvgm-man.xml: dvisvgm.txt $(TWEAK_DB_REFENTRY)
591604 asciidoc -a icons -a 'iconsdir=.' -a badges -a 'revnumber=@VERSION@' --unsafe -bdocbook -dmanpage -o $@.tmp $<
592605 xsltproc -o $@ $(TWEAK_DB_REFENTRY) $@.tmp
593606 rm $@.tmp
594607
595 dvisvgm-article.xml: dvisvgm.txt
608 dvisvgm-article.xml: dvisvgm.txt $(TWEAK_DB_ARTICLE)
596609 asciidoc -a icons -a 'iconsdir=.' -a badges -a 'revnumber=@VERSION@' --unsafe -bdocbook -darticle -o $@.tmp $<
597610 xsltproc -o $@ $(TWEAK_DB_ARTICLE) $@.tmp
598611 rm $@.tmp
599612 sed -i "s/{VERSION}/@VERSION@/" $@
613
614 dvisvgm.sty: dvisvgm-man.xml $(GEN_DBLATEX_STY)
615 xsltproc -o dvisvgm.sty $(GEN_DBLATEX_STY) $<
600616
601617 dvisvgm.txt: dvisvgm.txt.in ../configure.ac
602618 sed -e 's/@VERSION[@]/@VERSION@/g' -e 's/@PACKAGE_BUGREPORT[@]/@PACKAGE_BUGREPORT@/g' $< >$@
611627 pdf: dvisvgm.pdf
612628
613629 clean:
614 rm -f dvisvgm.pdf dvisvgm.html dvisvgm-man.xml dvisvgm-article.xml dvisvgm.txt dvisvgm.dvi dvisvgm.epub
630 rm -f dvisvgm.pdf dvisvgm.html dvisvgm-man.xml dvisvgm-article.xml dvisvgm.txt dvisvgm.sty dvisvgm.dvi dvisvgm.epub
615631
616632 distclean-local:
617 rm -f dvisvgm.pdf dvisvgm.html dvisvgm-man.xml dvisvgm-article.xml dvisvgm.txt dvisvgm.dvi dvisvgm.epub dvisvgm.1
633 rm -f dvisvgm.pdf dvisvgm.html dvisvgm-man.xml dvisvgm-article.xml dvisvgm.txt dvisvgm.sty dvisvgm.dvi dvisvgm.epub dvisvgm.1
618634
619635 # Ensure that distribution tarballs always contain a recent manpage, i.e.
620636 # let "make dist" and "make distcheck" fail if dvisvgm.1 can't be built.
11 .\" Title: dvisvgm
22 .\" Author: Martin Gieseking <martin.gieseking@uos.de>
33 .\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
4 .\" Date: 07/12/2019
4 .\" Date: 2019-08-25
55 .\" Manual: dvisvgm Manual
6 .\" Source: dvisvgm 2.7.3
6 .\" Source: dvisvgm 2.8
77 .\" Language: English
88 .\"
9 .TH "DVISVGM" "1" "07/12/2019" "dvisvgm 2\&.7\&.3" "dvisvgm Manual"
9 .TH "DVISVGM" "1" "2019\-08\-25" "dvisvgm 2\&.8" "dvisvgm Manual"
1010 .\" -----------------------------------------------------------------
1111 .\" * Define some portability stuff
1212 .\" -----------------------------------------------------------------
163163 \fB\-C, \-\-cache\fR[=\fIdir\fR]
164164 .RS 4
165165 To speed up the conversion process of bitmap fonts, dvisvgm saves intermediate conversion information in cache files\&. By default, these files are stored in
166 \fB$HOME/\&.dvisvgm/cache\fR\&. If you prefer a different location, use option
166 \fB$XDG_CACHE_HOME/dvisvgm/\fR
167 or
168 \fB$HOME/\&.cache/dvisvgm\fR
169 if
170 \fBXDG_CACHE_HOME\fR
171 is not set\&. If you prefer a different location, use option
167172 \fB\-\-cache\fR
168173 to overwrite the default\&. Furthermore, it is also possible to disable the font caching mechanism completely with option
169174 \fB\-\-cache=none\fR\&. If argument
668673 \fBMD5\fR,
669674 \fBXXH32\fR, and
670675 \fBXXH64\fR, where the names can be given in lower case too, like
671 \fB\-\-page\-hashes=md5\fR\&.
676 \fB\-\-page\-hashes=md5\fR\&. Since version 0\&.7\&.1, xxHash provides an experimental 128\-bit hash function, whose algorithm may still change with the next versions of the library\&. If the corresponding API is available, dvisvgm supports the new hash function and option
677 \fB\-\-page\-hashes\fR
678 additionally accepts the algorithm specifier
679 \fBXXH128\fR\&.
672680 .sp
673681 Finally, option
674682 \fB\-\-page\-hashes\fR
+0
-14
doc/dvisvgm.sty less more
0 \NeedsTeXFormat{LaTeX2e}
1 \ProvidesPackage{dvisvgm}[2015/02/04 dvisvgm DocBook style]
2 \RequirePackageWithOptions{docbook}
3 \RequirePackage[english]{babel}
4 \RequirePackage[yyyymmdd]{datetime}
5 \AtBeginDocument{%
6 \thispagestyle{empty}
7 \lhead[]{\refmiscinfomanual}
8 \rhead[]{\thepage}
9 \lfoot[]{\refmiscinfosource{} \refmiscinfoversion}
10 \rfoot[]{\today}
11 \def\tableofcontents{\stdtoc} % keep TOC on current page
12 }
13
2121 :man source: dvisvgm
2222 :man version: @VERSION@
2323 :man manual: dvisvgm Manual
24 :revdate: 2019-08-25 20:14 +0200
2425
2526 Name
2627 ----
128129 //
129130 *-C, --cache*[='dir']::
130131 To speed up the conversion process of bitmap fonts, dvisvgm saves intermediate conversion
131 information in cache files. By default, these files are stored in +$HOME/.dvisvgm/cache+.
132 information in cache files. By default, these files are stored in +$XDG_CACHE_HOME/dvisvgm/+
133 or +$HOME/.cache/dvisvgm+ if +XDG_CACHE_HOME+ is not set.
132134 If you prefer a different location, use option *--cache* to overwrite the default. Furthermore,
133135 it is also possible to disable the font caching mechanism completely with option *--cache=none*.
134136 If argument 'dir' is omitted, dvisvgm prints the path of the default cache directory together
464466 +%hc+. It's extremely fast, and a 64-bit hash should be sufficient for most documents with an average
465467 size of pages. Alternatively, XXH32 and MD5 can be used as well. The desired algorithm is specified
466468 by argument 'params' of option *--page-hashes*. It takes one of the strings +MD5+, +XXH32+, and +XXH64+,
467 where the names can be given in lower case too, like +--page-hashes=md5+.
469 where the names can be given in lower case too, like +--page-hashes=md5+. Since version 0.7.1,
470 xxHash provides an experimental 128-bit hash function, whose algorithm may still change with the next
471 versions of the library. If the corresponding API is available, dvisvgm supports the new hash function
472 and option *--page-hashes* additionally accepts the algorithm specifier +XXH128+.
468473 +
469474 Finally, option *--page-hashes* can take a second argument that must be separated by a comma.
470475 Currently, only the two parameters 'list' and 'replace' are evaluated, e.g. +--page-hashes=md5,list+
0 <?xml version="1.0" encoding="UTF-8"?>
1 <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
2 <xsl:output method="text"/>
3
4 <xsl:template match="/">% This is a generated file -- don't modify it manually.
5 \NeedsTeXFormat{LaTeX2e}
6 \ProvidesPackage{dvisvgm}[2015/02/04 dvisvgm DocBook style]
7 \RequirePackageWithOptions{docbook}
8 \RequirePackage[english]{babel}
9 \AtBeginDocument{%
10 \thispagestyle{empty}
11 \lhead[]{\refmiscinfomanual}
12 \rhead[]{\thepage}
13 \lfoot[]{\refmiscinfosource{} \refmiscinfoversion}
14 \rfoot[]{<xsl:value-of select="refentry/refentryinfo/date"/>} % revision date given in dvisvgm.txt.in
15 \def\tableofcontents{\stdtoc} % keep TOC on current page
16 }
17 </xsl:template>
18 </xsl:stylesheet>
33 <xsl:stylesheet version="1.0"
44 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
55 xmlns:date="http://exslt.org/dates-and-times"
6 extension-element-prefixes="date">
6 xmlns:func="http://exslt.org/functions"
7 xmlns:my="my-namespace"
8 exclude-result-prefixes="my"
9 extension-element-prefixes="date func">
710
811 <xsl:output doctype-public="-//OASIS//DTD DocBook XML V4.5//EN" doctype-system="http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"/>
12
13 <!-- adapt ISO date created by keyword expansion -->
14 <xsl:template match="refentryinfo/date | revision[1]/date">
15 <date>
16 <xsl:value-of select="my:extract-date(.)"/>
17 </date>
18 </xsl:template>
919
1020 <!-- add date to refmeta element -->
1121 <xsl:template match="refmeta">
1222 <xsl:copy>
1323 <xsl:copy-of select="*"/>
14 <xsl:variable name="date" select="date:date()"/>
15 <xsl:if test="$date">
16 <refmiscinfo class="date">
17 <xsl:value-of select="substring($date, 1, 10)"/>
18 </refmiscinfo>
19 </xsl:if>
24 <refmiscinfo class="date">
25 <xsl:value-of select="my:extract-date(../refentryinfo/date)"/>
26 </refmiscinfo>
2027 </xsl:copy>
2128 </xsl:template>
29
30 <func:function name="my:extract-date">
31 <xsl:param name="isodate"/>
32 <xsl:variable name="shortdate" select="substring($isodate, 1, 10)"/>
33 <xsl:choose>
34 <xsl:when test="translate($shortdate, '0123456789', '##########') = '####-##-##'">
35 <!-- use date part of expanded keyword -->
36 <func:result select="$shortdate"/>
37 </xsl:when>
38 <xsl:otherwise>
39 <!-- use current date as fallback -->
40 <func:result select="substring(date:date(), 1, 10)"/>
41 </xsl:otherwise>
42 </xsl:choose>
43 </func:function>
2244
2345 <!-- copy everything else unchanged -->
2446 <xsl:template match="@*|node()">
9090 @ENABLE_WOFF_TRUE@am__append_1 = brotli ff-woff woff2
9191 subdir = libs
9292 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
93 am__aclocal_m4_deps = $(top_srcdir)/configure.ac
93 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_compile_flag.m4 \
94 $(top_srcdir)/m4/ax_code_coverage.m4 \
95 $(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \
96 $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
97 $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
98 $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac
9499 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
95100 $(ACLOCAL_M4)
96101 DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
351356 exit 1;; \
352357 esac; \
353358 done; \
354 echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu libs/Makefile'; \
359 echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign libs/Makefile'; \
355360 $(am__cd) $(top_srcdir) && \
356 $(AUTOMAKE) --gnu libs/Makefile
361 $(AUTOMAKE) --foreign libs/Makefile
357362 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
358363 @case '$?' in \
359364 *config.status*) \
9090 target_triplet = @target@
9191 subdir = libs/brotli
9292 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
93 am__aclocal_m4_deps = $(top_srcdir)/configure.ac
93 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_compile_flag.m4 \
94 $(top_srcdir)/m4/ax_code_coverage.m4 \
95 $(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \
96 $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
97 $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
98 $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac
9499 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
95100 $(ACLOCAL_M4)
96101 DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
486491 exit 1;; \
487492 esac; \
488493 done; \
489 echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu libs/brotli/Makefile'; \
494 echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign libs/brotli/Makefile'; \
490495 $(am__cd) $(top_srcdir) && \
491 $(AUTOMAKE) --gnu libs/brotli/Makefile
496 $(AUTOMAKE) --foreign libs/brotli/Makefile
492497 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
493498 @case '$?' in \
494499 *config.status*) \
9090 target_triplet = @target@
9191 subdir = libs/clipper
9292 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
93 am__aclocal_m4_deps = $(top_srcdir)/configure.ac
93 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_compile_flag.m4 \
94 $(top_srcdir)/m4/ax_code_coverage.m4 \
95 $(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \
96 $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
97 $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
98 $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac
9499 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
95100 $(ACLOCAL_M4)
96101 DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
369374 exit 1;; \
370375 esac; \
371376 done; \
372 echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu libs/clipper/Makefile'; \
377 echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign libs/clipper/Makefile'; \
373378 $(am__cd) $(top_srcdir) && \
374 $(AUTOMAKE) --gnu libs/clipper/Makefile
379 $(AUTOMAKE) --foreign libs/clipper/Makefile
375380 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
376381 @case '$?' in \
377382 *config.status*) \
9090 target_triplet = @target@
9191 subdir = libs/ff-woff
9292 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
93 am__aclocal_m4_deps = $(top_srcdir)/configure.ac
93 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_compile_flag.m4 \
94 $(top_srcdir)/m4/ax_code_coverage.m4 \
95 $(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \
96 $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
97 $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
98 $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac
9499 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
95100 $(ACLOCAL_M4)
96101 DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
513518 exit 1;; \
514519 esac; \
515520 done; \
516 echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu libs/ff-woff/Makefile'; \
521 echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign libs/ff-woff/Makefile'; \
517522 $(am__cd) $(top_srcdir) && \
518 $(AUTOMAKE) --gnu libs/ff-woff/Makefile
523 $(AUTOMAKE) --foreign libs/ff-woff/Makefile
519524 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
520525 @case '$?' in \
521526 *config.status*) \
9090 target_triplet = @target@
9191 subdir = libs/md5
9292 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
93 am__aclocal_m4_deps = $(top_srcdir)/configure.ac
93 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_compile_flag.m4 \
94 $(top_srcdir)/m4/ax_code_coverage.m4 \
95 $(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \
96 $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
97 $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
98 $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac
9499 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
95100 $(ACLOCAL_M4)
96101 DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
351356 exit 1;; \
352357 esac; \
353358 done; \
354 echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu libs/md5/Makefile'; \
359 echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign libs/md5/Makefile'; \
355360 $(am__cd) $(top_srcdir) && \
356 $(AUTOMAKE) --gnu libs/md5/Makefile
361 $(AUTOMAKE) --foreign libs/md5/Makefile
357362 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
358363 @case '$?' in \
359364 *config.status*) \
9090 target_triplet = @target@
9191 subdir = libs/potrace
9292 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
93 am__aclocal_m4_deps = $(top_srcdir)/configure.ac
93 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_compile_flag.m4 \
94 $(top_srcdir)/m4/ax_code_coverage.m4 \
95 $(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \
96 $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
97 $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
98 $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac
9499 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
95100 $(ACLOCAL_M4)
96101 DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
370375 exit 1;; \
371376 esac; \
372377 done; \
373 echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu libs/potrace/Makefile'; \
378 echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign libs/potrace/Makefile'; \
374379 $(am__cd) $(top_srcdir) && \
375 $(AUTOMAKE) --gnu libs/potrace/Makefile
380 $(AUTOMAKE) --foreign libs/potrace/Makefile
376381 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
377382 @case '$?' in \
378383 *config.status*) \
0 /* Copyright (C) 2001-2017 Peter Selinger.
0 /* Copyright (C) 2001-2019 Peter Selinger.
11 This file is part of Potrace. It is free software and it is covered
22 by the GNU General Public License. See the file COPYING for details. */
33
0 /* Copyright (C) 2001-2017 Peter Selinger.
0 /* Copyright (C) 2001-2019 Peter Selinger.
11 This file is part of Potrace. It is free software and it is covered
22 by the GNU General Public License. See the file COPYING for details. */
33
107107 return NULL;
108108 }
109109 if (size == 0) {
110 size = 1; /* make sure calloc() doesn't return NULL */
110 size = BM_WORDSIZE; /* make sure calloc() doesn't return NULL */
111111 }
112112
113113 bm = (potrace_bitmap_t *) malloc(sizeof(potrace_bitmap_t));
202202 goto error;
203203 }
204204 if (newsize == 0) {
205 newsize = 1; /* make sure realloc() doesn't return NULL */
205 newsize = BM_WORDSIZE; /* make sure realloc() doesn't return NULL */
206206 }
207207
208208 newmap = (potrace_word *)realloc(bm->map, newsize);
00 #ifndef CONFIG_H
11 #define CONFIG_H
2 #define VERSION "1.15"
2 #define VERSION "1.16"
33 #define HAVE_INTTYPES_H 1
44 #endif
0 /* Copyright (C) 2001-2017 Peter Selinger.
0 /* Copyright (C) 2001-2019 Peter Selinger.
11 This file is part of Potrace. It is free software and it is covered
22 by the GNU General Public License. See the file COPYING for details. */
33
0 /* Copyright (C) 2001-2017 Peter Selinger.
0 /* Copyright (C) 2001-2019 Peter Selinger.
11 This file is part of Potrace. It is free software and it is covered
22 by the GNU General Public License. See the file COPYING for details. */
33
0 /* Copyright (C) 2001-2017 Peter Selinger.
0 /* Copyright (C) 2001-2019 Peter Selinger.
11 This file is part of Potrace. It is free software and it is covered
22 by the GNU General Public License. See the file COPYING for details. */
33
0 /* Copyright (C) 2001-2017 Peter Selinger.
0 /* Copyright (C) 2001-2019 Peter Selinger.
11 This file is part of Potrace. It is free software and it is covered
22 by the GNU General Public License. See the file COPYING for details. */
33
0 /* Copyright (C) 2001-2017 Peter Selinger.
0 /* Copyright (C) 2001-2019 Peter Selinger.
11 This file is part of Potrace. It is free software and it is covered
22 by the GNU General Public License. See the file COPYING for details. */
33
0 /* Copyright (C) 2001-2017 Peter Selinger.
0 /* Copyright (C) 2001-2019 Peter Selinger.
11 This file is part of Potrace. It is free software and it is covered
22 by the GNU General Public License. See the file COPYING for details. */
33
0 /* Copyright (C) 2001-2017 Peter Selinger.
0 /* Copyright (C) 2001-2019 Peter Selinger.
11 This file is part of Potrace. It is free software and it is covered
22 by the GNU General Public License. See the file COPYING for details. */
33
0 /* Copyright (C) 2001-2017 Peter Selinger.
0 /* Copyright (C) 2001-2019 Peter Selinger.
11 This file is part of Potrace. It is free software and it is covered
22 by the GNU General Public License. See the file COPYING for details. */
33
0 /* Copyright (C) 2001-2017 Peter Selinger.
0 /* Copyright (C) 2001-2019 Peter Selinger.
11 This file is part of Potrace. It is free software and it is covered
22 by the GNU General Public License. See the file COPYING for details. */
33
0 /* Copyright (C) 2001-2017 Peter Selinger.
0 /* Copyright (C) 2001-2019 Peter Selinger.
11 This file is part of Potrace. It is free software and it is covered
22 by the GNU General Public License. See the file COPYING for details. */
33
9090 target_triplet = @target@
9191 subdir = libs/variant
9292 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
93 am__aclocal_m4_deps = $(top_srcdir)/configure.ac
93 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_compile_flag.m4 \
94 $(top_srcdir)/m4/ax_code_coverage.m4 \
95 $(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \
96 $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
97 $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
98 $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac
9499 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
95100 $(ACLOCAL_M4)
96101 DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \
314319 exit 1;; \
315320 esac; \
316321 done; \
317 echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu libs/variant/Makefile'; \
322 echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign libs/variant/Makefile'; \
318323 $(am__cd) $(top_srcdir) && \
319 $(AUTOMAKE) --gnu libs/variant/Makefile
324 $(AUTOMAKE) --foreign libs/variant/Makefile
320325 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
321326 @case '$?' in \
322327 *config.status*) \
9090 target_triplet = @target@
9191 subdir = libs/woff2
9292 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
93 am__aclocal_m4_deps = $(top_srcdir)/configure.ac
93 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_compile_flag.m4 \
94 $(top_srcdir)/m4/ax_code_coverage.m4 \
95 $(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \
96 $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
97 $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
98 $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac
9499 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
95100 $(ACLOCAL_M4)
96101 DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
415420 exit 1;; \
416421 esac; \
417422 done; \
418 echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu libs/woff2/Makefile'; \
423 echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign libs/woff2/Makefile'; \
419424 $(am__cd) $(top_srcdir) && \
420 $(AUTOMAKE) --gnu libs/woff2/Makefile
425 $(AUTOMAKE) --foreign libs/woff2/Makefile
421426 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
422427 @case '$?' in \
423428 *config.status*) \
349349 }
350350 } else if (glyph.contours.size() > 0) {
351351 // Simple glyph.
352 if (glyph.contours.size() > std::numeric_limits<int16_t>::max()) {
352 if (glyph.contours.size() > size_t(std::numeric_limits<int16_t>::max())) {
353353 return FONT_COMPRESSION_FAILURE();
354354 }
355355 if (*dst_size < ((12ULL + 2 * glyph.contours.size()) +
9292 if (table->IsReused()) {
9393 return true;
9494 }
95 int sz = Round4(table->length);
95 uint32_t sz = Round4(table->length);
9696 table->buffer.resize(sz);
9797 uint8_t* buf = &table->buffer[0];
9898 memcpy(buf, table->data, table->length);
00 if !HAVE_XXHASH
11 noinst_LIBRARIES = libxxhash.a
22
3 libxxhash_a_SOURCES = xxhash.c xxhash.h
3 libxxhash_a_SOURCES = xxhash.c xxhash.h xxh3.h
44 AM_CXXFLAGS = -Wall
55
6 xxhash.c: xxhash.h
6 xxhash.c: xxhash.h xxh3.h
77
88 @CODE_COVERAGE_RULES@
99 endif
9090 target_triplet = @target@
9191 subdir = libs/xxHash
9292 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
93 am__aclocal_m4_deps = $(top_srcdir)/configure.ac
93 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_compile_flag.m4 \
94 $(top_srcdir)/m4/ax_code_coverage.m4 \
95 $(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \
96 $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
97 $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
98 $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac
9499 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
95100 $(ACLOCAL_M4)
96101 DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
106111 am__v_AR_1 =
107112 libxxhash_a_AR = $(AR) $(ARFLAGS)
108113 libxxhash_a_LIBADD =
109 am__libxxhash_a_SOURCES_DIST = xxhash.c xxhash.h
114 am__libxxhash_a_SOURCES_DIST = xxhash.c xxhash.h xxh3.h
110115 @HAVE_XXHASH_FALSE@am_libxxhash_a_OBJECTS = xxhash.$(OBJEXT)
111116 libxxhash_a_OBJECTS = $(am_libxxhash_a_OBJECTS)
112117 AM_V_P = $(am__v_P_@AM_V@)
335340 top_builddir = @top_builddir@
336341 top_srcdir = @top_srcdir@
337342 @HAVE_XXHASH_FALSE@noinst_LIBRARIES = libxxhash.a
338 @HAVE_XXHASH_FALSE@libxxhash_a_SOURCES = xxhash.c xxhash.h
343 @HAVE_XXHASH_FALSE@libxxhash_a_SOURCES = xxhash.c xxhash.h xxh3.h
339344 @HAVE_XXHASH_FALSE@AM_CXXFLAGS = -Wall
340345 CLEANFILES = *.gcda *.gcno
341346 all: all-am
351356 exit 1;; \
352357 esac; \
353358 done; \
354 echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu libs/xxHash/Makefile'; \
359 echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign libs/xxHash/Makefile'; \
355360 $(am__cd) $(top_srcdir) && \
356 $(AUTOMAKE) --gnu libs/xxHash/Makefile
361 $(AUTOMAKE) --foreign libs/xxHash/Makefile
357362 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
358363 @case '$?' in \
359364 *config.status*) \
634639 .PRECIOUS: Makefile
635640
636641
637 @HAVE_XXHASH_FALSE@xxhash.c: xxhash.h
642 @HAVE_XXHASH_FALSE@xxhash.c: xxhash.h xxh3.h
638643
639644 @HAVE_XXHASH_FALSE@@CODE_COVERAGE_RULES@
640645
0 /*
1 xxHash - Extremely Fast Hash algorithm
2 Development source file for `xxh3`
3 Copyright (C) 2019-present, Yann Collet.
4
5 BSD 2-Clause License (http://www.opensource.org/licenses/bsd-license.php)
6
7 Redistribution and use in source and binary forms, with or without
8 modification, are permitted provided that the following conditions are
9 met:
10
11 * Redistributions of source code must retain the above copyright
12 notice, this list of conditions and the following disclaimer.
13 * Redistributions in binary form must reproduce the above
14 copyright notice, this list of conditions and the following disclaimer
15 in the documentation and/or other materials provided with the
16 distribution.
17
18 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22 OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29
30 You can contact the author at :
31 - xxHash source repository : https://github.com/Cyan4973/xxHash
32 */
33
34 /* Note :
35 This file is separated for development purposes.
36 It will be integrated into `xxhash.c` when development phase is complete.
37 */
38
39 #ifndef XXH3_H
40 #define XXH3_H
41
42
43 /* === Dependencies === */
44
45 #undef XXH_INLINE_ALL /* in case it's already defined */
46 #define XXH_INLINE_ALL
47 #include "xxhash.h"
48
49
50 /* === Compiler specifics === */
51
52 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* >= C99 */
53 # define XXH_RESTRICT restrict
54 #else
55 /* note : it might be useful to define __restrict or __restrict__ for some C++ compilers */
56 # define XXH_RESTRICT /* disable */
57 #endif
58
59 #if defined(__GNUC__)
60 # if defined(__AVX2__)
61 # include <immintrin.h>
62 # elif defined(__SSE2__)
63 # include <emmintrin.h>
64 # elif defined(__ARM_NEON__) || defined(__ARM_NEON)
65 # define inline __inline__ /* clang bug */
66 # include <arm_neon.h>
67 # undef inline
68 # endif
69 #elif defined(_MSC_VER)
70 # include <intrin.h>
71 #endif
72
73 /*
74 * Sanity check.
75 *
76 * XXH3 only requires these features to be efficient:
77 *
78 * - Usable unaligned access
79 * - A 32-bit or 64-bit ALU
80 * - If 32-bit, a decent ADC instruction
81 * - A 32 or 64-bit multiply with a 64-bit result
82 *
83 * Almost all 32-bit and 64-bit targets meet this, except for Thumb-1, the
84 * classic 16-bit only subset of ARM's instruction set.
85 *
86 * First of all, Thumb-1 lacks support for the UMULL instruction which
87 * performs the important long multiply. This means numerous __aeabi_lmul
88 * calls.
89 *
90 * Second of all, the 8 functional registers are just not enough.
91 * Setup for __aeabi_lmul, byteshift loads, pointers, and all arithmetic need
92 * Lo registers, and this shuffling results in thousands more MOVs than A32.
93 *
94 * A32 and T32 don't have this limitation. They can access all 14 registers,
95 * do a 32->64 multiply with UMULL, and the flexible operand is helpful too.
96 *
97 * If compiling Thumb-1 for a target which supports ARM instructions, we
98 * will give a warning.
99 *
100 * Usually, if this happens, it is because of an accident and you probably
101 * need to specify -march, as you probably meant to compileh for a newer
102 * architecture.
103 */
104 #if defined(__thumb__) && !defined(__thumb2__) && defined(__ARM_ARCH_ISA_ARM)
105 # warning "XXH3 is highly inefficient without ARM or Thumb-2."
106 #endif
107
108 /* ==========================================
109 * Vectorization detection
110 * ========================================== */
111 #define XXH_SCALAR 0
112 #define XXH_SSE2 1
113 #define XXH_AVX2 2
114 #define XXH_NEON 3
115 #define XXH_VSX 4
116
117 #ifndef XXH_VECTOR /* can be defined on command line */
118 # if defined(__AVX2__)
119 # define XXH_VECTOR XXH_AVX2
120 # elif defined(__SSE2__) || defined(_M_AMD64) || defined(_M_X64) || (defined(_M_IX86_FP) && (_M_IX86_FP == 2))
121 # define XXH_VECTOR XXH_SSE2
122 # elif defined(__GNUC__) /* msvc support maybe later */ \
123 && (defined(__ARM_NEON__) || defined(__ARM_NEON)) \
124 && (defined(__LITTLE_ENDIAN__) /* We only support little endian NEON */ \
125 || (defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__))
126 # define XXH_VECTOR XXH_NEON
127 # elif defined(__PPC64__) && defined(__POWER8_VECTOR__) && defined(__GNUC__)
128 # define XXH_VECTOR XXH_VSX
129 # else
130 # define XXH_VECTOR XXH_SCALAR
131 # endif
132 #endif
133
134 /* control alignment of accumulator,
135 * for compatibility with fast vector loads */
136 #ifndef XXH_ACC_ALIGN
137 # if XXH_VECTOR == 0 /* scalar */
138 # define XXH_ACC_ALIGN 8
139 # elif XXH_VECTOR == 1 /* sse2 */
140 # define XXH_ACC_ALIGN 16
141 # elif XXH_VECTOR == 2 /* avx2 */
142 # define XXH_ACC_ALIGN 32
143 # elif XXH_VECTOR == 3 /* neon */
144 # define XXH_ACC_ALIGN 16
145 # elif XXH_VECTOR == 4 /* vsx */
146 # define XXH_ACC_ALIGN 16
147 # endif
148 #endif
149
150 /* xxh_u64 XXH_mult32to64(xxh_u32 a, xxh_u64 b) { return (xxh_u64)a * (xxh_u64)b; } */
151 #if defined(_MSC_VER) && defined(_M_IX86)
152 # include <intrin.h>
153 # define XXH_mult32to64(x, y) __emulu(x, y)
154 #else
155 # define XXH_mult32to64(x, y) ((xxh_u64)((x) & 0xFFFFFFFF) * (xxh_u64)((y) & 0xFFFFFFFF))
156 #endif
157
158 /* VSX stuff. It's a lot because VSX support is mediocre across compilers and
159 * there is a lot of mischief with endianness. */
160 #if XXH_VECTOR == XXH_VSX
161 # include <altivec.h>
162 # undef vector
163 typedef __vector unsigned long long U64x2;
164 typedef __vector unsigned char U8x16;
165 typedef __vector unsigned U32x4;
166
167 #ifndef XXH_VSX_BE
168 # if defined(__BIG_ENDIAN__) \
169 || (defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)
170 # define XXH_VSX_BE 1
171 # elif defined(__VEC_ELEMENT_REG_ORDER__) && __VEC_ELEMENT_REG_ORDER__ == __ORDER_BIG_ENDIAN__
172 # warning "-maltivec=be is not recommended. Please use native endianness."
173 # define XXH_VSX_BE 1
174 # else
175 # define XXH_VSX_BE 0
176 # endif
177 #endif
178
179 /* We need some helpers for big endian mode. */
180 #if XXH_VSX_BE
181 /* A wrapper for POWER9's vec_revb. */
182 # ifdef __POWER9_VECTOR__
183 # define XXH_vec_revb vec_revb
184 # else
185 XXH_FORCE_INLINE U64x2 XXH_vec_revb(U64x2 val)
186 {
187 U8x16 const vByteSwap = { 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00,
188 0x0F, 0x0E, 0x0D, 0x0C, 0x0B, 0x0A, 0x09, 0x08 };
189 return vec_perm(val, val, vByteSwap);
190 }
191 # endif
192
193 /* Power8 Crypto gives us vpermxor which is very handy for
194 * PPC64EB.
195 *
196 * U8x16 vpermxor(U8x16 a, U8x16 b, U8x16 mask)
197 * {
198 * U8x16 ret;
199 * for (int i = 0; i < 16; i++) {
200 * ret[i] = a[mask[i] & 0xF] ^ b[mask[i] >> 4];
201 * }
202 * return ret;
203 * }
204 *
205 * Because both of the main loops load the key, swap, and xor it with input,
206 * we can combine the key swap into this instruction.
207 */
208 # ifdef vec_permxor
209 # define XXH_vec_permxor vec_permxor
210 # else
211 # define XXH_vec_permxor __builtin_crypto_vpermxor
212 # endif
213 #endif
214 /*
215 * Because we reinterpret the multiply, there are endian memes: vec_mulo actually becomes
216 * vec_mule.
217 *
218 * Additionally, the intrinsic wasn't added until GCC 8, despite existing for a while.
219 * Clang has an easy way to control this, we can just use the builtin which doesn't swap.
220 * GCC needs inline assembly. */
221 #if __has_builtin(__builtin_altivec_vmuleuw)
222 # define XXH_vec_mulo __builtin_altivec_vmulouw
223 # define XXH_vec_mule __builtin_altivec_vmuleuw
224 #else
225 /* Adapted from https://github.com/google/highwayhash/blob/master/highwayhash/hh_vsx.h. */
226 XXH_FORCE_INLINE U64x2 XXH_vec_mulo(U32x4 a, U32x4 b) {
227 U64x2 result;
228 __asm__("vmulouw %0, %1, %2" : "=v" (result) : "v" (a), "v" (b));
229 return result;
230 }
231 XXH_FORCE_INLINE U64x2 XXH_vec_mule(U32x4 a, U32x4 b) {
232 U64x2 result;
233 __asm__("vmuleuw %0, %1, %2" : "=v" (result) : "v" (a), "v" (b));
234 return result;
235 }
236 #endif
237 #endif
238
239
240 /* ==========================================
241 * XXH3 default settings
242 * ========================================== */
243
244 #define XXH_SECRET_DEFAULT_SIZE 192 /* minimum XXH3_SECRET_SIZE_MIN */
245
246 #if (XXH_SECRET_DEFAULT_SIZE < XXH3_SECRET_SIZE_MIN)
247 # error "default keyset is not large enough"
248 #endif
249
250 XXH_ALIGN(64) static const xxh_u8 kSecret[XXH_SECRET_DEFAULT_SIZE] = {
251 0xb8, 0xfe, 0x6c, 0x39, 0x23, 0xa4, 0x4b, 0xbe, 0x7c, 0x01, 0x81, 0x2c, 0xf7, 0x21, 0xad, 0x1c,
252 0xde, 0xd4, 0x6d, 0xe9, 0x83, 0x90, 0x97, 0xdb, 0x72, 0x40, 0xa4, 0xa4, 0xb7, 0xb3, 0x67, 0x1f,
253 0xcb, 0x79, 0xe6, 0x4e, 0xcc, 0xc0, 0xe5, 0x78, 0x82, 0x5a, 0xd0, 0x7d, 0xcc, 0xff, 0x72, 0x21,
254 0xb8, 0x08, 0x46, 0x74, 0xf7, 0x43, 0x24, 0x8e, 0xe0, 0x35, 0x90, 0xe6, 0x81, 0x3a, 0x26, 0x4c,
255 0x3c, 0x28, 0x52, 0xbb, 0x91, 0xc3, 0x00, 0xcb, 0x88, 0xd0, 0x65, 0x8b, 0x1b, 0x53, 0x2e, 0xa3,
256 0x71, 0x64, 0x48, 0x97, 0xa2, 0x0d, 0xf9, 0x4e, 0x38, 0x19, 0xef, 0x46, 0xa9, 0xde, 0xac, 0xd8,
257 0xa8, 0xfa, 0x76, 0x3f, 0xe3, 0x9c, 0x34, 0x3f, 0xf9, 0xdc, 0xbb, 0xc7, 0xc7, 0x0b, 0x4f, 0x1d,
258 0x8a, 0x51, 0xe0, 0x4b, 0xcd, 0xb4, 0x59, 0x31, 0xc8, 0x9f, 0x7e, 0xc9, 0xd9, 0x78, 0x73, 0x64,
259
260 0xea, 0xc5, 0xac, 0x83, 0x34, 0xd3, 0xeb, 0xc3, 0xc5, 0x81, 0xa0, 0xff, 0xfa, 0x13, 0x63, 0xeb,
261 0x17, 0x0d, 0xdd, 0x51, 0xb7, 0xf0, 0xda, 0x49, 0xd3, 0x16, 0x55, 0x26, 0x29, 0xd4, 0x68, 0x9e,
262 0x2b, 0x16, 0xbe, 0x58, 0x7d, 0x47, 0xa1, 0xfc, 0x8f, 0xf8, 0xb8, 0xd1, 0x7a, 0xd0, 0x31, 0xce,
263 0x45, 0xcb, 0x3a, 0x8f, 0x95, 0x16, 0x04, 0x28, 0xaf, 0xd7, 0xfb, 0xca, 0xbb, 0x4b, 0x40, 0x7e,
264 };
265
266 /*
267 * GCC for x86 has a tendency to use SSE in this loop. While it
268 * successfully avoids swapping (as MUL overwrites EAX and EDX), it
269 * slows it down because instead of free register swap shifts, it
270 * must use pshufd and punpckl/hd.
271 *
272 * To prevent this, we use this attribute to shut off SSE.
273 */
274 #if defined(__GNUC__) && !defined(__clang__) && defined(__i386__)
275 __attribute__((__target__("no-sse")))
276 #endif
277 static XXH128_hash_t
278 XXH_mult64to128(xxh_u64 lhs, xxh_u64 rhs)
279 {
280 /*
281 * GCC/Clang __uint128_t method.
282 *
283 * On most 64-bit targets, GCC and Clang define a __uint128_t type.
284 * This is usually the best way as it usually uses a native long 64-bit
285 * multiply, such as MULQ on x86_64 or MUL + UMULH on aarch64.
286 *
287 * Usually.
288 *
289 * Despite being a 32-bit platform, Clang (and emscripten) define this
290 * type despite not having the arithmetic for it. This results in a
291 * laggy compiler builtin call which calculates a full 128-bit multiply.
292 * In that case it is best to use the portable one.
293 * https://github.com/Cyan4973/xxHash/issues/211#issuecomment-515575677
294 */
295 #if defined(__GNUC__) && !defined(__wasm__) \
296 && defined(__SIZEOF_INT128__) \
297 || (defined(_INTEGRAL_MAX_BITS) && _INTEGRAL_MAX_BITS >= 128)
298
299 __uint128_t product = (__uint128_t)lhs * (__uint128_t)rhs;
300 XXH128_hash_t const r128 = { (xxh_u64)(product), (xxh_u64)(product >> 64) };
301 return r128;
302
303 /*
304 * MSVC for x64's _umul128 method.
305 *
306 * xxh_u64 _umul128(xxh_u64 Multiplier, xxh_u64 Multiplicand, xxh_u64 *HighProduct);
307 *
308 * This compiles to single operand MUL on x64.
309 */
310 #elif defined(_M_X64) || defined(_M_IA64)
311
312 #ifndef _MSC_VER
313 # pragma intrinsic(_umul128)
314 #endif
315 xxh_u64 product_high;
316 xxh_u64 const product_low = _umul128(lhs, rhs, &product_high);
317 XXH128_hash_t const r128 = { product_low, product_high };
318 return r128;
319
320 #else
321 /*
322 * Portable scalar method. Optimized for 32-bit and 64-bit ALUs.
323 *
324 * This is a fast and simple grade school multiply, which is shown
325 * below with base 10 arithmetic instead of base 0x100000000.
326 *
327 * 9 3 // D2 lhs = 93
328 * x 7 5 // D2 rhs = 75
329 * ----------
330 * 1 5 // D2 lo_lo = (93 % 10) * (75 % 10)
331 * 4 5 | // D2 hi_lo = (93 / 10) * (75 % 10)
332 * 2 1 | // D2 lo_hi = (93 % 10) * (75 / 10)
333 * + 6 3 | | // D2 hi_hi = (93 / 10) * (75 / 10)
334 * ---------
335 * 2 7 | // D2 cross = (15 / 10) + (45 % 10) + 21
336 * + 6 7 | | // D2 upper = (27 / 10) + (45 / 10) + 63
337 * ---------
338 * 6 9 7 5
339 *
340 * The reasons for adding the products like this are:
341 * 1. It avoids manual carry tracking. Just like how
342 * (9 * 9) + 9 + 9 = 99, the same applies with this for
343 * UINT64_MAX. This avoids a lot of complexity.
344 *
345 * 2. It hints for, and on Clang, compiles to, the powerful UMAAL
346 * instruction available in ARMv6+ A32/T32, which is shown below:
347 *
348 * void UMAAL(xxh_u32 *RdLo, xxh_u32 *RdHi, xxh_u32 Rn, xxh_u32 Rm)
349 * {
350 * xxh_u64 product = (xxh_u64)*RdLo * (xxh_u64)*RdHi + Rn + Rm;
351 * *RdLo = (xxh_u32)(product & 0xFFFFFFFF);
352 * *RdHi = (xxh_u32)(product >> 32);
353 * }
354 *
355 * This instruction was designed for efficient long multiplication,
356 * and allows this to be calculated in only 4 instructions which
357 * is comparable to some 64-bit ALUs.
358 *
359 * 3. It isn't terrible on other platforms. Usually this will be
360 * a couple of 32-bit ADD/ADCs.
361 */
362
363 /* First calculate all of the cross products. */
364 xxh_u64 const lo_lo = XXH_mult32to64(lhs & 0xFFFFFFFF, rhs & 0xFFFFFFFF);
365 xxh_u64 const hi_lo = XXH_mult32to64(lhs >> 32, rhs & 0xFFFFFFFF);
366 xxh_u64 const lo_hi = XXH_mult32to64(lhs & 0xFFFFFFFF, rhs >> 32);
367 xxh_u64 const hi_hi = XXH_mult32to64(lhs >> 32, rhs >> 32);
368
369 /* Now add the products together. These will never overflow. */
370 xxh_u64 const cross = (lo_lo >> 32) + (hi_lo & 0xFFFFFFFF) + lo_hi;
371 xxh_u64 const upper = (hi_lo >> 32) + (cross >> 32) + hi_hi;
372 xxh_u64 const lower = (cross << 32) | (lo_lo & 0xFFFFFFFF);
373
374 XXH128_hash_t r128 = { lower, upper };
375 return r128;
376 #endif
377 }
378
379 /*
380 * We want to keep the attribute here because a target switch
381 * disables inlining.
382 *
383 * Does a 64-bit to 128-bit multiply, then XOR folds it.
384 * The reason for the separate function is to prevent passing
385 * too many structs around by value. This will hopefully inline
386 * the multiply, but we don't force it.
387 */
388 #if defined(__GNUC__) && !defined(__clang__) && defined(__i386__)
389 __attribute__((__target__("no-sse")))
390 #endif
391 static xxh_u64
392 XXH3_mul128_fold64(xxh_u64 lhs, xxh_u64 rhs)
393 {
394 XXH128_hash_t product = XXH_mult64to128(lhs, rhs);
395 return product.low64 ^ product.high64;
396 }
397
398
399 static XXH64_hash_t XXH3_avalanche(xxh_u64 h64)
400 {
401 h64 ^= h64 >> 37;
402 h64 *= PRIME64_3;
403 h64 ^= h64 >> 32;
404 return h64;
405 }
406
407
408 /* ==========================================
409 * Short keys
410 * ========================================== */
411
412 XXH_FORCE_INLINE XXH64_hash_t
413 XXH3_len_1to3_64b(const xxh_u8* input, size_t len, const xxh_u8* secret, XXH64_hash_t seed)
414 {
415 XXH_ASSERT(input != NULL);
416 XXH_ASSERT(1 <= len && len <= 3);
417 XXH_ASSERT(secret != NULL);
418 { xxh_u8 const c1 = input[0];
419 xxh_u8 const c2 = input[len >> 1];
420 xxh_u8 const c3 = input[len - 1];
421 xxh_u32 const combined = ((xxh_u32)c1) | (((xxh_u32)c2) << 8) | (((xxh_u32)c3) << 16) | (((xxh_u32)len) << 24);
422 xxh_u64 const keyed = (xxh_u64)combined ^ (XXH_readLE32(secret) + seed);
423 xxh_u64 const mixed = keyed * PRIME64_1;
424 return XXH3_avalanche(mixed);
425 }
426 }
427
428 XXH_FORCE_INLINE XXH64_hash_t
429 XXH3_len_4to8_64b(const xxh_u8* input, size_t len, const xxh_u8* secret, XXH64_hash_t seed)
430 {
431 XXH_ASSERT(input != NULL);
432 XXH_ASSERT(secret != NULL);
433 XXH_ASSERT(4 <= len && len <= 8);
434 { xxh_u32 const input_lo = XXH_readLE32(input);
435 xxh_u32 const input_hi = XXH_readLE32(input + len - 4);
436 xxh_u64 const input_64 = input_lo | ((xxh_u64)input_hi << 32);
437 xxh_u64 const keyed = input_64 ^ (XXH_readLE64(secret) + seed);
438 xxh_u64 const mix64 = len + ((keyed ^ (keyed >> 51)) * PRIME32_1);
439 return XXH3_avalanche((mix64 ^ (mix64 >> 47)) * PRIME64_2);
440 }
441 }
442
443 XXH_FORCE_INLINE XXH64_hash_t
444 XXH3_len_9to16_64b(const xxh_u8* input, size_t len, const xxh_u8* secret, XXH64_hash_t seed)
445 {
446 XXH_ASSERT(input != NULL);
447 XXH_ASSERT(secret != NULL);
448 XXH_ASSERT(9 <= len && len <= 16);
449 { xxh_u64 const input_lo = XXH_readLE64(input) ^ (XXH_readLE64(secret) + seed);
450 xxh_u64 const input_hi = XXH_readLE64(input + len - 8) ^ (XXH_readLE64(secret + 8) - seed);
451 xxh_u64 const acc = len + (input_lo + input_hi) + XXH3_mul128_fold64(input_lo, input_hi);
452 return XXH3_avalanche(acc);
453 }
454 }
455
456 XXH_FORCE_INLINE XXH64_hash_t
457 XXH3_len_0to16_64b(const xxh_u8* input, size_t len, const xxh_u8* secret, XXH64_hash_t seed)
458 {
459 XXH_ASSERT(len <= 16);
460 { if (len > 8) return XXH3_len_9to16_64b(input, len, secret, seed);
461 if (len >= 4) return XXH3_len_4to8_64b(input, len, secret, seed);
462 if (len) return XXH3_len_1to3_64b(input, len, secret, seed);
463 return 0;
464 }
465 }
466
467
468 /* === Long Keys === */
469
470 #define STRIPE_LEN 64
471 #define XXH_SECRET_CONSUME_RATE 8 /* nb of secret bytes consumed at each accumulation */
472 #define ACC_NB (STRIPE_LEN / sizeof(xxh_u64))
473
474 typedef enum { XXH3_acc_64bits, XXH3_acc_128bits } XXH3_accWidth_e;
475
476 XXH_FORCE_INLINE void
477 XXH3_accumulate_512( void* XXH_RESTRICT acc,
478 const void* XXH_RESTRICT input,
479 const void* XXH_RESTRICT secret,
480 XXH3_accWidth_e accWidth)
481 {
482 #if (XXH_VECTOR == XXH_AVX2)
483
484 XXH_ASSERT((((size_t)acc) & 31) == 0);
485 { XXH_ALIGN(32) __m256i* const xacc = (__m256i *) acc;
486 const __m256i* const xinput = (const __m256i *) input; /* not really aligned, just for ptr arithmetic, and because _mm256_loadu_si256() requires this type */
487 const __m256i* const xsecret = (const __m256i *) secret; /* not really aligned, just for ptr arithmetic, and because _mm256_loadu_si256() requires this type */
488
489 size_t i;
490 for (i=0; i < STRIPE_LEN/sizeof(__m256i); i++) {
491 __m256i const data_vec = _mm256_loadu_si256 (xinput+i);
492 __m256i const key_vec = _mm256_loadu_si256 (xsecret+i);
493 __m256i const data_key = _mm256_xor_si256 (data_vec, key_vec); /* uint32 dk[8] = {d0+k0, d1+k1, d2+k2, d3+k3, ...} */
494 __m256i const product = _mm256_mul_epu32 (data_key, _mm256_shuffle_epi32 (data_key, 0x31)); /* uint64 mul[4] = {dk0*dk1, dk2*dk3, ...} */
495 if (accWidth == XXH3_acc_128bits) {
496 __m256i const data_swap = _mm256_shuffle_epi32(data_vec, _MM_SHUFFLE(1,0,3,2));
497 __m256i const sum = _mm256_add_epi64(xacc[i], data_swap);
498 xacc[i] = _mm256_add_epi64(product, sum);
499 } else { /* XXH3_acc_64bits */
500 __m256i const sum = _mm256_add_epi64(xacc[i], data_vec);
501 xacc[i] = _mm256_add_epi64(product, sum);
502 }
503 } }
504
505 #elif (XXH_VECTOR == XXH_SSE2)
506
507 XXH_ASSERT((((size_t)acc) & 15) == 0);
508 { XXH_ALIGN(16) __m128i* const xacc = (__m128i *) acc;
509 const __m128i* const xinput = (const __m128i *) input; /* not really aligned, just for ptr arithmetic, and because _mm_loadu_si128() requires this type */
510 const __m128i* const xsecret = (const __m128i *) secret; /* not really aligned, just for ptr arithmetic, and because _mm_loadu_si128() requires this type */
511
512 size_t i;
513 for (i=0; i < STRIPE_LEN/sizeof(__m128i); i++) {
514 __m128i const data_vec = _mm_loadu_si128 (xinput+i);
515 __m128i const key_vec = _mm_loadu_si128 (xsecret+i);
516 __m128i const data_key = _mm_xor_si128 (data_vec, key_vec); /* uint32 dk[8] = {d0+k0, d1+k1, d2+k2, d3+k3, ...} */
517 __m128i const product = _mm_mul_epu32 (data_key, _mm_shuffle_epi32 (data_key, 0x31)); /* uint64 mul[4] = {dk0*dk1, dk2*dk3, ...} */
518 if (accWidth == XXH3_acc_128bits) {
519 __m128i const data_swap = _mm_shuffle_epi32(data_vec, _MM_SHUFFLE(1,0,3,2));
520 __m128i const sum = _mm_add_epi64(xacc[i], data_swap);
521 xacc[i] = _mm_add_epi64(product, sum);
522 } else { /* XXH3_acc_64bits */
523 __m128i const sum = _mm_add_epi64(xacc[i], data_vec);
524 xacc[i] = _mm_add_epi64(product, sum);
525 }
526 } }
527
528 #elif (XXH_VECTOR == XXH_NEON)
529
530 XXH_ASSERT((((size_t)acc) & 15) == 0);
531 {
532 XXH_ALIGN(16) uint64x2_t* const xacc = (uint64x2_t *) acc;
533 /* We don't use a uint32x4_t pointer because it causes bus errors on ARMv7. */
534 uint8_t const* const xinput = (const uint8_t *) input;
535 uint8_t const* const xsecret = (const uint8_t *) secret;
536
537 size_t i;
538 for (i=0; i < STRIPE_LEN / sizeof(uint64x2_t); i++) {
539 #if !defined(__aarch64__) && !defined(__arm64__) && defined(__GNUC__) /* ARM32-specific hack */
540 /* vzip on ARMv7 Clang generates a lot of vmovs (technically vorrs) without this.
541 * vzip on 32-bit ARM NEON will overwrite the original register, and I think that Clang
542 * assumes I don't want to destroy it and tries to make a copy. This slows down the code
543 * a lot.
544 * aarch64 not only uses an entirely different syntax, but it requires three
545 * instructions...
546 * ext v1.16B, v0.16B, #8 // select high bits because aarch64 can't address them directly
547 * zip1 v3.2s, v0.2s, v1.2s // first zip
548 * zip2 v2.2s, v0.2s, v1.2s // second zip
549 * ...to do what ARM does in one:
550 * vzip.32 d0, d1 // Interleave high and low bits and overwrite. */
551
552 /* data_vec = xsecret[i]; */
553 uint8x16_t const data_vec = vld1q_u8(xinput + (i * 16));
554 /* key_vec = xsecret[i]; */
555 uint8x16_t const key_vec = vld1q_u8(xsecret + (i * 16));
556 /* data_key = data_vec ^ key_vec; */
557 uint32x4_t data_key;
558
559 if (accWidth == XXH3_acc_64bits) {
560 /* Add first to prevent register swaps */
561 /* xacc[i] += data_vec; */
562 xacc[i] = vaddq_u64 (xacc[i], vreinterpretq_u64_u8(data_vec));
563 } else { /* XXH3_acc_128bits */
564 /* xacc[i] += swap(data_vec); */
565 /* can probably be optimized better */
566 uint64x2_t const data64 = vreinterpretq_u64_u8(data_vec);
567 uint64x2_t const swapped= vextq_u64(data64, data64, 1);
568 xacc[i] = vaddq_u64 (xacc[i], swapped);
569 }
570
571 data_key = vreinterpretq_u32_u8(veorq_u8(data_vec, key_vec));
572
573 /* Here's the magic. We use the quirkiness of vzip to shuffle data_key in place.
574 * shuffle: data_key[0, 1, 2, 3] = data_key[0, 2, 1, 3] */
575 __asm__("vzip.32 %e0, %f0" : "+w" (data_key));
576 /* xacc[i] += (uint64x2_t) data_key[0, 1] * (uint64x2_t) data_key[2, 3]; */
577 xacc[i] = vmlal_u32(xacc[i], vget_low_u32(data_key), vget_high_u32(data_key));
578
579 #else
580 /* On aarch64, vshrn/vmovn seems to be equivalent to, if not faster than, the vzip method. */
581
582 /* data_vec = xsecret[i]; */
583 uint8x16_t const data_vec = vld1q_u8(xinput + (i * 16));
584 /* key_vec = xsecret[i]; */
585 uint8x16_t const key_vec = vld1q_u8(xsecret + (i * 16));
586 /* data_key = data_vec ^ key_vec; */
587 uint64x2_t const data_key = vreinterpretq_u64_u8(veorq_u8(data_vec, key_vec));
588 /* data_key_lo = (uint32x2_t) (data_key & 0xFFFFFFFF); */
589 uint32x2_t const data_key_lo = vmovn_u64 (data_key);
590 /* data_key_hi = (uint32x2_t) (data_key >> 32); */
591 uint32x2_t const data_key_hi = vshrn_n_u64 (data_key, 32);
592 if (accWidth == XXH3_acc_64bits) {
593 /* xacc[i] += data_vec; */
594 xacc[i] = vaddq_u64 (xacc[i], vreinterpretq_u64_u8(data_vec));
595 } else { /* XXH3_acc_128bits */
596 /* xacc[i] += swap(data_vec); */
597 uint64x2_t const data64 = vreinterpretq_u64_u8(data_vec);
598 uint64x2_t const swapped= vextq_u64(data64, data64, 1);
599 xacc[i] = vaddq_u64 (xacc[i], swapped);
600 }
601 /* xacc[i] += (uint64x2_t) data_key_lo * (uint64x2_t) data_key_hi; */
602 xacc[i] = vmlal_u32 (xacc[i], data_key_lo, data_key_hi);
603
604 #endif
605 }
606 }
607
608 #elif (XXH_VECTOR == XXH_VSX)
609 U64x2* const xacc = (U64x2*) acc; /* presumed aligned */
610 U64x2 const* const xinput = (U64x2 const*) input; /* no alignment restriction */
611 U64x2 const* const xsecret = (U64x2 const*) secret; /* no alignment restriction */
612 U64x2 const v32 = { 32, 32 };
613 #if XXH_VSX_BE
614 U8x16 const vXorSwap = { 0x07, 0x16, 0x25, 0x34, 0x43, 0x52, 0x61, 0x70,
615 0x8F, 0x9E, 0xAD, 0xBC, 0xCB, 0xDA, 0xE9, 0xF8 };
616 #endif
617 size_t i;
618 for (i = 0; i < STRIPE_LEN / sizeof(U64x2); i++) {
619 /* data_vec = xinput[i]; */
620 /* key_vec = xsecret[i]; */
621 #if XXH_VSX_BE
622 /* byteswap */
623 U64x2 const data_vec = XXH_vec_revb(vec_vsx_ld(0, xinput + i));
624 U64x2 const key_raw = vec_vsx_ld(0, xsecret + i);
625 /* See comment above. data_key = data_vec ^ swap(xsecret[i]); */
626 U64x2 const data_key = (U64x2)XXH_vec_permxor((U8x16)data_vec, (U8x16)key_raw, vXorSwap);
627 #else
628 U64x2 const data_vec = vec_vsx_ld(0, xinput + i);
629 U64x2 const key_vec = vec_vsx_ld(0, xsecret + i);
630 U64x2 const data_key = data_vec ^ key_vec;
631 #endif
632 /* shuffled = (data_key << 32) | (data_key >> 32); */
633 U32x4 const shuffled = (U32x4)vec_rl(data_key, v32);
634 /* product = ((U64x2)data_key & 0xFFFFFFFF) * ((U64x2)shuffled & 0xFFFFFFFF); */
635 U64x2 const product = XXH_vec_mulo((U32x4)data_key, shuffled);
636 xacc[i] += product;
637
638 if (accWidth == XXH3_acc_64bits) {
639 xacc[i] += data_vec;
640 } else { /* XXH3_acc_128bits */
641 /* swap high and low halves */
642 U64x2 const data_swapped = vec_xxpermdi(data_vec, data_vec, 2);
643 xacc[i] += data_swapped;
644 }
645 }
646
647 #else /* scalar variant of Accumulator - universal */
648
649 XXH_ALIGN(XXH_ACC_ALIGN) xxh_u64* const xacc = (xxh_u64*) acc; /* presumed aligned on 32-bytes boundaries, little hint for the auto-vectorizer */
650 const xxh_u8* const xinput = (const xxh_u8*) input; /* no alignment restriction */
651 const xxh_u8* const xsecret = (const xxh_u8*) secret; /* no alignment restriction */
652 size_t i;
653 XXH_ASSERT(((size_t)acc & (XXH_ACC_ALIGN-1)) == 0);
654 for (i=0; i < ACC_NB; i++) {
655 xxh_u64 const data_val = XXH_readLE64(xinput + 8*i);
656 xxh_u64 const data_key = data_val ^ XXH_readLE64(xsecret + i*8);
657
658 if (accWidth == XXH3_acc_64bits) {
659 xacc[i] += data_val;
660 } else {
661 xacc[i ^ 1] += data_val; /* swap adjacent lanes */
662 }
663 xacc[i] += XXH_mult32to64(data_key & 0xFFFFFFFF, data_key >> 32);
664 }
665 #endif
666 }
667
668 XXH_FORCE_INLINE void
669 XXH3_scrambleAcc(void* XXH_RESTRICT acc, const void* XXH_RESTRICT secret)
670 {
671 #if (XXH_VECTOR == XXH_AVX2)
672
673 XXH_ASSERT((((size_t)acc) & 31) == 0);
674 { XXH_ALIGN(32) __m256i* const xacc = (__m256i*) acc;
675 const __m256i* const xsecret = (const __m256i *) secret; /* not really aligned, just for ptr arithmetic, and because _mm256_loadu_si256() requires this argument type */
676 const __m256i prime32 = _mm256_set1_epi32((int)PRIME32_1);
677
678 size_t i;
679 for (i=0; i < STRIPE_LEN/sizeof(__m256i); i++) {
680 /* xacc[i] ^= (xacc[i] >> 47) */
681 __m256i const acc_vec = xacc[i];
682 __m256i const shifted = _mm256_srli_epi64 (acc_vec, 47);
683 __m256i const data_vec = _mm256_xor_si256 (acc_vec, shifted);
684 /* xacc[i] ^= xsecret; */
685 __m256i const key_vec = _mm256_loadu_si256 (xsecret+i);
686 __m256i const data_key = _mm256_xor_si256 (data_vec, key_vec);
687
688 /* xacc[i] *= PRIME32_1; */
689 __m256i const data_key_hi = _mm256_shuffle_epi32 (data_key, 0x31);
690 __m256i const prod_lo = _mm256_mul_epu32 (data_key, prime32);
691 __m256i const prod_hi = _mm256_mul_epu32 (data_key_hi, prime32);
692 xacc[i] = _mm256_add_epi64(prod_lo, _mm256_slli_epi64(prod_hi, 32));
693 }
694 }
695
696 #elif (XXH_VECTOR == XXH_SSE2)
697
698 XXH_ASSERT((((size_t)acc) & 15) == 0);
699 { XXH_ALIGN(16) __m128i* const xacc = (__m128i*) acc;
700 const __m128i* const xsecret = (const __m128i *) secret; /* not really aligned, just for ptr arithmetic, and because _mm_loadu_si128() requires this argument type */
701 const __m128i prime32 = _mm_set1_epi32((int)PRIME32_1);
702
703 size_t i;
704 for (i=0; i < STRIPE_LEN/sizeof(__m128i); i++) {
705 /* xacc[i] ^= (xacc[i] >> 47) */
706 __m128i const acc_vec = xacc[i];
707 __m128i const shifted = _mm_srli_epi64 (acc_vec, 47);
708 __m128i const data_vec = _mm_xor_si128 (acc_vec, shifted);
709 /* xacc[i] ^= xsecret; */
710 __m128i const key_vec = _mm_loadu_si128 (xsecret+i);
711 __m128i const data_key = _mm_xor_si128 (data_vec, key_vec);
712
713 /* xacc[i] *= PRIME32_1; */
714 __m128i const data_key_hi = _mm_shuffle_epi32 (data_key, 0x31);
715 __m128i const prod_lo = _mm_mul_epu32 (data_key, prime32);
716 __m128i const prod_hi = _mm_mul_epu32 (data_key_hi, prime32);
717 xacc[i] = _mm_add_epi64(prod_lo, _mm_slli_epi64(prod_hi, 32));
718 }
719 }
720
721 #elif (XXH_VECTOR == XXH_NEON)
722
723 XXH_ASSERT((((size_t)acc) & 15) == 0);
724
725 { uint64x2_t* const xacc = (uint64x2_t*) acc;
726 uint8_t const* const xsecret = (uint8_t const*) secret;
727 uint32x2_t const prime = vdup_n_u32 (PRIME32_1);
728
729 size_t i;
730 for (i=0; i < STRIPE_LEN/sizeof(uint64x2_t); i++) {
731 /* data_vec = xacc[i] ^ (xacc[i] >> 47); */
732 uint64x2_t const acc_vec = xacc[i];
733 uint64x2_t const shifted = vshrq_n_u64 (acc_vec, 47);
734 uint64x2_t const data_vec = veorq_u64 (acc_vec, shifted);
735
736 /* key_vec = xsecret[i]; */
737 uint32x4_t const key_vec = vreinterpretq_u32_u8(vld1q_u8(xsecret + (i * 16)));
738 /* data_key = data_vec ^ key_vec; */
739 uint32x4_t const data_key = veorq_u32 (vreinterpretq_u32_u64(data_vec), key_vec);
740 /* shuffled = { data_key[0, 2], data_key[1, 3] }; */
741 uint32x2x2_t const shuffled = vzip_u32 (vget_low_u32(data_key), vget_high_u32(data_key));
742
743 /* data_key *= PRIME32_1 */
744
745 /* prod_hi = (data_key >> 32) * PRIME32_1; */
746 uint64x2_t const prod_hi = vmull_u32 (shuffled.val[1], prime);
747 /* xacc[i] = prod_hi << 32; */
748 xacc[i] = vshlq_n_u64(prod_hi, 32);
749 /* xacc[i] += (prod_hi & 0xFFFFFFFF) * PRIME32_1; */
750 xacc[i] = vmlal_u32(xacc[i], shuffled.val[0], prime);
751 } }
752
753 #elif (XXH_VECTOR == XXH_VSX)
754
755 U64x2* const xacc = (U64x2*) acc;
756 const U64x2* const xsecret = (const U64x2*) secret;
757 /* constants */
758 U64x2 const v32 = { 32, 32 };
759 U64x2 const v47 = { 47, 47 };
760 U32x4 const prime = { PRIME32_1, PRIME32_1, PRIME32_1, PRIME32_1 };
761 size_t i;
762 #if XXH_VSX_BE
763 /* endian swap */
764 U8x16 const vXorSwap = { 0x07, 0x16, 0x25, 0x34, 0x43, 0x52, 0x61, 0x70,
765 0x8F, 0x9E, 0xAD, 0xBC, 0xCB, 0xDA, 0xE9, 0xF8 };
766 #endif
767 for (i = 0; i < STRIPE_LEN / sizeof(U64x2); i++) {
768 U64x2 const acc_vec = xacc[i];
769 U64x2 const data_vec = acc_vec ^ (acc_vec >> v47);
770 /* key_vec = xsecret[i]; */
771 #if XXH_VSX_BE
772 /* swap bytes words */
773 U64x2 const key_raw = vec_vsx_ld(0, xsecret + i);
774 U64x2 const data_key = (U64x2)XXH_vec_permxor((U8x16)data_vec, (U8x16)key_raw, vXorSwap);
775 #else
776 U64x2 const key_vec = vec_vsx_ld(0, xsecret + i);
777 U64x2 const data_key = data_vec ^ key_vec;
778 #endif
779
780 /* data_key *= PRIME32_1 */
781
782 /* prod_lo = ((U64x2)data_key & 0xFFFFFFFF) * ((U64x2)prime & 0xFFFFFFFF); */
783 U64x2 const prod_even = XXH_vec_mule((U32x4)data_key, prime);
784 /* prod_hi = ((U64x2)data_key >> 32) * ((U64x2)prime >> 32); */
785 U64x2 const prod_odd = XXH_vec_mulo((U32x4)data_key, prime);
786 xacc[i] = prod_odd + (prod_even << v32);
787 }
788
789 #else /* scalar variant of Scrambler - universal */
790
791 XXH_ALIGN(XXH_ACC_ALIGN) xxh_u64* const xacc = (xxh_u64*) acc; /* presumed aligned on 32-bytes boundaries, little hint for the auto-vectorizer */
792 const xxh_u8* const xsecret = (const xxh_u8*) secret; /* no alignment restriction */
793 size_t i;
794 XXH_ASSERT((((size_t)acc) & (XXH_ACC_ALIGN-1)) == 0);
795 for (i=0; i < ACC_NB; i++) {
796 xxh_u64 const key64 = XXH_readLE64(xsecret + 8*i);
797 xxh_u64 acc64 = xacc[i];
798 acc64 ^= acc64 >> 47;
799 acc64 ^= key64;
800 acc64 *= PRIME32_1;
801 xacc[i] = acc64;
802 }
803
804 #endif
805 }
806
807 /* assumption : nbStripes will not overflow secret size */
808 XXH_FORCE_INLINE void
809 XXH3_accumulate( xxh_u64* XXH_RESTRICT acc,
810 const xxh_u8* XXH_RESTRICT input,
811 const xxh_u8* XXH_RESTRICT secret,
812 size_t nbStripes,
813 XXH3_accWidth_e accWidth)
814 {
815 size_t n;
816 for (n = 0; n < nbStripes; n++ ) {
817 XXH3_accumulate_512(acc,
818 input + n*STRIPE_LEN,
819 secret + n*XXH_SECRET_CONSUME_RATE,
820 accWidth);
821 }
822 }
823
824 /* note : clang auto-vectorizes well in SS2 mode _if_ this function is `static`,
825 * and doesn't auto-vectorize it at all if it is `FORCE_INLINE`.
826 * However, it auto-vectorizes better AVX2 if it is `FORCE_INLINE`
827 * Pretty much every other modes and compilers prefer `FORCE_INLINE`.
828 */
829
830 #if defined(__clang__) && (XXH_VECTOR==0) && !defined(__AVX2__) && !defined(__arm__) && !defined(__thumb__)
831 static void
832 #else
833 XXH_FORCE_INLINE void
834 #endif
835 XXH3_hashLong_internal_loop( xxh_u64* XXH_RESTRICT acc,
836 const xxh_u8* XXH_RESTRICT input, size_t len,
837 const xxh_u8* XXH_RESTRICT secret, size_t secretSize,
838 XXH3_accWidth_e accWidth)
839 {
840 size_t const nb_rounds = (secretSize - STRIPE_LEN) / XXH_SECRET_CONSUME_RATE;
841 size_t const block_len = STRIPE_LEN * nb_rounds;
842 size_t const nb_blocks = len / block_len;
843
844 size_t n;
845
846 XXH_ASSERT(secretSize >= XXH3_SECRET_SIZE_MIN);
847
848 for (n = 0; n < nb_blocks; n++) {
849 XXH3_accumulate(acc, input + n*block_len, secret, nb_rounds, accWidth);
850 XXH3_scrambleAcc(acc, secret + secretSize - STRIPE_LEN);
851 }
852
853 /* last partial block */
854 XXH_ASSERT(len > STRIPE_LEN);
855 { size_t const nbStripes = (len - (block_len * nb_blocks)) / STRIPE_LEN;
856 XXH_ASSERT(nbStripes <= (secretSize / XXH_SECRET_CONSUME_RATE));
857 XXH3_accumulate(acc, input + nb_blocks*block_len, secret, nbStripes, accWidth);
858
859 /* last stripe */
860 if (len & (STRIPE_LEN - 1)) {
861 const xxh_u8* const p = input + len - STRIPE_LEN;
862 #define XXH_SECRET_LASTACC_START 7 /* do not align on 8, so that secret is different from scrambler */
863 XXH3_accumulate_512(acc, p, secret + secretSize - STRIPE_LEN - XXH_SECRET_LASTACC_START, accWidth);
864 } }
865 }
866
867 XXH_FORCE_INLINE xxh_u64
868 XXH3_mix2Accs(const xxh_u64* XXH_RESTRICT acc, const xxh_u8* XXH_RESTRICT secret)
869 {
870 return XXH3_mul128_fold64(
871 acc[0] ^ XXH_readLE64(secret),
872 acc[1] ^ XXH_readLE64(secret+8) );
873 }
874
875 static XXH64_hash_t
876 XXH3_mergeAccs(const xxh_u64* XXH_RESTRICT acc, const xxh_u8* XXH_RESTRICT secret, xxh_u64 start)
877 {
878 xxh_u64 result64 = start;
879
880 result64 += XXH3_mix2Accs(acc+0, secret + 0);
881 result64 += XXH3_mix2Accs(acc+2, secret + 16);
882 result64 += XXH3_mix2Accs(acc+4, secret + 32);
883 result64 += XXH3_mix2Accs(acc+6, secret + 48);
884
885 return XXH3_avalanche(result64);
886 }
887
888 #define XXH3_INIT_ACC { PRIME32_3, PRIME64_1, PRIME64_2, PRIME64_3, \
889 PRIME64_4, PRIME32_2, PRIME64_5, PRIME32_1 };
890
891 XXH_FORCE_INLINE XXH64_hash_t
892 XXH3_hashLong_internal(const xxh_u8* XXH_RESTRICT input, size_t len,
893 const xxh_u8* XXH_RESTRICT secret, size_t secretSize)
894 {
895 XXH_ALIGN(XXH_ACC_ALIGN) xxh_u64 acc[ACC_NB] = XXH3_INIT_ACC;
896
897 XXH3_hashLong_internal_loop(acc, input, len, secret, secretSize, XXH3_acc_64bits);
898
899 /* converge into final hash */
900 XXH_STATIC_ASSERT(sizeof(acc) == 64);
901 #define XXH_SECRET_MERGEACCS_START 11 /* do not align on 8, so that secret is different from accumulator */
902 XXH_ASSERT(secretSize >= sizeof(acc) + XXH_SECRET_MERGEACCS_START);
903 return XXH3_mergeAccs(acc, secret + XXH_SECRET_MERGEACCS_START, (xxh_u64)len * PRIME64_1);
904 }
905
906
907 XXH_NO_INLINE XXH64_hash_t /* It's important for performance that XXH3_hashLong is not inlined. Not sure why (uop cache maybe ?), but difference is large and easily measurable */
908 XXH3_hashLong_64b_defaultSecret(const xxh_u8* XXH_RESTRICT input, size_t len)
909 {
910 return XXH3_hashLong_internal(input, len, kSecret, sizeof(kSecret));
911 }
912
913 XXH_NO_INLINE XXH64_hash_t /* It's important for performance that XXH3_hashLong is not inlined. Not sure why (uop cache maybe ?), but difference is large and easily measurable */
914 XXH3_hashLong_64b_withSecret(const xxh_u8* XXH_RESTRICT input, size_t len,
915 const xxh_u8* XXH_RESTRICT secret, size_t secretSize)
916 {
917 return XXH3_hashLong_internal(input, len, secret, secretSize);
918 }
919
920
921 XXH_FORCE_INLINE void XXH_writeLE64(void* dst, xxh_u64 v64)
922 {
923 if (!XXH_CPU_LITTLE_ENDIAN) v64 = XXH_swap64(v64);
924 memcpy(dst, &v64, sizeof(v64));
925 }
926
927 /* XXH3_initCustomSecret() :
928 * destination `customSecret` is presumed allocated and same size as `kSecret`.
929 */
930 XXH_FORCE_INLINE void XXH3_initCustomSecret(xxh_u8* customSecret, xxh_u64 seed64)
931 {
932 int const nbRounds = XXH_SECRET_DEFAULT_SIZE / 16;
933 int i;
934
935 XXH_STATIC_ASSERT((XXH_SECRET_DEFAULT_SIZE & 15) == 0);
936
937 for (i=0; i < nbRounds; i++) {
938 XXH_writeLE64(customSecret + 16*i, XXH_readLE64(kSecret + 16*i) + seed64);
939 XXH_writeLE64(customSecret + 16*i + 8, XXH_readLE64(kSecret + 16*i + 8) - seed64);
940 }
941 }
942
943
944 /* XXH3_hashLong_64b_withSeed() :
945 * Generate a custom key,
946 * based on alteration of default kSecret with the seed,
947 * and then use this key for long mode hashing.
948 * This operation is decently fast but nonetheless costs a little bit of time.
949 * Try to avoid it whenever possible (typically when seed==0).
950 */
951 XXH_NO_INLINE XXH64_hash_t /* It's important for performance that XXH3_hashLong is not inlined. Not sure why (uop cache maybe ?), but difference is large and easily measurable */
952 XXH3_hashLong_64b_withSeed(const xxh_u8* input, size_t len, XXH64_hash_t seed)
953 {
954 XXH_ALIGN(8) xxh_u8 secret[XXH_SECRET_DEFAULT_SIZE];
955 if (seed==0) return XXH3_hashLong_64b_defaultSecret(input, len);
956 XXH3_initCustomSecret(secret, seed);
957 return XXH3_hashLong_internal(input, len, secret, sizeof(secret));
958 }
959
960
961 XXH_FORCE_INLINE xxh_u64 XXH3_mix16B(const xxh_u8* XXH_RESTRICT input,
962 const xxh_u8* XXH_RESTRICT secret, xxh_u64 seed64)
963 {
964 xxh_u64 const input_lo = XXH_readLE64(input);
965 xxh_u64 const input_hi = XXH_readLE64(input+8);
966 return XXH3_mul128_fold64(
967 input_lo ^ (XXH_readLE64(secret) + seed64),
968 input_hi ^ (XXH_readLE64(secret+8) - seed64) );
969 }
970
971
972 XXH_FORCE_INLINE XXH64_hash_t
973 XXH3_len_17to128_64b(const xxh_u8* XXH_RESTRICT input, size_t len,
974 const xxh_u8* XXH_RESTRICT secret, size_t secretSize,
975 XXH64_hash_t seed)
976 {
977 XXH_ASSERT(secretSize >= XXH3_SECRET_SIZE_MIN); (void)secretSize;
978 XXH_ASSERT(16 < len && len <= 128);
979
980 { xxh_u64 acc = len * PRIME64_1;
981 if (len > 32) {
982 if (len > 64) {
983 if (len > 96) {
984 acc += XXH3_mix16B(input+48, secret+96, seed);
985 acc += XXH3_mix16B(input+len-64, secret+112, seed);
986 }
987 acc += XXH3_mix16B(input+32, secret+64, seed);
988 acc += XXH3_mix16B(input+len-48, secret+80, seed);
989 }
990 acc += XXH3_mix16B(input+16, secret+32, seed);
991 acc += XXH3_mix16B(input+len-32, secret+48, seed);
992 }
993 acc += XXH3_mix16B(input+0, secret+0, seed);
994 acc += XXH3_mix16B(input+len-16, secret+16, seed);
995
996 return XXH3_avalanche(acc);
997 }
998 }
999
1000 #define XXH3_MIDSIZE_MAX 240
1001
1002 XXH_NO_INLINE XXH64_hash_t
1003 XXH3_len_129to240_64b(const xxh_u8* XXH_RESTRICT input, size_t len,
1004 const xxh_u8* XXH_RESTRICT secret, size_t secretSize,
1005 XXH64_hash_t seed)
1006 {
1007 XXH_ASSERT(secretSize >= XXH3_SECRET_SIZE_MIN); (void)secretSize;
1008 XXH_ASSERT(128 < len && len <= XXH3_MIDSIZE_MAX);
1009
1010 #define XXH3_MIDSIZE_STARTOFFSET 3
1011 #define XXH3_MIDSIZE_LASTOFFSET 17
1012
1013 { xxh_u64 acc = len * PRIME64_1;
1014 int const nbRounds = (int)len / 16;
1015 int i;
1016 for (i=0; i<8; i++) {
1017 acc += XXH3_mix16B(input+(16*i), secret+(16*i), seed);
1018 }
1019 acc = XXH3_avalanche(acc);
1020 XXH_ASSERT(nbRounds >= 8);
1021 for (i=8 ; i < nbRounds; i++) {
1022 acc += XXH3_mix16B(input+(16*i), secret+(16*(i-8)) + XXH3_MIDSIZE_STARTOFFSET, seed);
1023 }
1024 /* last bytes */
1025 acc += XXH3_mix16B(input + len - 16, secret + XXH3_SECRET_SIZE_MIN - XXH3_MIDSIZE_LASTOFFSET, seed);
1026 return XXH3_avalanche(acc);
1027 }
1028 }
1029
1030 /* === Public entry point === */
1031
1032 XXH_PUBLIC_API XXH64_hash_t XXH3_64bits(const void* input, size_t len)
1033 {
1034 if (len <= 16) return XXH3_len_0to16_64b((const xxh_u8*)input, len, kSecret, 0);
1035 if (len <= 128) return XXH3_len_17to128_64b((const xxh_u8*)input, len, kSecret, sizeof(kSecret), 0);
1036 if (len <= XXH3_MIDSIZE_MAX) return XXH3_len_129to240_64b((const xxh_u8*)input, len, kSecret, sizeof(kSecret), 0);
1037 return XXH3_hashLong_64b_defaultSecret((const xxh_u8*)input, len);
1038 }
1039
1040 XXH_PUBLIC_API XXH64_hash_t
1041 XXH3_64bits_withSecret(const void* input, size_t len, const void* secret, size_t secretSize)
1042 {
1043 XXH_ASSERT(secretSize >= XXH3_SECRET_SIZE_MIN);
1044 /* if an action must be taken should `secret` conditions not be respected,
1045 * it should be done here.
1046 * For now, it's a contract pre-condition.
1047 * Adding a check and a branch here would cost performance at every hash */
1048 if (len <= 16) return XXH3_len_0to16_64b((const xxh_u8*)input, len, (const xxh_u8*)secret, 0);
1049 if (len <= 128) return XXH3_len_17to128_64b((const xxh_u8*)input, len, (const xxh_u8*)secret, secretSize, 0);
1050 if (len <= XXH3_MIDSIZE_MAX) return XXH3_len_129to240_64b((const xxh_u8*)input, len, (const xxh_u8*)secret, secretSize, 0);
1051 return XXH3_hashLong_64b_withSecret((const xxh_u8*)input, len, (const xxh_u8*)secret, secretSize);
1052 }
1053
1054 XXH_PUBLIC_API XXH64_hash_t
1055 XXH3_64bits_withSeed(const void* input, size_t len, XXH64_hash_t seed)
1056 {
1057 if (len <= 16) return XXH3_len_0to16_64b((const xxh_u8*)input, len, kSecret, seed);
1058 if (len <= 128) return XXH3_len_17to128_64b((const xxh_u8*)input, len, kSecret, sizeof(kSecret), seed);
1059 if (len <= XXH3_MIDSIZE_MAX) return XXH3_len_129to240_64b((const xxh_u8*)input, len, kSecret, sizeof(kSecret), seed);
1060 return XXH3_hashLong_64b_withSeed((const xxh_u8*)input, len, seed);
1061 }
1062
1063 /* === XXH3 streaming === */
1064
1065 XXH_PUBLIC_API XXH3_state_t* XXH3_createState(void)
1066 {
1067 return (XXH3_state_t*)XXH_malloc(sizeof(XXH3_state_t));
1068 }
1069
1070 XXH_PUBLIC_API XXH_errorcode XXH3_freeState(XXH3_state_t* statePtr)
1071 {
1072 XXH_free(statePtr);
1073 return XXH_OK;
1074 }
1075
1076 XXH_PUBLIC_API void
1077 XXH3_copyState(XXH3_state_t* dst_state, const XXH3_state_t* src_state)
1078 {
1079 memcpy(dst_state, src_state, sizeof(*dst_state));
1080 }
1081
1082 static void
1083 XXH3_64bits_reset_internal(XXH3_state_t* statePtr,
1084 XXH64_hash_t seed,
1085 const xxh_u8* secret, size_t secretSize)
1086 {
1087 XXH_ASSERT(statePtr != NULL);
1088 memset(statePtr, 0, sizeof(*statePtr));
1089 statePtr->acc[0] = PRIME32_3;
1090 statePtr->acc[1] = PRIME64_1;
1091 statePtr->acc[2] = PRIME64_2;
1092 statePtr->acc[3] = PRIME64_3;
1093 statePtr->acc[4] = PRIME64_4;
1094 statePtr->acc[5] = PRIME32_2;
1095 statePtr->acc[6] = PRIME64_5;
1096 statePtr->acc[7] = PRIME32_1;
1097 statePtr->seed = seed;
1098 XXH_ASSERT(secret != NULL);
1099 statePtr->secret = secret;
1100 XXH_ASSERT(secretSize >= XXH3_SECRET_SIZE_MIN);
1101 statePtr->secretLimit = (XXH32_hash_t)(secretSize - STRIPE_LEN);
1102 statePtr->nbStripesPerBlock = statePtr->secretLimit / XXH_SECRET_CONSUME_RATE;
1103 }
1104
1105 XXH_PUBLIC_API XXH_errorcode
1106 XXH3_64bits_reset(XXH3_state_t* statePtr)
1107 {
1108 if (statePtr == NULL) return XXH_ERROR;
1109 XXH3_64bits_reset_internal(statePtr, 0, kSecret, XXH_SECRET_DEFAULT_SIZE);
1110 return XXH_OK;
1111 }
1112
1113 XXH_PUBLIC_API XXH_errorcode
1114 XXH3_64bits_reset_withSecret(XXH3_state_t* statePtr, const void* secret, size_t secretSize)
1115 {
1116 if (statePtr == NULL) return XXH_ERROR;
1117 XXH3_64bits_reset_internal(statePtr, 0, (const xxh_u8*)secret, secretSize);
1118 if (secret == NULL) return XXH_ERROR;
1119 if (secretSize < XXH3_SECRET_SIZE_MIN) return XXH_ERROR;
1120 return XXH_OK;
1121 }
1122
1123 XXH_PUBLIC_API XXH_errorcode
1124 XXH3_64bits_reset_withSeed(XXH3_state_t* statePtr, XXH64_hash_t seed)
1125 {
1126 if (statePtr == NULL) return XXH_ERROR;
1127 XXH3_64bits_reset_internal(statePtr, seed, kSecret, XXH_SECRET_DEFAULT_SIZE);
1128 XXH3_initCustomSecret(statePtr->customSecret, seed);
1129 statePtr->secret = statePtr->customSecret;
1130 return XXH_OK;
1131 }
1132
1133 XXH_FORCE_INLINE void
1134 XXH3_consumeStripes( xxh_u64* acc,
1135 XXH32_hash_t* nbStripesSoFarPtr, XXH32_hash_t nbStripesPerBlock,
1136 const xxh_u8* input, size_t totalStripes,
1137 const xxh_u8* secret, size_t secretLimit,
1138 XXH3_accWidth_e accWidth)
1139 {
1140 XXH_ASSERT(*nbStripesSoFarPtr < nbStripesPerBlock);
1141 if (nbStripesPerBlock - *nbStripesSoFarPtr <= totalStripes) {
1142 /* need a scrambling operation */
1143 size_t const nbStripes = nbStripesPerBlock - *nbStripesSoFarPtr;
1144 XXH3_accumulate(acc, input, secret + nbStripesSoFarPtr[0] * XXH_SECRET_CONSUME_RATE, nbStripes, accWidth);
1145 XXH3_scrambleAcc(acc, secret + secretLimit);
1146 XXH3_accumulate(acc, input + nbStripes * STRIPE_LEN, secret, totalStripes - nbStripes, accWidth);
1147 *nbStripesSoFarPtr = (XXH32_hash_t)(totalStripes - nbStripes);
1148 } else {
1149 XXH3_accumulate(acc, input, secret + nbStripesSoFarPtr[0] * XXH_SECRET_CONSUME_RATE, totalStripes, accWidth);
1150 *nbStripesSoFarPtr += (XXH32_hash_t)totalStripes;
1151 }
1152 }
1153
1154 XXH_FORCE_INLINE XXH_errorcode
1155 XXH3_update(XXH3_state_t* state, const xxh_u8* input, size_t len, XXH3_accWidth_e accWidth)
1156 {
1157 if (input==NULL)
1158 #if defined(XXH_ACCEPT_NULL_INPUT_POINTER) && (XXH_ACCEPT_NULL_INPUT_POINTER>=1)
1159 return XXH_OK;
1160 #else
1161 return XXH_ERROR;
1162 #endif
1163
1164 { const xxh_u8* const bEnd = input + len;
1165
1166 state->totalLen += len;
1167
1168 if (state->bufferedSize + len <= XXH3_INTERNALBUFFER_SIZE) { /* fill in tmp buffer */
1169 XXH_memcpy(state->buffer + state->bufferedSize, input, len);
1170 state->bufferedSize += (XXH32_hash_t)len;
1171 return XXH_OK;
1172 }
1173 /* input now > XXH3_INTERNALBUFFER_SIZE */
1174
1175 #define XXH3_INTERNALBUFFER_STRIPES (XXH3_INTERNALBUFFER_SIZE / STRIPE_LEN)
1176 XXH_STATIC_ASSERT(XXH3_INTERNALBUFFER_SIZE % STRIPE_LEN == 0); /* clean multiple */
1177
1178 if (state->bufferedSize) { /* some input within internal buffer: fill then consume it */
1179 size_t const loadSize = XXH3_INTERNALBUFFER_SIZE - state->bufferedSize;
1180 XXH_memcpy(state->buffer + state->bufferedSize, input, loadSize);
1181 input += loadSize;
1182 XXH3_consumeStripes(state->acc,
1183 &state->nbStripesSoFar, state->nbStripesPerBlock,
1184 state->buffer, XXH3_INTERNALBUFFER_STRIPES,
1185 state->secret, state->secretLimit,
1186 accWidth);
1187 state->bufferedSize = 0;
1188 }
1189
1190 /* consume input by full buffer quantities */
1191 if (input+XXH3_INTERNALBUFFER_SIZE <= bEnd) {
1192 const xxh_u8* const limit = bEnd - XXH3_INTERNALBUFFER_SIZE;
1193 do {
1194 XXH3_consumeStripes(state->acc,
1195 &state->nbStripesSoFar, state->nbStripesPerBlock,
1196 input, XXH3_INTERNALBUFFER_STRIPES,
1197 state->secret, state->secretLimit,
1198 accWidth);
1199 input += XXH3_INTERNALBUFFER_SIZE;
1200 } while (input<=limit);
1201 }
1202
1203 if (input < bEnd) { /* some remaining input input : buffer it */
1204 XXH_memcpy(state->buffer, input, (size_t)(bEnd-input));
1205 state->bufferedSize = (XXH32_hash_t)(bEnd-input);
1206 }
1207 }
1208
1209 return XXH_OK;
1210 }
1211
1212 XXH_PUBLIC_API XXH_errorcode
1213 XXH3_64bits_update(XXH3_state_t* state, const void* input, size_t len)
1214 {
1215 return XXH3_update(state, (const xxh_u8*)input, len, XXH3_acc_64bits);
1216 }
1217
1218
1219 XXH_FORCE_INLINE void
1220 XXH3_digest_long (XXH64_hash_t* acc, const XXH3_state_t* state, XXH3_accWidth_e accWidth)
1221 {
1222 memcpy(acc, state->acc, sizeof(state->acc)); /* digest locally, state remains unaltered, and can continue ingesting more input afterwards */
1223 if (state->bufferedSize >= STRIPE_LEN) {
1224 size_t const totalNbStripes = state->bufferedSize / STRIPE_LEN;
1225 XXH32_hash_t nbStripesSoFar = state->nbStripesSoFar;
1226 XXH3_consumeStripes(acc,
1227 &nbStripesSoFar, state->nbStripesPerBlock,
1228 state->buffer, totalNbStripes,
1229 state->secret, state->secretLimit,
1230 accWidth);
1231 if (state->bufferedSize % STRIPE_LEN) { /* one last partial stripe */
1232 XXH3_accumulate_512(acc,
1233 state->buffer + state->bufferedSize - STRIPE_LEN,
1234 state->secret + state->secretLimit - XXH_SECRET_LASTACC_START,
1235 accWidth);
1236 }
1237 } else { /* bufferedSize < STRIPE_LEN */
1238 if (state->bufferedSize) { /* one last stripe */
1239 xxh_u8 lastStripe[STRIPE_LEN];
1240 size_t const catchupSize = STRIPE_LEN - state->bufferedSize;
1241 memcpy(lastStripe, state->buffer + sizeof(state->buffer) - catchupSize, catchupSize);
1242 memcpy(lastStripe + catchupSize, state->buffer, state->bufferedSize);
1243 XXH3_accumulate_512(acc,
1244 lastStripe,
1245 state->secret + state->secretLimit - XXH_SECRET_LASTACC_START,
1246 accWidth);
1247 } }
1248 }
1249
1250 XXH_PUBLIC_API XXH64_hash_t XXH3_64bits_digest (const XXH3_state_t* state)
1251 {
1252 if (state->totalLen > XXH3_MIDSIZE_MAX) {
1253 XXH_ALIGN(XXH_ACC_ALIGN) XXH64_hash_t acc[ACC_NB];
1254 XXH3_digest_long(acc, state, XXH3_acc_64bits);
1255 return XXH3_mergeAccs(acc, state->secret + XXH_SECRET_MERGEACCS_START, (xxh_u64)state->totalLen * PRIME64_1);
1256 }
1257 /* len <= XXH3_MIDSIZE_MAX : short code */
1258 if (state->seed)
1259 return XXH3_64bits_withSeed(state->buffer, (size_t)state->totalLen, state->seed);
1260 return XXH3_64bits_withSecret(state->buffer, (size_t)(state->totalLen), state->secret, state->secretLimit + STRIPE_LEN);
1261 }
1262
1263 /* ==========================================
1264 * XXH3 128 bits (=> XXH128)
1265 * ========================================== */
1266
1267 XXH_FORCE_INLINE XXH128_hash_t
1268 XXH3_len_1to3_128b(const xxh_u8* input, size_t len, const xxh_u8* secret, XXH64_hash_t seed)
1269 {
1270 XXH_ASSERT(input != NULL);
1271 XXH_ASSERT(1 <= len && len <= 3);
1272 XXH_ASSERT(secret != NULL);
1273 { xxh_u8 const c1 = input[0];
1274 xxh_u8 const c2 = input[len >> 1];
1275 xxh_u8 const c3 = input[len - 1];
1276 xxh_u32 const combinedl = ((xxh_u32)c1) + (((xxh_u32)c2) << 8) + (((xxh_u32)c3) << 16) + (((xxh_u32)len) << 24);
1277 xxh_u32 const combinedh = XXH_swap32(combinedl);
1278 xxh_u64 const keyed_lo = (xxh_u64)combinedl ^ (XXH_readLE32(secret) + seed);
1279 xxh_u64 const keyed_hi = (xxh_u64)combinedh ^ (XXH_readLE32(secret+4) - seed);
1280 xxh_u64 const mixedl = keyed_lo * PRIME64_1;
1281 xxh_u64 const mixedh = keyed_hi * PRIME64_5;
1282 XXH128_hash_t const h128 = { XXH3_avalanche(mixedl) /*low64*/, XXH3_avalanche(mixedh) /*high64*/ };
1283 return h128;
1284 }
1285 }
1286
1287
1288 XXH_FORCE_INLINE XXH128_hash_t
1289 XXH3_len_4to8_128b(const xxh_u8* input, size_t len, const xxh_u8* secret, XXH64_hash_t seed)
1290 {
1291 XXH_ASSERT(input != NULL);
1292 XXH_ASSERT(secret != NULL);
1293 XXH_ASSERT(4 <= len && len <= 8);
1294 { xxh_u32 const input_lo = XXH_readLE32(input);
1295 xxh_u32 const input_hi = XXH_readLE32(input + len - 4);
1296 xxh_u64 const input_64_lo = input_lo + ((xxh_u64)input_hi << 32);
1297 xxh_u64 const input_64_hi = XXH_swap64(input_64_lo);
1298 xxh_u64 const keyed_lo = input_64_lo ^ (XXH_readLE64(secret) + seed);
1299 xxh_u64 const keyed_hi = input_64_hi ^ (XXH_readLE64(secret + 8) - seed);
1300 xxh_u64 const mix64l1 = len + ((keyed_lo ^ (keyed_lo >> 51)) * PRIME32_1);
1301 xxh_u64 const mix64l2 = (mix64l1 ^ (mix64l1 >> 47)) * PRIME64_2;
1302 xxh_u64 const mix64h1 = ((keyed_hi ^ (keyed_hi >> 47)) * PRIME64_1) - len;
1303 xxh_u64 const mix64h2 = (mix64h1 ^ (mix64h1 >> 43)) * PRIME64_4;
1304 { XXH128_hash_t const h128 = { XXH3_avalanche(mix64l2) /*low64*/, XXH3_avalanche(mix64h2) /*high64*/ };
1305 return h128;
1306 } }
1307 }
1308
1309 XXH_FORCE_INLINE XXH128_hash_t
1310 XXH3_len_9to16_128b(const xxh_u8* input, size_t len, const xxh_u8* secret, XXH64_hash_t seed)
1311 {
1312 XXH_ASSERT(input != NULL);
1313 XXH_ASSERT(secret != NULL);
1314 XXH_ASSERT(9 <= len && len <= 16);
1315 { xxh_u64 const input_lo = XXH_readLE64(input) ^ (XXH_readLE64(secret) + seed);
1316 xxh_u64 const input_hi = XXH_readLE64(input + len - 8) ^ (XXH_readLE64(secret+8) - seed);
1317 XXH128_hash_t m128 = XXH_mult64to128(input_lo ^ input_hi, PRIME64_1);
1318 xxh_u64 const lenContrib = XXH_mult32to64(len, PRIME32_5);
1319 m128.low64 += lenContrib;
1320 m128.high64 += input_hi * PRIME64_1;
1321 m128.low64 ^= (m128.high64 >> 32);
1322 { XXH128_hash_t h128 = XXH_mult64to128(m128.low64, PRIME64_2);
1323 h128.high64 += m128.high64 * PRIME64_2;
1324 h128.low64 = XXH3_avalanche(h128.low64);
1325 h128.high64 = XXH3_avalanche(h128.high64);
1326 return h128;
1327 } }
1328 }
1329
1330 /* Assumption : `secret` size is >= 16
1331 * Note : it should be >= XXH3_SECRET_SIZE_MIN anyway */
1332 XXH_FORCE_INLINE XXH128_hash_t
1333 XXH3_len_0to16_128b(const xxh_u8* input, size_t len, const xxh_u8* secret, XXH64_hash_t seed)
1334 {
1335 XXH_ASSERT(len <= 16);
1336 { if (len > 8) return XXH3_len_9to16_128b(input, len, secret, seed);
1337 if (len >= 4) return XXH3_len_4to8_128b(input, len, secret, seed);
1338 if (len) return XXH3_len_1to3_128b(input, len, secret, seed);
1339 { XXH128_hash_t const h128 = { 0, 0 };
1340 return h128;
1341 } }
1342 }
1343
1344 XXH_FORCE_INLINE XXH128_hash_t
1345 XXH3_hashLong_128b_internal(const xxh_u8* XXH_RESTRICT input, size_t len,
1346 const xxh_u8* XXH_RESTRICT secret, size_t secretSize)
1347 {
1348 XXH_ALIGN(XXH_ACC_ALIGN) xxh_u64 acc[ACC_NB] = XXH3_INIT_ACC;
1349
1350 XXH3_hashLong_internal_loop(acc, input, len, secret, secretSize, XXH3_acc_128bits);
1351
1352 /* converge into final hash */
1353 XXH_STATIC_ASSERT(sizeof(acc) == 64);
1354 XXH_ASSERT(secretSize >= sizeof(acc) + XXH_SECRET_MERGEACCS_START);
1355 { xxh_u64 const low64 = XXH3_mergeAccs(acc, secret + XXH_SECRET_MERGEACCS_START, (xxh_u64)len * PRIME64_1);
1356 xxh_u64 const high64 = XXH3_mergeAccs(acc, secret + secretSize - sizeof(acc) - XXH_SECRET_MERGEACCS_START, ~((xxh_u64)len * PRIME64_2));
1357 XXH128_hash_t const h128 = { low64, high64 };
1358 return h128;
1359 }
1360 }
1361
1362 XXH_NO_INLINE XXH128_hash_t /* It's important for performance that XXH3_hashLong is not inlined. Not sure why (uop cache maybe ?), but difference is large and easily measurable */
1363 XXH3_hashLong_128b_defaultSecret(const xxh_u8* input, size_t len)
1364 {
1365 return XXH3_hashLong_128b_internal(input, len, kSecret, sizeof(kSecret));
1366 }
1367
1368 XXH_NO_INLINE XXH128_hash_t /* It's important for performance that XXH3_hashLong is not inlined. Not sure why (uop cache maybe ?), but difference is large and easily measurable */
1369 XXH3_hashLong_128b_withSecret(const xxh_u8* input, size_t len,
1370 const xxh_u8* secret, size_t secretSize)
1371 {
1372 return XXH3_hashLong_128b_internal(input, len, secret, secretSize);
1373 }
1374
1375 XXH_NO_INLINE XXH128_hash_t /* It's important for performance that XXH3_hashLong is not inlined. Not sure why (uop cache maybe ?), but difference is large and easily measurable */
1376 XXH3_hashLong_128b_withSeed(const xxh_u8* input, size_t len, XXH64_hash_t seed)
1377 {
1378 XXH_ALIGN(8) xxh_u8 secret[XXH_SECRET_DEFAULT_SIZE];
1379 if (seed == 0) return XXH3_hashLong_128b_defaultSecret(input, len);
1380 XXH3_initCustomSecret(secret, seed);
1381 return XXH3_hashLong_128b_internal(input, len, secret, sizeof(secret));
1382 }
1383
1384
1385 XXH_FORCE_INLINE XXH128_hash_t
1386 XXH128_mix32B(XXH128_hash_t acc, const xxh_u8* input_1, const xxh_u8* input_2, const xxh_u8* secret, XXH64_hash_t seed)
1387 {
1388 acc.low64 += XXH3_mix16B (input_1, secret+0, seed);
1389 acc.low64 ^= XXH_readLE64(input_2) + XXH_readLE64(input_2 + 8);
1390 acc.high64 += XXH3_mix16B (input_2, secret+16, seed);
1391 acc.high64 ^= XXH_readLE64(input_1) + XXH_readLE64(input_1 + 8);
1392 return acc;
1393 }
1394
1395 XXH_NO_INLINE XXH128_hash_t
1396 XXH3_len_129to240_128b(const xxh_u8* XXH_RESTRICT input, size_t len,
1397 const xxh_u8* XXH_RESTRICT secret, size_t secretSize,
1398 XXH64_hash_t seed)
1399 {
1400 XXH_ASSERT(secretSize >= XXH3_SECRET_SIZE_MIN); (void)secretSize;
1401 XXH_ASSERT(128 < len && len <= XXH3_MIDSIZE_MAX);
1402
1403 { XXH128_hash_t acc;
1404 int const nbRounds = (int)len / 32;
1405 int i;
1406 acc.low64 = len * PRIME64_1;
1407 acc.high64 = 0;
1408 for (i=0; i<4; i++) {
1409 acc = XXH128_mix32B(acc, input+(32*i), input+(32*i)+16, secret+(32*i), seed);
1410 }
1411 acc.low64 = XXH3_avalanche(acc.low64);
1412 acc.high64 = XXH3_avalanche(acc.high64);
1413 XXH_ASSERT(nbRounds >= 4);
1414 for (i=4 ; i < nbRounds; i++) {
1415 acc = XXH128_mix32B(acc, input+(32*i), input+(32*i)+16, secret+XXH3_MIDSIZE_STARTOFFSET+(32*(i-4)), seed);
1416 }
1417 /* last bytes */
1418 acc = XXH128_mix32B(acc, input + len - 16, input + len - 32, secret + XXH3_SECRET_SIZE_MIN - XXH3_MIDSIZE_LASTOFFSET - 16, 0ULL - seed);
1419
1420 { xxh_u64 const low64 = acc.low64 + acc.high64;
1421 xxh_u64 const high64 = (acc.low64 * PRIME64_1) + (acc.high64 * PRIME64_4) + ((len - seed) * PRIME64_2);
1422 XXH128_hash_t const h128 = { XXH3_avalanche(low64), (XXH64_hash_t)0 - XXH3_avalanche(high64) };
1423 return h128;
1424 }
1425 }
1426 }
1427
1428
1429 XXH_FORCE_INLINE XXH128_hash_t
1430 XXH3_len_17to128_128b(const xxh_u8* XXH_RESTRICT input, size_t len,
1431 const xxh_u8* XXH_RESTRICT secret, size_t secretSize,
1432 XXH64_hash_t seed)
1433 {
1434 XXH_ASSERT(secretSize >= XXH3_SECRET_SIZE_MIN); (void)secretSize;
1435 XXH_ASSERT(16 < len && len <= 128);
1436
1437 { XXH128_hash_t acc;
1438 acc.low64 = len * PRIME64_1;
1439 acc.high64 = 0;
1440 if (len > 32) {
1441 if (len > 64) {
1442 if (len > 96) {
1443 acc = XXH128_mix32B(acc, input+48, input+len-64, secret+96, seed);
1444 }
1445 acc = XXH128_mix32B(acc, input+32, input+len-48, secret+64, seed);
1446 }
1447 acc = XXH128_mix32B(acc, input+16, input+len-32, secret+32, seed);
1448 }
1449 acc = XXH128_mix32B(acc, input, input+len-16, secret, seed);
1450 { xxh_u64 const low64 = acc.low64 + acc.high64;
1451 xxh_u64 const high64 = (acc.low64 * PRIME64_1) + (acc.high64 * PRIME64_4) + ((len - seed) * PRIME64_2);
1452 XXH128_hash_t const h128 = { XXH3_avalanche(low64), (XXH64_hash_t)0 - XXH3_avalanche(high64) };
1453 return h128;
1454 }
1455 }
1456 }
1457
1458 XXH_PUBLIC_API XXH128_hash_t XXH3_128bits(const void* input, size_t len)
1459 {
1460 if (len <= 16) return XXH3_len_0to16_128b((const xxh_u8*)input, len, kSecret, 0);
1461 if (len <= 128) return XXH3_len_17to128_128b((const xxh_u8*)input, len, kSecret, sizeof(kSecret), 0);
1462 if (len <= XXH3_MIDSIZE_MAX) return XXH3_len_129to240_128b((const xxh_u8*)input, len, kSecret, sizeof(kSecret), 0);
1463 return XXH3_hashLong_128b_defaultSecret((const xxh_u8*)input, len);
1464 }
1465
1466 XXH_PUBLIC_API XXH128_hash_t
1467 XXH3_128bits_withSecret(const void* input, size_t len, const void* secret, size_t secretSize)
1468 {
1469 XXH_ASSERT(secretSize >= XXH3_SECRET_SIZE_MIN);
1470 /* if an action must be taken should `secret` conditions not be respected,
1471 * it should be done here.
1472 * For now, it's a contract pre-condition.
1473 * Adding a check and a branch here would cost performance at every hash */
1474 if (len <= 16) return XXH3_len_0to16_128b((const xxh_u8*)input, len, (const xxh_u8*)secret, 0);
1475 if (len <= 128) return XXH3_len_17to128_128b((const xxh_u8*)input, len, (const xxh_u8*)secret, secretSize, 0);
1476 if (len <= XXH3_MIDSIZE_MAX) return XXH3_len_129to240_128b((const xxh_u8*)input, len, (const xxh_u8*)secret, secretSize, 0);
1477 return XXH3_hashLong_128b_withSecret((const xxh_u8*)input, len, (const xxh_u8*)secret, secretSize);
1478 }
1479
1480 XXH_PUBLIC_API XXH128_hash_t
1481 XXH3_128bits_withSeed(const void* input, size_t len, XXH64_hash_t seed)
1482 {
1483 if (len <= 16) return XXH3_len_0to16_128b((const xxh_u8*)input, len, kSecret, seed);
1484 if (len <= 128) return XXH3_len_17to128_128b((const xxh_u8*)input, len, kSecret, sizeof(kSecret), seed);
1485 if (len <= XXH3_MIDSIZE_MAX) return XXH3_len_129to240_128b((const xxh_u8*)input, len, kSecret, sizeof(kSecret), seed);
1486 return XXH3_hashLong_128b_withSeed((const xxh_u8*)input, len, seed);
1487 }
1488
1489 XXH_PUBLIC_API XXH128_hash_t
1490 XXH128(const void* input, size_t len, XXH64_hash_t seed)
1491 {
1492 return XXH3_128bits_withSeed(input, len, seed);
1493 }
1494
1495
1496 /* === XXH3 128-bit streaming === */
1497
1498 /* all the functions are actually the same as for 64-bit streaming variant,
1499 just the reset one is different (different initial acc values for 0,5,6,7),
1500 and near the end of the digest function */
1501
1502 static void
1503 XXH3_128bits_reset_internal(XXH3_state_t* statePtr,
1504 XXH64_hash_t seed,
1505 const xxh_u8* secret, size_t secretSize)
1506 {
1507 XXH3_64bits_reset_internal(statePtr, seed, secret, secretSize);
1508 }
1509
1510 XXH_PUBLIC_API XXH_errorcode
1511 XXH3_128bits_reset(XXH3_state_t* statePtr)
1512 {
1513 if (statePtr == NULL) return XXH_ERROR;
1514 XXH3_128bits_reset_internal(statePtr, 0, kSecret, XXH_SECRET_DEFAULT_SIZE);
1515 return XXH_OK;
1516 }
1517
1518 XXH_PUBLIC_API XXH_errorcode
1519 XXH3_128bits_reset_withSecret(XXH3_state_t* statePtr, const void* secret, size_t secretSize)
1520 {
1521 if (statePtr == NULL) return XXH_ERROR;
1522 XXH3_128bits_reset_internal(statePtr, 0, (const xxh_u8*)secret, secretSize);
1523 if (secret == NULL) return XXH_ERROR;
1524 if (secretSize < XXH3_SECRET_SIZE_MIN) return XXH_ERROR;
1525 return XXH_OK;
1526 }
1527
1528 XXH_PUBLIC_API XXH_errorcode
1529 XXH3_128bits_reset_withSeed(XXH3_state_t* statePtr, XXH64_hash_t seed)
1530 {
1531 if (statePtr == NULL) return XXH_ERROR;
1532 XXH3_128bits_reset_internal(statePtr, seed, kSecret, XXH_SECRET_DEFAULT_SIZE);
1533 XXH3_initCustomSecret(statePtr->customSecret, seed);
1534 statePtr->secret = statePtr->customSecret;
1535 return XXH_OK;
1536 }
1537
1538 XXH_PUBLIC_API XXH_errorcode
1539 XXH3_128bits_update(XXH3_state_t* state, const void* input, size_t len)
1540 {
1541 return XXH3_update(state, (const xxh_u8*)input, len, XXH3_acc_128bits);
1542 }
1543
1544 XXH_PUBLIC_API XXH128_hash_t XXH3_128bits_digest (const XXH3_state_t* state)
1545 {
1546 if (state->totalLen > XXH3_MIDSIZE_MAX) {
1547 XXH_ALIGN(XXH_ACC_ALIGN) XXH64_hash_t acc[ACC_NB];
1548 XXH3_digest_long(acc, state, XXH3_acc_128bits);
1549 XXH_ASSERT(state->secretLimit + STRIPE_LEN >= sizeof(acc) + XXH_SECRET_MERGEACCS_START);
1550 { xxh_u64 const low64 = XXH3_mergeAccs(acc, state->secret + XXH_SECRET_MERGEACCS_START, (xxh_u64)state->totalLen * PRIME64_1);
1551 xxh_u64 const high64 = XXH3_mergeAccs(acc, state->secret + state->secretLimit + STRIPE_LEN - sizeof(acc) - XXH_SECRET_MERGEACCS_START, ~((xxh_u64)state->totalLen * PRIME64_2));
1552 XXH128_hash_t const h128 = { low64, high64 };
1553 return h128;
1554 }
1555 }
1556 /* len <= XXH3_MIDSIZE_MAX : short code */
1557 if (state->seed)
1558 return XXH3_128bits_withSeed(state->buffer, (size_t)state->totalLen, state->seed);
1559 return XXH3_128bits_withSecret(state->buffer, (size_t)(state->totalLen), state->secret, state->secretLimit + STRIPE_LEN);
1560 }
1561
1562 /* 128-bit utility functions */
1563
1564 #include <string.h> /* memcmp */
1565
1566 /* return : 1 is equal, 0 if different */
1567 XXH_PUBLIC_API int XXH128_isEqual(XXH128_hash_t h1, XXH128_hash_t h2)
1568 {
1569 /* note : XXH128_hash_t is compact, it has no padding byte */
1570 return !(memcmp(&h1, &h2, sizeof(h1)));
1571 }
1572
1573 /* This prototype is compatible with stdlib's qsort().
1574 * return : >0 if *h128_1 > *h128_2
1575 * <0 if *h128_1 < *h128_2
1576 * =0 if *h128_1 == *h128_2 */
1577 XXH_PUBLIC_API int XXH128_cmp(const void* h128_1, const void* h128_2)
1578 {
1579 XXH128_hash_t const h1 = *(const XXH128_hash_t*)h128_1;
1580 XXH128_hash_t const h2 = *(const XXH128_hash_t*)h128_2;
1581 int const hcmp = (h1.high64 > h2.high64) - (h2.high64 > h1.high64);
1582 /* note : bets that, in most cases, hash values are different */
1583 if (hcmp) return hcmp;
1584 return (h1.low64 > h2.low64) - (h2.low64 > h1.low64);
1585 }
1586
1587
1588 /*====== Canonical representation ======*/
1589 XXH_PUBLIC_API void
1590 XXH128_canonicalFromHash(XXH128_canonical_t* dst, XXH128_hash_t hash)
1591 {
1592 XXH_STATIC_ASSERT(sizeof(XXH128_canonical_t) == sizeof(XXH128_hash_t));
1593 if (XXH_CPU_LITTLE_ENDIAN) {
1594 hash.high64 = XXH_swap64(hash.high64);
1595 hash.low64 = XXH_swap64(hash.low64);
1596 }
1597 memcpy(dst, &hash.high64, sizeof(hash.high64));
1598 memcpy((char*)dst + sizeof(hash.high64), &hash.low64, sizeof(hash.low64));
1599 }
1600
1601 XXH_PUBLIC_API XXH128_hash_t
1602 XXH128_hashFromCanonical(const XXH128_canonical_t* src)
1603 {
1604 XXH128_hash_t h;
1605 h.high64 = XXH_readBE64(src);
1606 h.low64 = XXH_readBE64(src->digest + 8);
1607 return h;
1608 }
1609
1610
1611
1612 #endif /* XXH3_H */
3232 */
3333
3434
35 /* since xxhash.c can be included (via XXH_INLINE_ALL),
36 * it's good practice to protect it with guard
37 * in case of multiples inclusions */
38 #ifndef XXHASH_C_01393879
39 #define XXHASH_C_01393879
40
3541 /* *************************************
3642 * Tuning parameters
3743 ***************************************/
4955 * Prefer these methods in priority order (0 > 1 > 2)
5056 */
5157 #ifndef XXH_FORCE_MEMORY_ACCESS /* can be defined externally, on command line for example */
52 # if defined(__GNUC__) && ( defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) \
53 || defined(__ARM_ARCH_6K__) || defined(__ARM_ARCH_6Z__) \
54 || defined(__ARM_ARCH_6ZK__) || defined(__ARM_ARCH_6T2__) )
58 # if !defined(__clang__) && defined(__GNUC__) && defined(__ARM_FEATURE_UNALIGNED) && defined(__ARM_ARCH) && (__ARM_ARCH == 6)
5559 # define XXH_FORCE_MEMORY_ACCESS 2
56 # elif (defined(__INTEL_COMPILER) && !defined(_WIN32)) || \
57 (defined(__GNUC__) && ( defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) \
58 || defined(__ARM_ARCH_7R__) || defined(__ARM_ARCH_7M__) \
59 || defined(__ARM_ARCH_7S__) ))
60 # elif !defined(__clang__) && ((defined(__INTEL_COMPILER) && !defined(_WIN32)) || \
61 (defined(__GNUC__) && (defined(__ARM_ARCH) && __ARM_ARCH >= 7)))
6062 # define XXH_FORCE_MEMORY_ACCESS 1
6163 # endif
6264 #endif
8587 # endif
8688 #endif
8789
90 /*!XXH_REROLL:
91 * Whether to reroll XXH32_finalize, and XXH64_finalize,
92 * instead of using an unrolled jump table/if statement loop.
93 *
94 * This is automatically defined on -Os/-Oz on GCC and Clang. */
95 #ifndef XXH_REROLL
96 # if defined(__OPTIMIZE_SIZE__)
97 # define XXH_REROLL 1
98 # else
99 # define XXH_REROLL 0
100 # endif
101 #endif
88102
89103 /* *************************************
90104 * Includes & Memory related functions
98112 #include <string.h>
99113 static void* XXH_memcpy(void* dest, const void* src, size_t size) { return memcpy(dest,src,size); }
100114
101 #include <assert.h> /* assert */
115 #include <limits.h> /* ULLONG_MAX */
102116
103117 #define XXH_STATIC_LINKING_ONLY
104118 #include "xxhash.h"
110124 #ifdef _MSC_VER /* Visual Studio */
111125 # pragma warning(disable : 4127) /* disable: C4127: conditional expression is constant */
112126 # define XXH_FORCE_INLINE static __forceinline
127 # define XXH_NO_INLINE static __declspec(noinline)
113128 #else
114129 # if defined (__cplusplus) || defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* C99 */
115130 # ifdef __GNUC__
116131 # define XXH_FORCE_INLINE static inline __attribute__((always_inline))
132 # define XXH_NO_INLINE static __attribute__((noinline))
117133 # else
118134 # define XXH_FORCE_INLINE static inline
135 # define XXH_NO_INLINE static
119136 # endif
120137 # else
121138 # define XXH_FORCE_INLINE static
139 # define XXH_NO_INLINE static
122140 # endif /* __STDC_VERSION__ */
123141 #endif
142
143
144
145 /* *************************************
146 * Debug
147 ***************************************/
148 /* DEBUGLEVEL is expected to be defined externally,
149 * typically through compiler command line.
150 * Value must be a number. */
151 #ifndef DEBUGLEVEL
152 # define DEBUGLEVEL 0
153 #endif
154
155 #if (DEBUGLEVEL>=1)
156 # include <assert.h> /* note : can still be disabled with NDEBUG */
157 # define XXH_ASSERT(c) assert(c)
158 #else
159 # define XXH_ASSERT(c) ((void)0)
160 #endif
161
162 /* note : use after variable declarations */
163 #define XXH_STATIC_ASSERT(c) { enum { XXH_sa = 1/(int)(!!(c)) }; }
124164
125165
126166 /* *************************************
127167 * Basic Types
128168 ***************************************/
129 #ifndef MEM_MODULE
130 # if !defined (__VMS) \
131 && (defined (__cplusplus) \
132 || (defined (__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) /* C99 */) )
133 # include <stdint.h>
134 typedef uint8_t BYTE;
135 typedef uint16_t U16;
136 typedef uint32_t U32;
137 # else
138 typedef unsigned char BYTE;
139 typedef unsigned short U16;
140 typedef unsigned int U32;
141 # endif
142 #endif
169 #if !defined (__VMS) \
170 && (defined (__cplusplus) \
171 || (defined (__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) /* C99 */) )
172 # include <stdint.h>
173 typedef uint8_t xxh_u8;
174 #else
175 typedef unsigned char xxh_u8;
176 #endif
177 typedef XXH32_hash_t xxh_u32;
143178
144179
145180 /* === Memory access === */
147182 #if (defined(XXH_FORCE_MEMORY_ACCESS) && (XXH_FORCE_MEMORY_ACCESS==2))
148183
149184 /* Force direct memory access. Only works on CPU which support unaligned memory access in hardware */
150 static U32 XXH_read32(const void* memPtr) { return *(const U32*) memPtr; }
185 static xxh_u32 XXH_read32(const void* memPtr) { return *(const xxh_u32*) memPtr; }
151186
152187 #elif (defined(XXH_FORCE_MEMORY_ACCESS) && (XXH_FORCE_MEMORY_ACCESS==1))
153188
154189 /* __pack instructions are safer, but compiler specific, hence potentially problematic for some compilers */
155190 /* currently only defined for gcc and icc */
156 typedef union { U32 u32; } __attribute__((packed)) unalign;
157 static U32 XXH_read32(const void* ptr) { return ((const unalign*)ptr)->u32; }
191 typedef union { xxh_u32 u32; } __attribute__((packed)) unalign;
192 static xxh_u32 XXH_read32(const void* ptr) { return ((const unalign*)ptr)->u32; }
158193
159194 #else
160195
161196 /* portable and safe solution. Generally efficient.
162197 * see : http://stackoverflow.com/a/32095106/646947
163198 */
164 static U32 XXH_read32(const void* memPtr)
165 {
166 U32 val;
199 static xxh_u32 XXH_read32(const void* memPtr)
200 {
201 xxh_u32 val;
167202 memcpy(&val, memPtr, sizeof(val));
168203 return val;
169204 }
176211
177212 /* XXH_CPU_LITTLE_ENDIAN can be defined externally, for example on the compiler command line */
178213 #ifndef XXH_CPU_LITTLE_ENDIAN
214 # if defined(_WIN32) /* Windows is always little endian */ \
215 || defined(__LITTLE_ENDIAN__) \
216 || (defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
217 # define XXH_CPU_LITTLE_ENDIAN 1
218 # elif defined(__BIG_ENDIAN__) \
219 || (defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)
220 # define XXH_CPU_LITTLE_ENDIAN 0
221 # else
179222 static int XXH_isLittleEndian(void)
180223 {
181 const union { U32 u; BYTE c[4]; } one = { 1 }; /* don't use static : performance detrimental */
224 const union { xxh_u32 u; xxh_u8 c[4]; } one = { 1 }; /* don't use static : performance detrimental */
182225 return one.c[0];
183226 }
184227 # define XXH_CPU_LITTLE_ENDIAN XXH_isLittleEndian()
228 # endif
185229 #endif
186230
187231
192236 ******************************************/
193237 #define XXH_GCC_VERSION (__GNUC__ * 100 + __GNUC_MINOR__)
194238
239 #ifndef __has_builtin
240 # define __has_builtin(x) 0
241 #endif
242
243 #if !defined(NO_CLANG_BUILTIN) && __has_builtin(__builtin_rotateleft32) && __has_builtin(__builtin_rotateleft64)
244 # define XXH_rotl32 __builtin_rotateleft32
245 # define XXH_rotl64 __builtin_rotateleft64
195246 /* Note : although _rotl exists for minGW (GCC under windows), performance seems poor */
196 #if defined(_MSC_VER)
247 #elif defined(_MSC_VER)
197248 # define XXH_rotl32(x,r) _rotl(x,r)
198249 # define XXH_rotl64(x,r) _rotl64(x,r)
199250 #else
206257 #elif XXH_GCC_VERSION >= 403
207258 # define XXH_swap32 __builtin_bswap32
208259 #else
209 static U32 XXH_swap32 (U32 x)
260 static xxh_u32 XXH_swap32 (xxh_u32 x)
210261 {
211262 return ((x << 24) & 0xff000000 ) |
212263 ((x << 8) & 0x00ff0000 ) |
221272 *****************************/
222273 typedef enum { XXH_aligned, XXH_unaligned } XXH_alignment;
223274
224 XXH_FORCE_INLINE U32 XXH_readLE32(const void* ptr)
275 XXH_FORCE_INLINE xxh_u32 XXH_readLE32(const void* ptr)
225276 {
226277 return XXH_CPU_LITTLE_ENDIAN ? XXH_read32(ptr) : XXH_swap32(XXH_read32(ptr));
227278 }
228279
229 static U32 XXH_readBE32(const void* ptr)
280 static xxh_u32 XXH_readBE32(const void* ptr)
230281 {
231282 return XXH_CPU_LITTLE_ENDIAN ? XXH_swap32(XXH_read32(ptr)) : XXH_read32(ptr);
232283 }
233284
234 XXH_FORCE_INLINE U32
285 XXH_FORCE_INLINE xxh_u32
235286 XXH_readLE32_align(const void* ptr, XXH_alignment align)
236287 {
237288 if (align==XXH_unaligned) {
238289 return XXH_readLE32(ptr);
239290 } else {
240 return XXH_CPU_LITTLE_ENDIAN ? *(const U32*)ptr : XXH_swap32(*(const U32*)ptr);
291 return XXH_CPU_LITTLE_ENDIAN ? *(const xxh_u32*)ptr : XXH_swap32(*(const xxh_u32*)ptr);
241292 }
242293 }
243294
244295
245296 /* *************************************
246 * Macros
297 * Misc
247298 ***************************************/
248 #define XXH_STATIC_ASSERT(c) { enum { XXH_sa = 1/(int)(!!(c)) }; } /* use after variable declarations */
249299 XXH_PUBLIC_API unsigned XXH_versionNumber (void) { return XXH_VERSION_NUMBER; }
250300
251301
252302 /* *******************************************************************
253303 * 32-bit hash functions
254304 *********************************************************************/
255 static const U32 PRIME32_1 = 2654435761U; /* 0b10011110001101110111100110110001 */
256 static const U32 PRIME32_2 = 2246822519U; /* 0b10000101111010111100101001110111 */
257 static const U32 PRIME32_3 = 3266489917U; /* 0b11000010101100101010111000111101 */
258 static const U32 PRIME32_4 = 668265263U; /* 0b00100111110101001110101100101111 */
259 static const U32 PRIME32_5 = 374761393U; /* 0b00010110010101100110011110110001 */
260
261 static U32 XXH32_round(U32 acc, U32 input)
305 static const xxh_u32 PRIME32_1 = 0x9E3779B1U; /* 0b10011110001101110111100110110001 */
306 static const xxh_u32 PRIME32_2 = 0x85EBCA77U; /* 0b10000101111010111100101001110111 */
307 static const xxh_u32 PRIME32_3 = 0xC2B2AE3DU; /* 0b11000010101100101010111000111101 */
308 static const xxh_u32 PRIME32_4 = 0x27D4EB2FU; /* 0b00100111110101001110101100101111 */
309 static const xxh_u32 PRIME32_5 = 0x165667B1U; /* 0b00010110010101100110011110110001 */
310
311 static xxh_u32 XXH32_round(xxh_u32 acc, xxh_u32 input)
262312 {
263313 acc += input * PRIME32_2;
264314 acc = XXH_rotl32(acc, 13);
311361 }
312362
313363 /* mix all bits */
314 static U32 XXH32_avalanche(U32 h32)
364 static xxh_u32 XXH32_avalanche(xxh_u32 h32)
315365 {
316366 h32 ^= h32 >> 15;
317367 h32 *= PRIME32_2;
323373
324374 #define XXH_get32bits(p) XXH_readLE32_align(p, align)
325375
326 static U32
327 XXH32_finalize(U32 h32, const void* ptr, size_t len, XXH_alignment align)
328
329 {
330 const BYTE* p = (const BYTE*)ptr;
331
376 static xxh_u32
377 XXH32_finalize(xxh_u32 h32, const xxh_u8* ptr, size_t len, XXH_alignment align)
378 {
332379 #define PROCESS1 \
333 h32 += (*p++) * PRIME32_5; \
380 h32 += (*ptr++) * PRIME32_5; \
334381 h32 = XXH_rotl32(h32, 11) * PRIME32_1 ;
335382
336383 #define PROCESS4 \
337 h32 += XXH_get32bits(p) * PRIME32_3; \
338 p+=4; \
384 h32 += XXH_get32bits(ptr) * PRIME32_3; \
385 ptr+=4; \
339386 h32 = XXH_rotl32(h32, 17) * PRIME32_4 ;
340387
341 switch(len&15) /* or switch(bEnd - p) */
342 {
343 case 12: PROCESS4;
344 /* fallthrough */
345 case 8: PROCESS4;
346 /* fallthrough */
347 case 4: PROCESS4;
348 return XXH32_avalanche(h32);
349
350 case 13: PROCESS4;
351 /* fallthrough */
352 case 9: PROCESS4;
353 /* fallthrough */
354 case 5: PROCESS4;
355 PROCESS1;
356 return XXH32_avalanche(h32);
357
358 case 14: PROCESS4;
359 /* fallthrough */
360 case 10: PROCESS4;
361 /* fallthrough */
362 case 6: PROCESS4;
363 PROCESS1;
364 PROCESS1;
365 return XXH32_avalanche(h32);
366
367 case 15: PROCESS4;
368 /* fallthrough */
369 case 11: PROCESS4;
370 /* fallthrough */
371 case 7: PROCESS4;
372 /* fallthrough */
373 case 3: PROCESS1;
374 /* fallthrough */
375 case 2: PROCESS1;
376 /* fallthrough */
377 case 1: PROCESS1;
378 /* fallthrough */
379 case 0: return XXH32_avalanche(h32);
388 /* Compact rerolled version */
389 if (XXH_REROLL) {
390 len &= 15;
391 while (len >= 4) {
392 PROCESS4;
393 len -= 4;
394 }
395 while (len > 0) {
396 PROCESS1;
397 --len;
398 }
399 return XXH32_avalanche(h32);
400 } else {
401 switch(len&15) /* or switch(bEnd - p) */ {
402 case 12: PROCESS4;
403 /* fallthrough */
404 case 8: PROCESS4;
405 /* fallthrough */
406 case 4: PROCESS4;
407 return XXH32_avalanche(h32);
408
409 case 13: PROCESS4;
410 /* fallthrough */
411 case 9: PROCESS4;
412 /* fallthrough */
413 case 5: PROCESS4;
414 PROCESS1;
415 return XXH32_avalanche(h32);
416
417 case 14: PROCESS4;
418 /* fallthrough */
419 case 10: PROCESS4;
420 /* fallthrough */
421 case 6: PROCESS4;
422 PROCESS1;
423 PROCESS1;
424 return XXH32_avalanche(h32);
425
426 case 15: PROCESS4;
427 /* fallthrough */
428 case 11: PROCESS4;
429 /* fallthrough */
430 case 7: PROCESS4;
431 /* fallthrough */
432 case 3: PROCESS1;
433 /* fallthrough */
434 case 2: PROCESS1;
435 /* fallthrough */
436 case 1: PROCESS1;
437 /* fallthrough */
438 case 0: return XXH32_avalanche(h32);
439 }
440 XXH_ASSERT(0);
441 return h32; /* reaching this point is deemed impossible */
380442 }
381 assert(0);
382 return h32; /* reaching this point is deemed impossible */
383 }
384
385 XXH_FORCE_INLINE U32
386 XXH32_endian_align(const void* input, size_t len, U32 seed, XXH_alignment align)
387 {
388 const BYTE* p = (const BYTE*)input;
389 const BYTE* bEnd = p + len;
390 U32 h32;
443 }
444
445 XXH_FORCE_INLINE xxh_u32
446 XXH32_endian_align(const xxh_u8* input, size_t len, xxh_u32 seed, XXH_alignment align)
447 {
448 const xxh_u8* bEnd = input + len;
449 xxh_u32 h32;
391450
392451 #if defined(XXH_ACCEPT_NULL_INPUT_POINTER) && (XXH_ACCEPT_NULL_INPUT_POINTER>=1)
393 if (p==NULL) {
452 if (input==NULL) {
394453 len=0;
395 bEnd=p=(const BYTE*)(size_t)16;
454 bEnd=input=(const xxh_u8*)(size_t)16;
396455 }
397456 #endif
398457
399458 if (len>=16) {
400 const BYTE* const limit = bEnd - 15;
401 U32 v1 = seed + PRIME32_1 + PRIME32_2;
402 U32 v2 = seed + PRIME32_2;
403 U32 v3 = seed + 0;
404 U32 v4 = seed - PRIME32_1;
459 const xxh_u8* const limit = bEnd - 15;
460 xxh_u32 v1 = seed + PRIME32_1 + PRIME32_2;
461 xxh_u32 v2 = seed + PRIME32_2;
462 xxh_u32 v3 = seed + 0;
463 xxh_u32 v4 = seed - PRIME32_1;
405464
406465 do {
407 v1 = XXH32_round(v1, XXH_get32bits(p)); p+=4;
408 v2 = XXH32_round(v2, XXH_get32bits(p)); p+=4;
409 v3 = XXH32_round(v3, XXH_get32bits(p)); p+=4;
410 v4 = XXH32_round(v4, XXH_get32bits(p)); p+=4;
411 } while (p < limit);
466 v1 = XXH32_round(v1, XXH_get32bits(input)); input += 4;
467 v2 = XXH32_round(v2, XXH_get32bits(input)); input += 4;
468 v3 = XXH32_round(v3, XXH_get32bits(input)); input += 4;
469 v4 = XXH32_round(v4, XXH_get32bits(input)); input += 4;
470 } while (input < limit);
412471
413472 h32 = XXH_rotl32(v1, 1) + XXH_rotl32(v2, 7)
414473 + XXH_rotl32(v3, 12) + XXH_rotl32(v4, 18);
416475 h32 = seed + PRIME32_5;
417476 }
418477
419 h32 += (U32)len;
420
421 return XXH32_finalize(h32, p, len&15, align);
422 }
423
424
425 XXH_PUBLIC_API unsigned int XXH32 (const void* input, size_t len, unsigned int seed)
478 h32 += (xxh_u32)len;
479
480 return XXH32_finalize(h32, input, len&15, align);
481 }
482
483
484 XXH_PUBLIC_API XXH32_hash_t XXH32 (const void* input, size_t len, XXH32_hash_t seed)
426485 {
427486 #if 0
428487 /* Simple version, good for code maintenance, but unfortunately slow for small inputs */
429488 XXH32_state_t state;
430489 XXH32_reset(&state, seed);
431 XXH32_update(&state, input, len);
490 XXH32_update(&state, (const xxh_u8*)input, len);
432491 return XXH32_digest(&state);
433492
434493 #else
435494
436495 if (XXH_FORCE_ALIGN_CHECK) {
437496 if ((((size_t)input) & 3) == 0) { /* Input is 4-bytes aligned, leverage the speed benefit */
438 return XXH32_endian_align(input, len, seed, XXH_aligned);
497 return XXH32_endian_align((const xxh_u8*)input, len, seed, XXH_aligned);
439498 } }
440499
441 return XXH32_endian_align(input, len, seed, XXH_unaligned);
500 return XXH32_endian_align((const xxh_u8*)input, len, seed, XXH_unaligned);
442501 #endif
443502 }
444503
461520 memcpy(dstState, srcState, sizeof(*dstState));
462521 }
463522
464 XXH_PUBLIC_API XXH_errorcode XXH32_reset(XXH32_state_t* statePtr, unsigned int seed)
523 XXH_PUBLIC_API XXH_errorcode XXH32_reset(XXH32_state_t* statePtr, XXH32_hash_t seed)
465524 {
466525 XXH32_state_t state; /* using a local state to memcpy() in order to avoid strict-aliasing warnings */
467526 memset(&state, 0, sizeof(state));
485544 return XXH_ERROR;
486545 #endif
487546
488 { const BYTE* p = (const BYTE*)input;
489 const BYTE* const bEnd = p + len;
547 { const xxh_u8* p = (const xxh_u8*)input;
548 const xxh_u8* const bEnd = p + len;
490549
491550 state->total_len_32 += (XXH32_hash_t)len;
492551 state->large_len |= (XXH32_hash_t)((len>=16) | (state->total_len_32>=16));
493552
494553 if (state->memsize + len < 16) { /* fill in tmp buffer */
495 XXH_memcpy((BYTE*)(state->mem32) + state->memsize, input, len);
554 XXH_memcpy((xxh_u8*)(state->mem32) + state->memsize, input, len);
496555 state->memsize += (XXH32_hash_t)len;
497556 return XXH_OK;
498557 }
499558
500559 if (state->memsize) { /* some data left from previous update */
501 XXH_memcpy((BYTE*)(state->mem32) + state->memsize, input, 16-state->memsize);
502 { const U32* p32 = state->mem32;
560 XXH_memcpy((xxh_u8*)(state->mem32) + state->memsize, input, 16-state->memsize);
561 { const xxh_u32* p32 = state->mem32;
503562 state->v1 = XXH32_round(state->v1, XXH_readLE32(p32)); p32++;
504563 state->v2 = XXH32_round(state->v2, XXH_readLE32(p32)); p32++;
505564 state->v3 = XXH32_round(state->v3, XXH_readLE32(p32)); p32++;
510569 }
511570
512571 if (p <= bEnd-16) {
513 const BYTE* const limit = bEnd - 16;
514 U32 v1 = state->v1;
515 U32 v2 = state->v2;
516 U32 v3 = state->v3;
517 U32 v4 = state->v4;
572 const xxh_u8* const limit = bEnd - 16;
573 xxh_u32 v1 = state->v1;
574 xxh_u32 v2 = state->v2;
575 xxh_u32 v3 = state->v3;
576 xxh_u32 v4 = state->v4;
518577
519578 do {
520579 v1 = XXH32_round(v1, XXH_readLE32(p)); p+=4;
539598 }
540599
541600
542 XXH_PUBLIC_API unsigned int XXH32_digest (const XXH32_state_t* state)
543 {
544 U32 h32;
601 XXH_PUBLIC_API XXH32_hash_t XXH32_digest (const XXH32_state_t* state)
602 {
603 xxh_u32 h32;
545604
546605 if (state->large_len) {
547606 h32 = XXH_rotl32(state->v1, 1)
554613
555614 h32 += state->total_len_32;
556615
557 return XXH32_finalize(h32, state->mem32, state->memsize, XXH_aligned);
616 return XXH32_finalize(h32, (const xxh_u8*)state->mem32, state->memsize, XXH_aligned);
558617 }
559618
560619
587646
588647 /*====== Memory access ======*/
589648
590 #ifndef MEM_MODULE
591 # define MEM_MODULE
592 # if !defined (__VMS) \
593 && (defined (__cplusplus) \
594 || (defined (__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) /* C99 */) )
595 # include <stdint.h>
596 typedef uint64_t U64;
597 # else
598 /* if compiler doesn't support unsigned long long, replace by another 64-bit type */
599 typedef unsigned long long U64;
600 # endif
601 #endif
602
649 typedef XXH64_hash_t xxh_u64;
650
651
652 /*! XXH_REROLL_XXH64:
653 * Whether to reroll the XXH64_finalize() loop.
654 *
655 * Just like XXH32, we can unroll the XXH64_finalize() loop. This can be a performance gain
656 * on 64-bit hosts, as only one jump is required.
657 *
658 * However, on 32-bit hosts, because arithmetic needs to be done with two 32-bit registers,
659 * and 64-bit arithmetic needs to be simulated, it isn't beneficial to unroll. The code becomes
660 * ridiculously large (the largest function in the binary on i386!), and rerolling it saves
661 * anywhere from 3kB to 20kB. It is also slightly faster because it fits into cache better
662 * and is more likely to be inlined by the compiler.
663 *
664 * If XXH_REROLL is defined, this is ignored and the loop is always rerolled. */
665 #ifndef XXH_REROLL_XXH64
666 # if (defined(__ILP32__) || defined(_ILP32)) /* ILP32 is often defined on 32-bit GCC family */ \
667 || !(defined(__x86_64__) || defined(_M_X64) || defined(_M_AMD64) /* x86-64 */ \
668 || defined(_M_ARM64) || defined(__aarch64__) || defined(__arm64__) /* aarch64 */ \
669 || defined(__PPC64__) || defined(__PPC64LE__) || defined(__ppc64__) || defined(__powerpc64__) /* ppc64 */ \
670 || defined(__mips64__) || defined(__mips64)) /* mips64 */ \
671 || (!defined(SIZE_MAX) || SIZE_MAX < ULLONG_MAX) /* check limits */
672 # define XXH_REROLL_XXH64 1
673 # else
674 # define XXH_REROLL_XXH64 0
675 # endif
676 #endif /* !defined(XXH_REROLL_XXH64) */
603677
604678 #if (defined(XXH_FORCE_MEMORY_ACCESS) && (XXH_FORCE_MEMORY_ACCESS==2))
605679
606680 /* Force direct memory access. Only works on CPU which support unaligned memory access in hardware */
607 static U64 XXH_read64(const void* memPtr) { return *(const U64*) memPtr; }
681 static xxh_u64 XXH_read64(const void* memPtr) { return *(const xxh_u64*) memPtr; }
608682
609683 #elif (defined(XXH_FORCE_MEMORY_ACCESS) && (XXH_FORCE_MEMORY_ACCESS==1))
610684
611685 /* __pack instructions are safer, but compiler specific, hence potentially problematic for some compilers */
612686 /* currently only defined for gcc and icc */
613 typedef union { U32 u32; U64 u64; } __attribute__((packed)) unalign64;
614 static U64 XXH_read64(const void* ptr) { return ((const unalign64*)ptr)->u64; }
687 typedef union { xxh_u32 u32; xxh_u64 u64; } __attribute__((packed)) unalign64;
688 static xxh_u64 XXH_read64(const void* ptr) { return ((const unalign64*)ptr)->u64; }
615689
616690 #else
617691
619693 * see : http://stackoverflow.com/a/32095106/646947
620694 */
621695
622 static U64 XXH_read64(const void* memPtr)
623 {
624 U64 val;
696 static xxh_u64 XXH_read64(const void* memPtr)
697 {
698 xxh_u64 val;
625699 memcpy(&val, memPtr, sizeof(val));
626700 return val;
627701 }
633707 #elif XXH_GCC_VERSION >= 403
634708 # define XXH_swap64 __builtin_bswap64
635709 #else
636 static U64 XXH_swap64 (U64 x)
710 static xxh_u64 XXH_swap64 (xxh_u64 x)
637711 {
638712 return ((x << 56) & 0xff00000000000000ULL) |
639713 ((x << 40) & 0x00ff000000000000ULL) |
646720 }
647721 #endif
648722
649 XXH_FORCE_INLINE U64 XXH_readLE64(const void* ptr)
723 XXH_FORCE_INLINE xxh_u64 XXH_readLE64(const void* ptr)
650724 {
651725 return XXH_CPU_LITTLE_ENDIAN ? XXH_read64(ptr) : XXH_swap64(XXH_read64(ptr));
652726 }
653727
654 static U64 XXH_readBE64(const void* ptr)
728 static xxh_u64 XXH_readBE64(const void* ptr)
655729 {
656730 return XXH_CPU_LITTLE_ENDIAN ? XXH_swap64(XXH_read64(ptr)) : XXH_read64(ptr);
657731 }
658732
659 XXH_FORCE_INLINE U64
733 XXH_FORCE_INLINE xxh_u64
660734 XXH_readLE64_align(const void* ptr, XXH_alignment align)
661735 {
662736 if (align==XXH_unaligned)
663737 return XXH_readLE64(ptr);
664738 else
665 return XXH_CPU_LITTLE_ENDIAN ? *(const U64*)ptr : XXH_swap64(*(const U64*)ptr);
739 return XXH_CPU_LITTLE_ENDIAN ? *(const xxh_u64*)ptr : XXH_swap64(*(const xxh_u64*)ptr);
666740 }
667741
668742
669743 /*====== xxh64 ======*/
670744
671 static const U64 PRIME64_1 = 11400714785074694791ULL; /* 0b1001111000110111011110011011000110000101111010111100101010000111 */
672 static const U64 PRIME64_2 = 14029467366897019727ULL; /* 0b1100001010110010101011100011110100100111110101001110101101001111 */
673 static const U64 PRIME64_3 = 1609587929392839161ULL; /* 0b0001011001010110011001111011000110011110001101110111100111111001 */
674 static const U64 PRIME64_4 = 9650029242287828579ULL; /* 0b1000010111101011110010100111011111000010101100101010111001100011 */
675 static const U64 PRIME64_5 = 2870177450012600261ULL; /* 0b0010011111010100111010110010111100010110010101100110011111000101 */
676
677 static U64 XXH64_round(U64 acc, U64 input)
745 static const xxh_u64 PRIME64_1 = 0x9E3779B185EBCA87ULL; /* 0b1001111000110111011110011011000110000101111010111100101010000111 */
746 static const xxh_u64 PRIME64_2 = 0xC2B2AE3D27D4EB4FULL; /* 0b1100001010110010101011100011110100100111110101001110101101001111 */
747 static const xxh_u64 PRIME64_3 = 0x165667B19E3779F9ULL; /* 0b0001011001010110011001111011000110011110001101110111100111111001 */
748 static const xxh_u64 PRIME64_4 = 0x85EBCA77C2B2AE63ULL; /* 0b1000010111101011110010100111011111000010101100101010111001100011 */
749 static const xxh_u64 PRIME64_5 = 0x27D4EB2F165667C5ULL; /* 0b0010011111010100111010110010111100010110010101100110011111000101 */
750
751 static xxh_u64 XXH64_round(xxh_u64 acc, xxh_u64 input)
678752 {
679753 acc += input * PRIME64_2;
680754 acc = XXH_rotl64(acc, 31);
682756 return acc;
683757 }
684758
685 static U64 XXH64_mergeRound(U64 acc, U64 val)
759 static xxh_u64 XXH64_mergeRound(xxh_u64 acc, xxh_u64 val)
686760 {
687761 val = XXH64_round(0, val);
688762 acc ^= val;
690764 return acc;
691765 }
692766
693 static U64 XXH64_avalanche(U64 h64)
767 static xxh_u64 XXH64_avalanche(xxh_u64 h64)
694768 {
695769 h64 ^= h64 >> 33;
696770 h64 *= PRIME64_2;
703777
704778 #define XXH_get64bits(p) XXH_readLE64_align(p, align)
705779
706 static U64
707 XXH64_finalize(U64 h64, const void* ptr, size_t len, XXH_alignment align)
708 {
709 const BYTE* p = (const BYTE*)ptr;
710
780 static xxh_u64
781 XXH64_finalize(xxh_u64 h64, const xxh_u8* ptr, size_t len, XXH_alignment align)
782 {
711783 #define PROCESS1_64 \
712 h64 ^= (*p++) * PRIME64_5; \
784 h64 ^= (*ptr++) * PRIME64_5; \
713785 h64 = XXH_rotl64(h64, 11) * PRIME64_1;
714786
715787 #define PROCESS4_64 \
716 h64 ^= (U64)(XXH_get32bits(p)) * PRIME64_1; \
717 p+=4; \
788 h64 ^= (xxh_u64)(XXH_get32bits(ptr)) * PRIME64_1; \
789 ptr+=4; \
718790 h64 = XXH_rotl64(h64, 23) * PRIME64_2 + PRIME64_3;
719791
720792 #define PROCESS8_64 { \
721 U64 const k1 = XXH64_round(0, XXH_get64bits(p)); \
722 p+=8; \
793 xxh_u64 const k1 = XXH64_round(0, XXH_get64bits(ptr)); \
794 ptr+=8; \
723795 h64 ^= k1; \
724796 h64 = XXH_rotl64(h64,27) * PRIME64_1 + PRIME64_4; \
725797 }
726798
727 switch(len&31) {
728 case 24: PROCESS8_64;
729 /* fallthrough */
730 case 16: PROCESS8_64;
731 /* fallthrough */
732 case 8: PROCESS8_64;
733 return XXH64_avalanche(h64);
734
735 case 28: PROCESS8_64;
736 /* fallthrough */
737 case 20: PROCESS8_64;
738 /* fallthrough */
739 case 12: PROCESS8_64;
740 /* fallthrough */
741 case 4: PROCESS4_64;
742 return XXH64_avalanche(h64);
743
744 case 25: PROCESS8_64;
745 /* fallthrough */
746 case 17: PROCESS8_64;
747 /* fallthrough */
748 case 9: PROCESS8_64;
749 PROCESS1_64;
750 return XXH64_avalanche(h64);
751
752 case 29: PROCESS8_64;
753 /* fallthrough */
754 case 21: PROCESS8_64;
755 /* fallthrough */
756 case 13: PROCESS8_64;
757 /* fallthrough */
758 case 5: PROCESS4_64;
759 PROCESS1_64;
760 return XXH64_avalanche(h64);
761
762 case 26: PROCESS8_64;
763 /* fallthrough */
764 case 18: PROCESS8_64;
765 /* fallthrough */
766 case 10: PROCESS8_64;
767 PROCESS1_64;
768 PROCESS1_64;
769 return XXH64_avalanche(h64);
770
771 case 30: PROCESS8_64;
772 /* fallthrough */
773 case 22: PROCESS8_64;
774 /* fallthrough */
775 case 14: PROCESS8_64;
776 /* fallthrough */
777 case 6: PROCESS4_64;
778 PROCESS1_64;
779 PROCESS1_64;
780 return XXH64_avalanche(h64);
781
782 case 27: PROCESS8_64;
783 /* fallthrough */
784 case 19: PROCESS8_64;
785 /* fallthrough */
786 case 11: PROCESS8_64;
787 PROCESS1_64;
788 PROCESS1_64;
789 PROCESS1_64;
790 return XXH64_avalanche(h64);
791
792 case 31: PROCESS8_64;
793 /* fallthrough */
794 case 23: PROCESS8_64;
795 /* fallthrough */
796 case 15: PROCESS8_64;
797 /* fallthrough */
798 case 7: PROCESS4_64;
799 /* fallthrough */
800 case 3: PROCESS1_64;
801 /* fallthrough */
802 case 2: PROCESS1_64;
803 /* fallthrough */
804 case 1: PROCESS1_64;
805 /* fallthrough */
806 case 0: return XXH64_avalanche(h64);
799 /* Rerolled version for 32-bit targets is faster and much smaller. */
800 if (XXH_REROLL || XXH_REROLL_XXH64) {
801 len &= 31;
802 while (len >= 8) {
803 PROCESS8_64;
804 len -= 8;
805 }
806 if (len >= 4) {
807 PROCESS4_64;
808 len -= 4;
809 }
810 while (len > 0) {
811 PROCESS1_64;
812 --len;
813 }
814 return XXH64_avalanche(h64);
815 } else {
816 switch(len & 31) {
817 case 24: PROCESS8_64;
818 /* fallthrough */
819 case 16: PROCESS8_64;
820 /* fallthrough */
821 case 8: PROCESS8_64;
822 return XXH64_avalanche(h64);
823
824 case 28: PROCESS8_64;
825 /* fallthrough */
826 case 20: PROCESS8_64;
827 /* fallthrough */
828 case 12: PROCESS8_64;
829 /* fallthrough */
830 case 4: PROCESS4_64;
831 return XXH64_avalanche(h64);
832
833 case 25: PROCESS8_64;
834 /* fallthrough */
835 case 17: PROCESS8_64;
836 /* fallthrough */
837 case 9: PROCESS8_64;
838 PROCESS1_64;
839 return XXH64_avalanche(h64);
840
841 case 29: PROCESS8_64;
842 /* fallthrough */
843 case 21: PROCESS8_64;
844 /* fallthrough */
845 case 13: PROCESS8_64;
846 /* fallthrough */
847 case 5: PROCESS4_64;
848 PROCESS1_64;
849 return XXH64_avalanche(h64);
850
851 case 26: PROCESS8_64;
852 /* fallthrough */
853 case 18: PROCESS8_64;
854 /* fallthrough */
855 case 10: PROCESS8_64;
856 PROCESS1_64;
857 PROCESS1_64;
858 return XXH64_avalanche(h64);
859
860 case 30: PROCESS8_64;
861 /* fallthrough */
862 case 22: PROCESS8_64;
863 /* fallthrough */
864 case 14: PROCESS8_64;
865 /* fallthrough */
866 case 6: PROCESS4_64;
867 PROCESS1_64;
868 PROCESS1_64;
869 return XXH64_avalanche(h64);
870
871 case 27: PROCESS8_64;
872 /* fallthrough */
873 case 19: PROCESS8_64;
874 /* fallthrough */
875 case 11: PROCESS8_64;
876 PROCESS1_64;
877 PROCESS1_64;
878 PROCESS1_64;
879 return XXH64_avalanche(h64);
880
881 case 31: PROCESS8_64;
882 /* fallthrough */
883 case 23: PROCESS8_64;
884 /* fallthrough */
885 case 15: PROCESS8_64;
886 /* fallthrough */
887 case 7: PROCESS4_64;
888 /* fallthrough */
889 case 3: PROCESS1_64;
890 /* fallthrough */
891 case 2: PROCESS1_64;
892 /* fallthrough */
893 case 1: PROCESS1_64;
894 /* fallthrough */
895 case 0: return XXH64_avalanche(h64);
896 }
807897 }
808
809898 /* impossible to reach */
810 assert(0);
899 XXH_ASSERT(0);
811900 return 0; /* unreachable, but some compilers complain without it */
812901 }
813902
814 XXH_FORCE_INLINE U64
815 XXH64_endian_align(const void* input, size_t len, U64 seed, XXH_alignment align)
816 {
817 const BYTE* p = (const BYTE*)input;
818 const BYTE* bEnd = p + len;
819 U64 h64;
903 XXH_FORCE_INLINE xxh_u64
904 XXH64_endian_align(const xxh_u8* input, size_t len, xxh_u64 seed, XXH_alignment align)
905 {
906 const xxh_u8* bEnd = input + len;
907 xxh_u64 h64;
820908
821909 #if defined(XXH_ACCEPT_NULL_INPUT_POINTER) && (XXH_ACCEPT_NULL_INPUT_POINTER>=1)
822 if (p==NULL) {
910 if (input==NULL) {
823911 len=0;
824 bEnd=p=(const BYTE*)(size_t)32;
912 bEnd=input=(const xxh_u8*)(size_t)32;
825913 }
826914 #endif
827915
828916 if (len>=32) {
829 const BYTE* const limit = bEnd - 32;
830 U64 v1 = seed + PRIME64_1 + PRIME64_2;
831 U64 v2 = seed + PRIME64_2;
832 U64 v3 = seed + 0;
833 U64 v4 = seed - PRIME64_1;
917 const xxh_u8* const limit = bEnd - 32;
918 xxh_u64 v1 = seed + PRIME64_1 + PRIME64_2;
919 xxh_u64 v2 = seed + PRIME64_2;
920 xxh_u64 v3 = seed + 0;
921 xxh_u64 v4 = seed - PRIME64_1;
834922
835923 do {
836 v1 = XXH64_round(v1, XXH_get64bits(p)); p+=8;
837 v2 = XXH64_round(v2, XXH_get64bits(p)); p+=8;
838 v3 = XXH64_round(v3, XXH_get64bits(p)); p+=8;
839 v4 = XXH64_round(v4, XXH_get64bits(p)); p+=8;
840 } while (p<=limit);
924 v1 = XXH64_round(v1, XXH_get64bits(input)); input+=8;
925 v2 = XXH64_round(v2, XXH_get64bits(input)); input+=8;
926 v3 = XXH64_round(v3, XXH_get64bits(input)); input+=8;
927 v4 = XXH64_round(v4, XXH_get64bits(input)); input+=8;
928 } while (input<=limit);
841929
842930 h64 = XXH_rotl64(v1, 1) + XXH_rotl64(v2, 7) + XXH_rotl64(v3, 12) + XXH_rotl64(v4, 18);
843931 h64 = XXH64_mergeRound(h64, v1);
849937 h64 = seed + PRIME64_5;
850938 }
851939
852 h64 += (U64) len;
853
854 return XXH64_finalize(h64, p, len, align);
855 }
856
857
858 XXH_PUBLIC_API unsigned long long XXH64 (const void* input, size_t len, unsigned long long seed)
940 h64 += (xxh_u64) len;
941
942 return XXH64_finalize(h64, input, len, align);
943 }
944
945
946 XXH_PUBLIC_API XXH64_hash_t XXH64 (const void* input, size_t len, XXH64_hash_t seed)
859947 {
860948 #if 0
861949 /* Simple version, good for code maintenance, but unfortunately slow for small inputs */
862950 XXH64_state_t state;
863951 XXH64_reset(&state, seed);
864 XXH64_update(&state, input, len);
952 XXH64_update(&state, (const xxh_u8*)input, len);
865953 return XXH64_digest(&state);
866954
867955 #else
868956
869957 if (XXH_FORCE_ALIGN_CHECK) {
870958 if ((((size_t)input) & 7)==0) { /* Input is aligned, let's leverage the speed advantage */
871 return XXH64_endian_align(input, len, seed, XXH_aligned);
959 return XXH64_endian_align((const xxh_u8*)input, len, seed, XXH_aligned);
872960 } }
873961
874 return XXH64_endian_align(input, len, seed, XXH_unaligned);
962 return XXH64_endian_align((const xxh_u8*)input, len, seed, XXH_unaligned);
875963
876964 #endif
877965 }
893981 memcpy(dstState, srcState, sizeof(*dstState));
894982 }
895983
896 XXH_PUBLIC_API XXH_errorcode XXH64_reset(XXH64_state_t* statePtr, unsigned long long seed)
984 XXH_PUBLIC_API XXH_errorcode XXH64_reset(XXH64_state_t* statePtr, XXH64_hash_t seed)
897985 {
898986 XXH64_state_t state; /* using a local state to memcpy() in order to avoid strict-aliasing warnings */
899987 memset(&state, 0, sizeof(state));
901989 state.v2 = seed + PRIME64_2;
902990 state.v3 = seed + 0;
903991 state.v4 = seed - PRIME64_1;
904 /* do not write into reserved, planned to be removed in a future version */
905 memcpy(statePtr, &state, sizeof(state) - sizeof(state.reserved));
992 /* do not write into reserved64, might be removed in a future version */
993 memcpy(statePtr, &state, sizeof(state) - sizeof(state.reserved64));
906994 return XXH_OK;
907995 }
908996
9161004 return XXH_ERROR;
9171005 #endif
9181006
919 { const BYTE* p = (const BYTE*)input;
920 const BYTE* const bEnd = p + len;
1007 { const xxh_u8* p = (const xxh_u8*)input;
1008 const xxh_u8* const bEnd = p + len;
9211009
9221010 state->total_len += len;
9231011
9241012 if (state->memsize + len < 32) { /* fill in tmp buffer */
925 XXH_memcpy(((BYTE*)state->mem64) + state->memsize, input, len);
926 state->memsize += (U32)len;
1013 XXH_memcpy(((xxh_u8*)state->mem64) + state->memsize, input, len);
1014 state->memsize += (xxh_u32)len;
9271015 return XXH_OK;
9281016 }
9291017
9301018 if (state->memsize) { /* tmp buffer is full */
931 XXH_memcpy(((BYTE*)state->mem64) + state->memsize, input, 32-state->memsize);
1019 XXH_memcpy(((xxh_u8*)state->mem64) + state->memsize, input, 32-state->memsize);
9321020 state->v1 = XXH64_round(state->v1, XXH_readLE64(state->mem64+0));
9331021 state->v2 = XXH64_round(state->v2, XXH_readLE64(state->mem64+1));
9341022 state->v3 = XXH64_round(state->v3, XXH_readLE64(state->mem64+2));
9381026 }
9391027
9401028 if (p+32 <= bEnd) {
941 const BYTE* const limit = bEnd - 32;
942 U64 v1 = state->v1;
943 U64 v2 = state->v2;
944 U64 v3 = state->v3;
945 U64 v4 = state->v4;
1029 const xxh_u8* const limit = bEnd - 32;
1030 xxh_u64 v1 = state->v1;
1031 xxh_u64 v2 = state->v2;
1032 xxh_u64 v3 = state->v3;
1033 xxh_u64 v4 = state->v4;
9461034
9471035 do {
9481036 v1 = XXH64_round(v1, XXH_readLE64(p)); p+=8;
9671055 }
9681056
9691057
970 XXH_PUBLIC_API unsigned long long XXH64_digest (const XXH64_state_t* state)
971 {
972 U64 h64;
1058 XXH_PUBLIC_API XXH64_hash_t XXH64_digest (const XXH64_state_t* state)
1059 {
1060 xxh_u64 h64;
9731061
9741062 if (state->total_len >= 32) {
975 U64 const v1 = state->v1;
976 U64 const v2 = state->v2;
977 U64 const v3 = state->v3;
978 U64 const v4 = state->v4;
1063 xxh_u64 const v1 = state->v1;
1064 xxh_u64 const v2 = state->v2;
1065 xxh_u64 const v3 = state->v3;
1066 xxh_u64 const v4 = state->v4;
9791067
9801068 h64 = XXH_rotl64(v1, 1) + XXH_rotl64(v2, 7) + XXH_rotl64(v3, 12) + XXH_rotl64(v4, 18);
9811069 h64 = XXH64_mergeRound(h64, v1);
9861074 h64 = state->v3 /*seed*/ + PRIME64_5;
9871075 }
9881076
989 h64 += (U64) state->total_len;
990
991 return XXH64_finalize(h64, state->mem64, (size_t)state->total_len, XXH_aligned);
1077 h64 += (xxh_u64) state->total_len;
1078
1079 return XXH64_finalize(h64, (const xxh_u8*)state->mem64, (size_t)state->total_len, XXH_aligned);
9921080 }
9931081
9941082
10061094 return XXH_readBE64(src);
10071095 }
10081096
1097
1098
1099 /* *********************************************************************
1100 * XXH3
1101 * New generation hash designed for speed on small keys and vectorization
1102 ************************************************************************ */
1103
1104 #include "xxh3.h"
1105
1106
10091107 #endif /* XXH_NO_LONG_LONG */
1108
1109 #endif /* XXHASH_C_01393879 */
4848 SuperFastHash 1.2 GB/s 1 Paul Hsieh
4949 CityHash64 1.05 GB/s 10 Pike & Alakuijala
5050 FNV 0.55 GB/s 5 Fowler, Noll, Vo
51 CRC32 0.43 GB/s 9
51 CRC32 0.43 GB/s † 9
5252 MD5-32 0.33 GB/s 10 Ronald L. Rivest
5353 SHA1-32 0.28 GB/s 10
54
55 Note †: other CRC32 implementations can be over 40x faster than SMHasher's:
56 http://fastcompression.blogspot.com/2019/03/presenting-xxh3.html?showComment=1552696407071#c3490092340461170735
5457
5558 Q.Score is a measure of quality of the hash function.
5659 It depends on successfully passing SMHasher test set.
7679 ******************************/
7780 #include <stddef.h> /* size_t */
7881 typedef enum { XXH_OK=0, XXH_ERROR } XXH_errorcode;
82 #define XXH_STATIC_LINKING_ONLY
7983
8084
8185 /* ****************************
8286 * API modifier
8387 ******************************/
8488 /** XXH_INLINE_ALL (and XXH_PRIVATE_API)
85 * This is useful to include xxhash functions in `static` mode
89 * This build macro includes xxhash functions in `static` mode
8690 * in order to inline them, and remove their symbol from the public list.
87 * Inlining can offer dramatic performance improvement on small keys.
91 * Inlining offers great performance improvement on small keys,
92 * and dramatic ones when length is expressed as a compile-time constant.
93 * See https://fastcompression.blogspot.com/2018/03/xxhash-for-small-keys-impressive-power.html .
8894 * Methodology :
8995 * #define XXH_INLINE_ALL
9096 * #include "xxhash.h"
9197 * `xxhash.c` is automatically included.
92 * It's not useful to compile and link it as a separate module.
98 * It's not useful to compile and link it as a separate object.
9399 */
94100 #if defined(XXH_INLINE_ALL) || defined(XXH_PRIVATE_API)
95101 # ifndef XXH_STATIC_LINKING_ONLY
106112 # define XXH_PUBLIC_API static
107113 # endif
108114 #else
109 # if defined(WIN32) && !defined(__GNUC__)
115 # if defined(WIN32) && defined(_MSC_VER) && (defined(XXH_IMPORT) || defined(XXH_EXPORT))
110116 # ifdef XXH_EXPORT
111117 # define XXH_PUBLIC_API __declspec(dllexport)
112 # else
118 # elif XXH_IMPORT
113119 # define XXH_PUBLIC_API __declspec(dllimport)
114120 # endif
115121 # else
158164 ***************************************/
159165 #define XXH_VERSION_MAJOR 0
160166 #define XXH_VERSION_MINOR 7
161 #define XXH_VERSION_RELEASE 0
167 #define XXH_VERSION_RELEASE 2
162168 #define XXH_VERSION_NUMBER (XXH_VERSION_MAJOR *100*100 + XXH_VERSION_MINOR *100 + XXH_VERSION_RELEASE)
163169 XXH_PUBLIC_API unsigned XXH_versionNumber (void);
164170
166172 /*-**********************************************************************
167173 * 32-bit hash
168174 ************************************************************************/
169 typedef unsigned int XXH32_hash_t;
175 #if !defined (__VMS) \
176 && (defined (__cplusplus) \
177 || (defined (__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) /* C99 */) )
178 # include <stdint.h>
179 typedef uint32_t XXH32_hash_t;
180 #else
181 # include <limits.h>
182 # if UINT_MAX == 0xFFFFFFFFUL
183 typedef unsigned int XXH32_hash_t;
184 # else
185 # if ULONG_MAX == 0xFFFFFFFFUL
186 typedef unsigned long XXH32_hash_t;
187 # else
188 # error "unsupported platform : need a 32-bit type"
189 # endif
190 # endif
191 #endif
170192
171193 /*! XXH32() :
172194 Calculate the 32-bit hash of sequence "length" bytes stored at memory address "input".
173195 The memory between input & input+length must be valid (allocated and read-accessible).
174196 "seed" can be used to alter the result predictably.
175197 Speed on Core 2 Duo @ 3 GHz (single thread, SMHasher benchmark) : 5.4 GB/s */
176 XXH_PUBLIC_API XXH32_hash_t XXH32 (const void* input, size_t length, unsigned int seed);
198 XXH_PUBLIC_API XXH32_hash_t XXH32 (const void* input, size_t length, XXH32_hash_t seed);
177199
178200 /*====== Streaming ======*/
201
202 /*
203 * Streaming functions generate the xxHash value from an incrememtal input.
204 * This method is slower than single-call functions, due to state management.
205 * For small inputs, prefer `XXH32()` and `XXH64()`, which are better optimized.
206 *
207 * XXH state must first be allocated, using XXH*_createState() .
208 *
209 * Start a new hash by initializing state with a seed, using XXH*_reset().
210 *
211 * Then, feed the hash state by calling XXH*_update() as many times as necessary.
212 * The function returns an error code, with 0 meaning OK, and any other value meaning there is an error.
213 *
214 * Finally, a hash value can be produced anytime, by using XXH*_digest().
215 * This function returns the nn-bits hash as an int or long long.
216 *
217 * It's still possible to continue inserting input into the hash state after a digest,
218 * and generate some new hash values later on, by invoking again XXH*_digest().
219 *
220 * When done, release the state, using XXH*_freeState().
221 */
222
179223 typedef struct XXH32_state_s XXH32_state_t; /* incomplete type */
180224 XXH_PUBLIC_API XXH32_state_t* XXH32_createState(void);
181225 XXH_PUBLIC_API XXH_errorcode XXH32_freeState(XXH32_state_t* statePtr);
182226 XXH_PUBLIC_API void XXH32_copyState(XXH32_state_t* dst_state, const XXH32_state_t* src_state);
183227
184 XXH_PUBLIC_API XXH_errorcode XXH32_reset (XXH32_state_t* statePtr, unsigned int seed);
228 XXH_PUBLIC_API XXH_errorcode XXH32_reset (XXH32_state_t* statePtr, XXH32_hash_t seed);
185229 XXH_PUBLIC_API XXH_errorcode XXH32_update (XXH32_state_t* statePtr, const void* input, size_t length);
186230 XXH_PUBLIC_API XXH32_hash_t XXH32_digest (const XXH32_state_t* statePtr);
187231
188 /*
189 * Streaming functions generate the xxHash of an input provided in multiple segments.
190 * Note that, for small input, they are slower than single-call functions, due to state management.
191 * For small inputs, prefer `XXH32()` and `XXH64()`, which are better optimized.
192 *
193 * XXH state must first be allocated, using XXH*_createState() .
194 *
195 * Start a new hash by initializing state with a seed, using XXH*_reset().
196 *
197 * Then, feed the hash state by calling XXH*_update() as many times as necessary.
198 * The function returns an error code, with 0 meaning OK, and any other value meaning there is an error.
199 *
200 * Finally, a hash value can be produced anytime, by using XXH*_digest().
201 * This function returns the nn-bits hash as an int or long long.
202 *
203 * It's still possible to continue inserting input into the hash state after a digest,
204 * and generate some new hashes later on, by calling again XXH*_digest().
205 *
206 * When done, free XXH state space if it was allocated dynamically.
207 */
208
209232 /*====== Canonical representation ======*/
233
234 /* Default return values from XXH functions are basic unsigned 32 and 64 bits.
235 * This the simplest and fastest format for further post-processing.
236 * However, this leaves open the question of what is the order of bytes,
237 * since little and big endian conventions will write the same number differently.
238 *
239 * The canonical representation settles this issue,
240 * by mandating big-endian convention,
241 * aka, the same convention as human-readable numbers (large digits first).
242 * When writing hash values to storage, sending them over a network, or printing them,
243 * it's highly recommended to use the canonical representation,
244 * to ensure portability across a wider range of systems, present and future.
245 *
246 * The following functions allow transformation of hash values into and from canonical format.
247 */
210248
211249 typedef struct { unsigned char digest[4]; } XXH32_canonical_t;
212250 XXH_PUBLIC_API void XXH32_canonicalFromHash(XXH32_canonical_t* dst, XXH32_hash_t hash);
213251 XXH_PUBLIC_API XXH32_hash_t XXH32_hashFromCanonical(const XXH32_canonical_t* src);
214
215 /* Default result type for XXH functions are primitive unsigned 32 and 64 bits.
216 * The canonical representation uses human-readable write convention, aka big-endian (large digits first).
217 * These functions allow transformation of hash result into and from its canonical format.
218 * This way, hash values can be written into a file / memory, and remain comparable on different systems and programs.
219 */
220252
221253
222254 #ifndef XXH_NO_LONG_LONG
223255 /*-**********************************************************************
224256 * 64-bit hash
225257 ************************************************************************/
226 typedef unsigned long long XXH64_hash_t;
258 #if !defined (__VMS) \
259 && (defined (__cplusplus) \
260 || (defined (__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) /* C99 */) )
261 # include <stdint.h>
262 typedef uint64_t XXH64_hash_t;
263 #else
264 /* the following type must have a width of 64-bit */
265 typedef unsigned long long XXH64_hash_t;
266 #endif
227267
228268 /*! XXH64() :
229269 Calculate the 64-bit hash of sequence of length "len" stored at memory address "input".
230270 "seed" can be used to alter the result predictably.
231271 This function runs faster on 64-bit systems, but slower on 32-bit systems (see benchmark).
232272 */
233 XXH_PUBLIC_API XXH64_hash_t XXH64 (const void* input, size_t length, unsigned long long seed);
273 XXH_PUBLIC_API XXH64_hash_t XXH64 (const void* input, size_t length, XXH64_hash_t seed);
234274
235275 /*====== Streaming ======*/
236276 typedef struct XXH64_state_s XXH64_state_t; /* incomplete type */
238278 XXH_PUBLIC_API XXH_errorcode XXH64_freeState(XXH64_state_t* statePtr);
239279 XXH_PUBLIC_API void XXH64_copyState(XXH64_state_t* dst_state, const XXH64_state_t* src_state);
240280
241 XXH_PUBLIC_API XXH_errorcode XXH64_reset (XXH64_state_t* statePtr, unsigned long long seed);
281 XXH_PUBLIC_API XXH_errorcode XXH64_reset (XXH64_state_t* statePtr, XXH64_hash_t seed);
242282 XXH_PUBLIC_API XXH_errorcode XXH64_update (XXH64_state_t* statePtr, const void* input, size_t length);
243283 XXH_PUBLIC_API XXH64_hash_t XXH64_digest (const XXH64_state_t* statePtr);
244284
264304 /* These definitions are only present to allow
265305 * static allocation of XXH state, on stack or in a struct for example.
266306 * Never **ever** use members directly. */
267
268 #if !defined (__VMS) \
269 && (defined (__cplusplus) \
270 || (defined (__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) /* C99 */) )
271 # include <stdint.h>
272
273 struct XXH32_state_s {
274 uint32_t total_len_32;
275 uint32_t large_len;
276 uint32_t v1;
277 uint32_t v2;
278 uint32_t v3;
279 uint32_t v4;
280 uint32_t mem32[4];
281 uint32_t memsize;
282 uint32_t reserved; /* never read nor write, might be removed in a future version */
283 }; /* typedef'd to XXH32_state_t */
284
285 struct XXH64_state_s {
286 uint64_t total_len;
287 uint64_t v1;
288 uint64_t v2;
289 uint64_t v3;
290 uint64_t v4;
291 uint64_t mem64[4];
292 uint32_t memsize;
293 uint32_t reserved[2]; /* never read nor write, might be removed in a future version */
294 }; /* typedef'd to XXH64_state_t */
295
296 # else
297307
298308 struct XXH32_state_s {
299309 XXH32_hash_t total_len_32;
307317 XXH32_hash_t reserved; /* never read nor write, might be removed in a future version */
308318 }; /* typedef'd to XXH32_state_t */
309319
310 # ifndef XXH_NO_LONG_LONG /* remove 64-bit support */
320 #ifndef XXH_NO_LONG_LONG /* remove 64-bit support */
311321 struct XXH64_state_s {
312322 XXH64_hash_t total_len;
313323 XXH64_hash_t v1;
316326 XXH64_hash_t v4;
317327 XXH64_hash_t mem64[4];
318328 XXH32_hash_t memsize;
319 XXH32_hash_t reserved[2]; /* never read nor write, might be removed in a future version */
329 XXH32_hash_t reserved32; /* required for padding anyway */
330 XXH64_hash_t reserved64; /* never read nor write, might be removed in a future version */
320331 }; /* typedef'd to XXH64_state_t */
321 # endif
322
323 # endif
332 #endif /* XXH_NO_LONG_LONG */
324333
325334
326335 /*-**********************************************************************
332341
333342 /* ============================================
334343 * XXH3 is a new hash algorithm,
335 * featuring vastly improved speed performance
336 * for both small and large inputs.
337 * A full speed analysis will be published,
338 * it requires a lot more space than this comment can handle.
344 * featuring improved speed performance for both small and large inputs.
345 * See full speed analysis at : http://fastcompression.blogspot.com/2019/03/presenting-xxh3.html
339346 * In general, expect XXH3 to run about ~2x faster on large inputs,
340 * and >3x faster on small ones, though exact difference depend on platform.
347 * and >3x faster on small ones, though exact differences depend on platform.
341348 *
342349 * The algorithm is portable, will generate the same hash on all platforms.
343350 * It benefits greatly from vectorization units, but does not require it.
345352 * XXH3 offers 2 variants, _64bits and _128bits.
346353 * When only 64 bits are needed, prefer calling the _64bits variant :
347354 * it reduces the amount of mixing, resulting in faster speed on small inputs.
348 * It's also generally simpler to manipulate a scalar type than a struct.
349 * Note : the low 64-bit field of the _128bits variant is the same as _64bits result.
355 * It's also generally simpler to manipulate a scalar return type than a struct.
350356 *
351357 * The XXH3 algorithm is still considered experimental.
352 * It's possible to use it for ephemeral data, but avoid storing long-term values for later re-use.
353 * While labelled experimental, the produced result can still change between versions.
354 *
355 * The API currently supports one-shot hashing only.
356 * The full version will include streaming capability, and canonical representation
357 * Long term optional feature may include custom secret keys, and secret key generation.
358 * Produced results can still change between versions.
359 * Results produced by v0.7.x are not comparable with results from v0.7.y .
360 * It's nonetheless possible to use XXH3 for ephemeral data (local sessions),
361 * but avoid storing values in long-term storage for later reads.
362 *
363 * The API supports one-shot hashing, streaming mode, and custom secrets.
358364 *
359365 * There are still a number of opened questions that community can influence during the experimental period.
360366 * I'm trying to list a few of them below, though don't consider this list as complete.
361367 *
362 * - 128-bits output type : currently defined as a structure of 2 64-bits fields.
368 * - 128-bits output type : currently defined as a structure of two 64-bits fields.
363369 * That's because 128-bit values do not exist in C standard.
364370 * Note that it means that, at byte level, result is not identical depending on endianess.
365371 * However, at field level, they are identical on all platforms.
366 * The canonical representation will solve the issue of identical byte-level representation across platforms,
372 * The canonical representation solves the issue of identical byte-level representation across platforms,
367373 * which is necessary for serialization.
368 * Would there be a better representation for a 128-bit hash result ?
369 * Are the names of the inner 64-bit fields important ? Should they be changed ?
370 *
371 * - Canonical representation : for the 64-bit variant, canonical representation is the same as XXH64() (aka big-endian).
372 * What should it be for the 128-bit variant ?
373 * Since it's no longer a scalar value, big-endian representation is no longer an obvious choice.
374 * One possibility : represent it as the concatenation of two 64-bits canonical representation (aka 2x big-endian)
375 * Another one : represent it in the same order as natural order in the struct for little-endian platforms.
376 * Less consistent with existing convention for XXH32/XXH64, but may be more natural for little-endian platforms.
377 *
378 * - Associated functions for 128-bit hash : simple things, such as checking if 2 hashes are equal, become more difficult with struct.
379 * Granted, it's not terribly difficult to create a comparator, but it's still a workload.
380 * Would it be beneficial to declare and define a comparator function for XXH128_hash_t ?
381 * Are there other operations on XXH128_hash_t which would be desirable ?
382 *
383 * - Variant compatibility : The low 64-bit field of the _128bits variant is the same as the result of _64bits.
384 * This is not a compulsory behavior. It just felt that it "wouldn't hurt", and might even help in some (unidentified) cases.
385 * But it might influence the design of XXH128_hash_t, in ways which may block other possibilities.
386 * Good idea, bad idea ?
387 *
388 * - Seed type for 128-bits variant : currently, it's a single 64-bit value, like the 64-bit variant.
374 * Q1 : Would there be a better representation for a 128-bit hash result ?
375 * Q2 : Are the names of the inner 64-bit fields important ? Should they be changed ?
376 *
377 * - Prototype XXH128() : XXH128() uses the same arguments as XXH64(), for consistency.
378 * It means it maps to XXH3_128bits_withSeed().
379 * This variant is slightly slower than XXH3_128bits(),
380 * because the seed is now part of the algorithm, and can't be simplified.
381 * Is that a good idea ?
382 *
383 * - Seed type for XXH128() : currently, it's a single 64-bit value, like the 64-bit variant.
389384 * It could be argued that it's more logical to offer a 128-bit seed input parameter for a 128-bit hash.
390 * Although it's also more difficult to use, since it requires to declare and pass a structure instead of a value.
391 * It would either replace current choice, or add a new one.
385 * But 128-bit seed is more difficult to use, since it requires to pass a structure instead of a scalar value.
386 * Such a variant could either replace current one, or become an additional one.
392387 * Farmhash, for example, offers both variants (the 128-bits seed variant is called `doubleSeed`).
393 * If both 64-bit and 128-bit seeds are possible, which variant should be called XXH128 ?
394 *
395 * - Result for len==0 : Currently, the result of hashing a zero-length input is the seed.
396 * This mimics the behavior of a crc : in which case, a seed is effectively an accumulator, so it's not updated if input is empty.
397 * Consequently, by default, when no seed specified, it returns zero. That part seems okay (it used to be a request for XXH32/XXH64).
398 * But is it still fine to return the seed when the seed is non-zero ?
399 * Are there use case which would depend on this behavior, or would prefer a mixing of the seed ?
400 */
388 * Follow up question : if both 64-bit and 128-bit seeds are allowed, which variant should be called XXH128 ?
389 *
390 * - Result for len==0 : Currently, the result of hashing a zero-length input is always `0`.
391 * It seems okay as a return value when using "default" secret and seed.
392 * But is it still fine to return `0` when secret or seed are non-default ?
393 * Are there use cases which could depend on generating a different hash result for zero-length input when the secret is different ?
394 *
395 * - Consistency (1) : Streaming XXH128 uses an XXH3 state, which is the same state as XXH3_64bits().
396 * It means a 128bit streaming loop must invoke the following symbols :
397 * XXH3_createState(), XXH3_128bits_reset(), XXH3_128bits_update() (loop), XXH3_128bits_digest(), XXH3_freeState().
398 * Is that consistent enough ?
399 *
400 * - Consistency (2) : The canonical representation of `XXH3_64bits` is provided by existing functions
401 * XXH64_canonicalFromHash(), and reverse operation XXH64_hashFromCanonical().
402 * As a mirror, canonical functions for XXH128_hash_t results generated by `XXH3_128bits`
403 * are XXH128_canonicalFromHash() and XXH128_hashFromCanonical().
404 * Which means, `XXH3` doesn't appear in the names, because canonical functions operate on a type,
405 * independently of which algorithm was used to generate that type.
406 * Is that consistent enough ?
407 */
408
409 #ifdef XXH_NAMESPACE
410 # define XXH3_64bits XXH_NAME2(XXH_NAMESPACE, XXH3_64bits)
411 # define XXH3_64bits_withSecret XXH_NAME2(XXH_NAMESPACE, XXH3_64bits_withSecret)
412 # define XXH3_64bits_withSeed XXH_NAME2(XXH_NAMESPACE, XXH3_64bits_withSeed)
413
414 # define XXH3_createState XXH_NAME2(XXH_NAMESPACE, XXH3_createState)
415 # define XXH3_freeState XXH_NAME2(XXH_NAMESPACE, XXH3_freeState)
416 # define XXH3_copyState XXH_NAME2(XXH_NAMESPACE, XXH3_copyState)
417
418 # define XXH3_64bits_reset XXH_NAME2(XXH_NAMESPACE, XXH3_64bits_reset)
419 # define XXH3_64bits_reset_withSeed XXH_NAME2(XXH_NAMESPACE, XXH3_64bits_reset_withSeed)
420 # define XXH3_64bits_reset_withSecret XXH_NAME2(XXH_NAMESPACE, XXH3_64bits_reset_withSecret)
421 # define XXH3_64bits_update XXH_NAME2(XXH_NAMESPACE, XXH3_64bits_update)
422 # define XXH3_64bits_digest XXH_NAME2(XXH_NAMESPACE, XXH3_64bits_digest)
423 #endif
424
425 /* XXH3_64bits() :
426 * default 64-bit variant, using default secret and default seed of 0.
427 * It's the fastest variant. */
428 XXH_PUBLIC_API XXH64_hash_t XXH3_64bits(const void* data, size_t len);
429
430 /* XXH3_64bits_withSecret() :
431 * It's possible to provide any blob of bytes as a "secret" to generate the hash.
432 * This makes it more difficult for an external actor to prepare an intentional collision.
433 * The secret *must* be large enough (>= XXH3_SECRET_SIZE_MIN).
434 * It should consist of random bytes.
435 * Avoid repeating same character, or sequences of bytes,
436 * and especially avoid swathes of \0.
437 * Failure to respect these conditions will result in a poor quality hash.
438 */
439 #define XXH3_SECRET_SIZE_MIN 136
440 XXH_PUBLIC_API XXH64_hash_t XXH3_64bits_withSecret(const void* data, size_t len, const void* secret, size_t secretSize);
441
442 /* XXH3_64bits_withSeed() :
443 * This variant generates on the fly a custom secret,
444 * based on the default secret, altered using the `seed` value.
445 * While this operation is decently fast, note that it's not completely free.
446 * note : seed==0 produces same results as XXH3_64bits() */
447 XXH_PUBLIC_API XXH64_hash_t XXH3_64bits_withSeed(const void* data, size_t len, XXH64_hash_t seed);
448
449
450 /* streaming 64-bit */
451
452 #if defined (__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L) /* C11+ */
453 # include <stdalign.h>
454 # define XXH_ALIGN(n) alignas(n)
455 #elif defined(__GNUC__)
456 # define XXH_ALIGN(n) __attribute__ ((aligned(n)))
457 #elif defined(_MSC_VER)
458 # define XXH_ALIGN(n) __declspec(align(n))
459 #else
460 # define XXH_ALIGN(n) /* disabled */
461 #endif
462
463 typedef struct XXH3_state_s XXH3_state_t;
464
465 #define XXH3_SECRET_DEFAULT_SIZE 192 /* minimum XXH3_SECRET_SIZE_MIN */
466 #define XXH3_INTERNALBUFFER_SIZE 256
467 struct XXH3_state_s {
468 XXH_ALIGN(64) XXH64_hash_t acc[8];
469 XXH_ALIGN(64) unsigned char customSecret[XXH3_SECRET_DEFAULT_SIZE]; /* used to store a custom secret generated from the seed. Makes state larger. Design might change */
470 XXH_ALIGN(64) unsigned char buffer[XXH3_INTERNALBUFFER_SIZE];
471 XXH32_hash_t bufferedSize;
472 XXH32_hash_t nbStripesPerBlock;
473 XXH32_hash_t nbStripesSoFar;
474 XXH32_hash_t secretLimit;
475 XXH32_hash_t reserved32;
476 XXH32_hash_t reserved32_2;
477 XXH64_hash_t totalLen;
478 XXH64_hash_t seed;
479 XXH64_hash_t reserved64;
480 const unsigned char* secret; /* note : there is some padding after, due to alignment on 64 bytes */
481 }; /* typedef'd to XXH3_state_t */
482
483 /* Streaming requires state maintenance.
484 * This operation costs memory and cpu.
485 * As a consequence, streaming is slower than one-shot hashing.
486 * For better performance, prefer using one-shot functions whenever possible. */
487
488 XXH_PUBLIC_API XXH3_state_t* XXH3_createState(void);
489 XXH_PUBLIC_API XXH_errorcode XXH3_freeState(XXH3_state_t* statePtr);
490 XXH_PUBLIC_API void XXH3_copyState(XXH3_state_t* dst_state, const XXH3_state_t* src_state);
491
492
493 /* XXH3_64bits_reset() :
494 * initialize with default parameters.
495 * result will be equivalent to `XXH3_64bits()`. */
496 XXH_PUBLIC_API XXH_errorcode XXH3_64bits_reset(XXH3_state_t* statePtr);
497 /* XXH3_64bits_reset_withSeed() :
498 * generate a custom secret from `seed`, and store it into state.
499 * digest will be equivalent to `XXH3_64bits_withSeed()`. */
500 XXH_PUBLIC_API XXH_errorcode XXH3_64bits_reset_withSeed(XXH3_state_t* statePtr, XXH64_hash_t seed);
501 /* XXH3_64bits_reset_withSecret() :
502 * `secret` is referenced, and must outlive the hash streaming session.
503 * secretSize must be >= XXH3_SECRET_SIZE_MIN.
504 */
505 XXH_PUBLIC_API XXH_errorcode XXH3_64bits_reset_withSecret(XXH3_state_t* statePtr, const void* secret, size_t secretSize);
506
507 XXH_PUBLIC_API XXH_errorcode XXH3_64bits_update (XXH3_state_t* statePtr, const void* input, size_t length);
508 XXH_PUBLIC_API XXH64_hash_t XXH3_64bits_digest (const XXH3_state_t* statePtr);
509
510
511 /* 128-bit */
401512
402513 #ifdef XXH_NAMESPACE
403514 # define XXH128 XXH_NAME2(XXH_NAMESPACE, XXH128)
404 # define XXH3_64bits XXH_NAME2(XXH_NAMESPACE, XXH3_64bits)
405 # define XXH3_64bits_withSeed XXH_NAME2(XXH_NAMESPACE, XXH3_64bits_withSeed)
406515 # define XXH3_128bits XXH_NAME2(XXH_NAMESPACE, XXH3_128bits)
407516 # define XXH3_128bits_withSeed XXH_NAME2(XXH_NAMESPACE, XXH3_128bits_withSeed)
408 #endif
409
517 # define XXH3_128bits_withSecret XXH_NAME2(XXH_NAMESPACE, XXH3_128bits_withSecret)
518
519 # define XXH3_128bits_reset XXH_NAME2(XXH_NAMESPACE, XXH3_128bits_reset)
520 # define XXH3_128bits_reset_withSeed XXH_NAME2(XXH_NAMESPACE, XXH3_128bits_reset_withSeed)
521 # define XXH3_128bits_reset_withSecret XXH_NAME2(XXH_NAMESPACE, XXH3_128bits_reset_withSecret)
522 # define XXH3_128bits_update XXH_NAME2(XXH_NAMESPACE, XXH3_128bits_update)
523 # define XXH3_128bits_digest XXH_NAME2(XXH_NAMESPACE, XXH3_128bits_digest)
524
525 # define XXH128_isEqual XXH_NAME2(XXH_NAMESPACE, XXH128_isEqual)
526 # define XXH128_cmp XXH_NAME2(XXH_NAMESPACE, XXH128_cmp)
527 # define XXH128_canonicalFromHash XXH_NAME2(XXH_NAMESPACE, XXH128_canonicalFromHash)
528 # define XXH128_hashFromCanonical XXH_NAME2(XXH_NAMESPACE, XXH128_hashFromCanonical)
529 #endif
410530
411531 typedef struct {
412532 XXH64_hash_t low64;
413533 XXH64_hash_t high64;
414534 } XXH128_hash_t;
415535
416 XXH_PUBLIC_API XXH128_hash_t XXH128(const void* data, size_t len, unsigned long long seed);
417
418 /* note : variants without seed produce same result as variant with seed == 0 */
419 XXH_PUBLIC_API XXH64_hash_t XXH3_64bits(const void* data, size_t len);
420 XXH_PUBLIC_API XXH64_hash_t XXH3_64bits_withSeed(const void* data, size_t len, unsigned long long seed);
536 XXH_PUBLIC_API XXH128_hash_t XXH128(const void* data, size_t len, XXH64_hash_t seed);
421537 XXH_PUBLIC_API XXH128_hash_t XXH3_128bits(const void* data, size_t len);
422 XXH_PUBLIC_API XXH128_hash_t XXH3_128bits_withSeed(const void* data, size_t len, unsigned long long seed); /* == XXH128() */
538 XXH_PUBLIC_API XXH128_hash_t XXH3_128bits_withSeed(const void* data, size_t len, XXH64_hash_t seed); /* == XXH128() */
539 XXH_PUBLIC_API XXH128_hash_t XXH3_128bits_withSecret(const void* data, size_t len, const void* secret, size_t secretSize);
540
541 XXH_PUBLIC_API XXH_errorcode XXH3_128bits_reset(XXH3_state_t* statePtr);
542 XXH_PUBLIC_API XXH_errorcode XXH3_128bits_reset_withSeed(XXH3_state_t* statePtr, XXH64_hash_t seed);
543 XXH_PUBLIC_API XXH_errorcode XXH3_128bits_reset_withSecret(XXH3_state_t* statePtr, const void* secret, size_t secretSize);
544
545 XXH_PUBLIC_API XXH_errorcode XXH3_128bits_update (XXH3_state_t* statePtr, const void* input, size_t length);
546 XXH_PUBLIC_API XXH128_hash_t XXH3_128bits_digest (const XXH3_state_t* statePtr);
547
548
549 /* Note : for better performance, following functions can be inlined,
550 * using XXH_INLINE_ALL */
551
552 /* return : 1 is equal, 0 if different */
553 XXH_PUBLIC_API int XXH128_isEqual(XXH128_hash_t h1, XXH128_hash_t h2);
554
555 /* This comparator is compatible with stdlib's qsort().
556 * return : >0 if *h128_1 > *h128_2
557 * <0 if *h128_1 < *h128_2
558 * =0 if *h128_1 == *h128_2 */
559 XXH_PUBLIC_API int XXH128_cmp(const void* h128_1, const void* h128_2);
560
561
562 /*====== Canonical representation ======*/
563 typedef struct { unsigned char digest[16]; } XXH128_canonical_t;
564 XXH_PUBLIC_API void XXH128_canonicalFromHash(XXH128_canonical_t* dst, XXH128_hash_t hash);
565 XXH_PUBLIC_API XXH128_hash_t XXH128_hashFromCanonical(const XXH128_canonical_t* src);
423566
424567
425568 #endif /* XXH_NO_LONG_LONG */
8989 target_triplet = @target@
9090 subdir = m4
9191 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
92 am__aclocal_m4_deps = $(top_srcdir)/configure.ac
92 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_compile_flag.m4 \
93 $(top_srcdir)/m4/ax_code_coverage.m4 \
94 $(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \
95 $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
96 $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
97 $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac
9398 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
9499 $(ACLOCAL_M4)
95100 DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
294299 exit 1;; \
295300 esac; \
296301 done; \
297 echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu m4/Makefile'; \
302 echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign m4/Makefile'; \
298303 $(am__cd) $(top_srcdir) && \
299 $(AUTOMAKE) --gnu m4/Makefile
304 $(AUTOMAKE) --foreign m4/Makefile
300305 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
301306 @case '$?' in \
302307 *config.status*) \
0 # ===========================================================================
1 # https://www.gnu.org/software/autoconf-archive/ax_check_compile_flag.html
2 # ===========================================================================
3 #
4 # SYNOPSIS
5 #
6 # AX_CHECK_COMPILE_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS], [INPUT])
7 #
8 # DESCRIPTION
9 #
10 # Check whether the given FLAG works with the current language's compiler
11 # or gives an error. (Warnings, however, are ignored)
12 #
13 # ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
14 # success/failure.
15 #
16 # If EXTRA-FLAGS is defined, it is added to the current language's default
17 # flags (e.g. CFLAGS) when the check is done. The check is thus made with
18 # the flags: "CFLAGS EXTRA-FLAGS FLAG". This can for example be used to
19 # force the compiler to issue an error when a bad flag is given.
20 #
21 # INPUT gives an alternative input source to AC_COMPILE_IFELSE.
22 #
23 # NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this
24 # macro in sync with AX_CHECK_{PREPROC,LINK}_FLAG.
25 #
26 # LICENSE
27 #
28 # Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
29 # Copyright (c) 2011 Maarten Bosmans <mkbosmans@gmail.com>
30 #
31 # Copying and distribution of this file, with or without modification, are
32 # permitted in any medium without royalty provided the copyright notice
33 # and this notice are preserved. This file is offered as-is, without any
34 # warranty.
35
36 #serial 6
37
38 AC_DEFUN([AX_CHECK_COMPILE_FLAG],
39 [AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_IF
40 AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_[]_AC_LANG_ABBREV[]flags_$4_$1])dnl
41 AC_CACHE_CHECK([whether _AC_LANG compiler accepts $1], CACHEVAR, [
42 ax_check_save_flags=$[]_AC_LANG_PREFIX[]FLAGS
43 _AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $4 $1"
44 AC_COMPILE_IFELSE([m4_default([$5],[AC_LANG_PROGRAM()])],
45 [AS_VAR_SET(CACHEVAR,[yes])],
46 [AS_VAR_SET(CACHEVAR,[no])])
47 _AC_LANG_PREFIX[]FLAGS=$ax_check_save_flags])
48 AS_VAR_IF(CACHEVAR,yes,
49 [m4_default([$2], :)],
50 [m4_default([$3], :)])
51 AS_VAR_POPDEF([CACHEVAR])dnl
52 ])dnl AX_CHECK_COMPILE_FLAGS
53
0 # ===========================================================================
1 # https://www.gnu.org/software/autoconf-archive/ax_code_coverage.html
2 # ===========================================================================
3 #
4 # SYNOPSIS
5 #
6 # AX_CODE_COVERAGE()
7 #
8 # DESCRIPTION
9 #
10 # Defines CODE_COVERAGE_CPPFLAGS, CODE_COVERAGE_CFLAGS,
11 # CODE_COVERAGE_CXXFLAGS and CODE_COVERAGE_LIBS which should be included
12 # in the CPPFLAGS, CFLAGS CXXFLAGS and LIBS/LIBADD variables of every
13 # build target (program or library) which should be built with code
14 # coverage support. Also defines CODE_COVERAGE_RULES which should be
15 # substituted in your Makefile; and $enable_code_coverage which can be
16 # used in subsequent configure output. CODE_COVERAGE_ENABLED is defined
17 # and substituted, and corresponds to the value of the
18 # --enable-code-coverage option, which defaults to being disabled.
19 #
20 # Test also for gcov program and create GCOV variable that could be
21 # substituted.
22 #
23 # Note that all optimization flags in CFLAGS must be disabled when code
24 # coverage is enabled.
25 #
26 # Usage example:
27 #
28 # configure.ac:
29 #
30 # AX_CODE_COVERAGE
31 #
32 # Makefile.am:
33 #
34 # @CODE_COVERAGE_RULES@
35 # my_program_LIBS = ... $(CODE_COVERAGE_LIBS) ...
36 # my_program_CPPFLAGS = ... $(CODE_COVERAGE_CPPFLAGS) ...
37 # my_program_CFLAGS = ... $(CODE_COVERAGE_CFLAGS) ...
38 # my_program_CXXFLAGS = ... $(CODE_COVERAGE_CXXFLAGS) ...
39 #
40 # This results in a "check-code-coverage" rule being added to any
41 # Makefile.am which includes "@CODE_COVERAGE_RULES@" (assuming the module
42 # has been configured with --enable-code-coverage). Running `make
43 # check-code-coverage` in that directory will run the module's test suite
44 # (`make check`) and build a code coverage report detailing the code which
45 # was touched, then print the URI for the report.
46 #
47 # In earlier versions of this macro, CODE_COVERAGE_LDFLAGS was defined
48 # instead of CODE_COVERAGE_LIBS. They are both still defined, but use of
49 # CODE_COVERAGE_LIBS is preferred for clarity; CODE_COVERAGE_LDFLAGS is
50 # deprecated. They have the same value.
51 #
52 # This code was derived from Makefile.decl in GLib, originally licenced
53 # under LGPLv2.1+.
54 #
55 # LICENSE
56 #
57 # Copyright (c) 2012, 2016 Philip Withnall
58 # Copyright (c) 2012 Xan Lopez
59 # Copyright (c) 2012 Christian Persch
60 # Copyright (c) 2012 Paolo Borelli
61 # Copyright (c) 2012 Dan Winship
62 # Copyright (c) 2015 Bastien ROUCARIES
63 #
64 # This library is free software; you can redistribute it and/or modify it
65 # under the terms of the GNU Lesser General Public License as published by
66 # the Free Software Foundation; either version 2.1 of the License, or (at
67 # your option) any later version.
68 #
69 # This library is distributed in the hope that it will be useful, but
70 # WITHOUT ANY WARRANTY; without even the implied warranty of
71 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
72 # General Public License for more details.
73 #
74 # You should have received a copy of the GNU Lesser General Public License
75 # along with this program. If not, see <https://www.gnu.org/licenses/>.
76
77 #serial 25
78
79 AC_DEFUN([AX_CODE_COVERAGE],[
80 dnl Check for --enable-code-coverage
81 AC_REQUIRE([AC_PROG_SED])
82
83 # allow to override gcov location
84 AC_ARG_WITH([gcov],
85 [AS_HELP_STRING([--with-gcov[=GCOV]], [use given GCOV for coverage (GCOV=gcov).])],
86 [_AX_CODE_COVERAGE_GCOV_PROG_WITH=$with_gcov],
87 [_AX_CODE_COVERAGE_GCOV_PROG_WITH=gcov])
88
89 AC_MSG_CHECKING([whether to build with code coverage support])
90 AC_ARG_ENABLE([code-coverage],
91 AS_HELP_STRING([--enable-code-coverage],
92 [Whether to enable code coverage support]),,
93 enable_code_coverage=no)
94
95 AM_CONDITIONAL([CODE_COVERAGE_ENABLED], [test x$enable_code_coverage = xyes])
96 AC_SUBST([CODE_COVERAGE_ENABLED], [$enable_code_coverage])
97 AC_MSG_RESULT($enable_code_coverage)
98
99 AS_IF([ test "$enable_code_coverage" = "yes" ], [
100 # check for gcov
101 AC_CHECK_TOOL([GCOV],
102 [$_AX_CODE_COVERAGE_GCOV_PROG_WITH],
103 [:])
104 AS_IF([test "X$GCOV" = "X:"],
105 [AC_MSG_ERROR([gcov is needed to do coverage])])
106 AC_SUBST([GCOV])
107
108 dnl Check if gcc is being used
109 AS_IF([ test "$GCC" = "no" ], [
110 AC_MSG_ERROR([not compiling with gcc, which is required for gcov code coverage])
111 ])
112
113 AC_CHECK_PROG([LCOV], [lcov], [lcov])
114 AC_CHECK_PROG([GENHTML], [genhtml], [genhtml])
115
116 AS_IF([ test -z "$LCOV" ], [
117 AC_MSG_ERROR([To enable code coverage reporting you must have lcov installed])
118 ])
119
120 AS_IF([ test -z "$GENHTML" ], [
121 AC_MSG_ERROR([Could not find genhtml from the lcov package])
122 ])
123
124 dnl Build the code coverage flags
125 dnl Define CODE_COVERAGE_LDFLAGS for backwards compatibility
126 CODE_COVERAGE_CPPFLAGS="-DNDEBUG"
127 CODE_COVERAGE_CFLAGS="-O0 -g -fprofile-arcs -ftest-coverage"
128 CODE_COVERAGE_CXXFLAGS="-O0 -g -fprofile-arcs -ftest-coverage"
129 CODE_COVERAGE_LIBS="-lgcov"
130 CODE_COVERAGE_LDFLAGS="$CODE_COVERAGE_LIBS"
131
132 AC_SUBST([CODE_COVERAGE_CPPFLAGS])
133 AC_SUBST([CODE_COVERAGE_CFLAGS])
134 AC_SUBST([CODE_COVERAGE_CXXFLAGS])
135 AC_SUBST([CODE_COVERAGE_LIBS])
136 AC_SUBST([CODE_COVERAGE_LDFLAGS])
137
138 [CODE_COVERAGE_RULES_CHECK='
139 -$(A''M_V_at)$(MAKE) $(AM_MAKEFLAGS) -k check
140 $(A''M_V_at)$(MAKE) $(AM_MAKEFLAGS) code-coverage-capture
141 ']
142 [CODE_COVERAGE_RULES_CAPTURE='
143 $(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)
144 $(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)
145 -@rm -f $(CODE_COVERAGE_OUTPUT_FILE).tmp
146 $(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)
147 @echo "file://$(abs_builddir)/$(CODE_COVERAGE_OUTPUT_DIRECTORY)/index.html"
148 ']
149 [CODE_COVERAGE_RULES_CLEAN='
150 clean: code-coverage-clean
151 distclean: code-coverage-clean
152 code-coverage-clean:
153 -$(LCOV) --directory $(top_builddir) -z
154 -rm -rf $(CODE_COVERAGE_OUTPUT_FILE) $(CODE_COVERAGE_OUTPUT_FILE).tmp $(CODE_COVERAGE_OUTPUT_DIRECTORY)
155 -find . \( -name "*.gcda" -o -name "*.gcno" -o -name "*.gcov" \) -delete
156 ']
157 ], [
158 [CODE_COVERAGE_RULES_CHECK='
159 @echo "Need to reconfigure with --enable-code-coverage"
160 ']
161 CODE_COVERAGE_RULES_CAPTURE="$CODE_COVERAGE_RULES_CHECK"
162 CODE_COVERAGE_RULES_CLEAN=''
163 ])
164
165 [CODE_COVERAGE_RULES='
166 # Code coverage
167 #
168 # Optional:
169 # - CODE_COVERAGE_DIRECTORY: Top-level directory for code coverage reporting.
170 # Multiple directories may be specified, separated by whitespace.
171 # (Default: $(top_builddir))
172 # - CODE_COVERAGE_OUTPUT_FILE: Filename and path for the .info file generated
173 # by lcov for code coverage. (Default:
174 # $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage.info)
175 # - CODE_COVERAGE_OUTPUT_DIRECTORY: Directory for generated code coverage
176 # reports to be created. (Default:
177 # $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage)
178 # - CODE_COVERAGE_BRANCH_COVERAGE: Set to 1 to enforce branch coverage,
179 # set to 0 to disable it and leave empty to stay with the default.
180 # (Default: empty)
181 # - CODE_COVERAGE_LCOV_SHOPTS_DEFAULT: Extra options shared between both lcov
182 # instances. (Default: based on $CODE_COVERAGE_BRANCH_COVERAGE)
183 # - CODE_COVERAGE_LCOV_SHOPTS: Extra options to shared between both lcov
184 # instances. (Default: $CODE_COVERAGE_LCOV_SHOPTS_DEFAULT)
185 # - CODE_COVERAGE_LCOV_OPTIONS_GCOVPATH: --gcov-tool pathtogcov
186 # - CODE_COVERAGE_LCOV_OPTIONS_DEFAULT: Extra options to pass to the
187 # collecting lcov instance. (Default: $CODE_COVERAGE_LCOV_OPTIONS_GCOVPATH)
188 # - CODE_COVERAGE_LCOV_OPTIONS: Extra options to pass to the collecting lcov
189 # instance. (Default: $CODE_COVERAGE_LCOV_OPTIONS_DEFAULT)
190 # - CODE_COVERAGE_LCOV_RMOPTS_DEFAULT: Extra options to pass to the filtering
191 # lcov instance. (Default: empty)
192 # - CODE_COVERAGE_LCOV_RMOPTS: Extra options to pass to the filtering lcov
193 # instance. (Default: $CODE_COVERAGE_LCOV_RMOPTS_DEFAULT)
194 # - CODE_COVERAGE_GENHTML_OPTIONS_DEFAULT: Extra options to pass to the
195 # genhtml instance. (Default: based on $CODE_COVERAGE_BRANCH_COVERAGE)
196 # - CODE_COVERAGE_GENHTML_OPTIONS: Extra options to pass to the genhtml
197 # instance. (Default: $CODE_COVERAGE_GENHTML_OPTIONS_DEFAULT)
198 # - CODE_COVERAGE_IGNORE_PATTERN: Extra glob pattern of files to ignore
199 #
200 # The generated report will be titled using the $(PACKAGE_NAME) and
201 # $(PACKAGE_VERSION). In order to add the current git hash to the title,
202 # use the git-version-gen script, available online.
203
204 # Optional variables
205 CODE_COVERAGE_DIRECTORY ?= $(top_builddir)
206 CODE_COVERAGE_OUTPUT_FILE ?= $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage.info
207 CODE_COVERAGE_OUTPUT_DIRECTORY ?= $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage
208 CODE_COVERAGE_BRANCH_COVERAGE ?=
209 CODE_COVERAGE_LCOV_SHOPTS_DEFAULT ?= $(if $(CODE_COVERAGE_BRANCH_COVERAGE),\
210 --rc lcov_branch_coverage=$(CODE_COVERAGE_BRANCH_COVERAGE))
211 CODE_COVERAGE_LCOV_SHOPTS ?= $(CODE_COVERAGE_LCOV_SHOPTS_DEFAULT)
212 CODE_COVERAGE_LCOV_OPTIONS_GCOVPATH ?= --gcov-tool "$(GCOV)"
213 CODE_COVERAGE_LCOV_OPTIONS_DEFAULT ?= $(CODE_COVERAGE_LCOV_OPTIONS_GCOVPATH)
214 CODE_COVERAGE_LCOV_OPTIONS ?= $(CODE_COVERAGE_LCOV_OPTIONS_DEFAULT)
215 CODE_COVERAGE_LCOV_RMOPTS_DEFAULT ?=
216 CODE_COVERAGE_LCOV_RMOPTS ?= $(CODE_COVERAGE_LCOV_RMOPTS_DEFAULT)
217 CODE_COVERAGE_GENHTML_OPTIONS_DEFAULT ?=\
218 $(if $(CODE_COVERAGE_BRANCH_COVERAGE),\
219 --rc genhtml_branch_coverage=$(CODE_COVERAGE_BRANCH_COVERAGE))
220 CODE_COVERAGE_GENHTML_OPTIONS ?= $(CODE_COVERAGE_GENHTML_OPTIONS_DEFAULT)
221 CODE_COVERAGE_IGNORE_PATTERN ?=
222
223 GITIGNOREFILES ?=
224 GITIGNOREFILES += $(CODE_COVERAGE_OUTPUT_FILE) $(CODE_COVERAGE_OUTPUT_DIRECTORY)
225
226 code_coverage_v_lcov_cap = $(code_coverage_v_lcov_cap_$(V))
227 code_coverage_v_lcov_cap_ = $(code_coverage_v_lcov_cap_$(AM_DEFAULT_VERBOSITY))
228 code_coverage_v_lcov_cap_0 = @echo " LCOV --capture"\
229 $(CODE_COVERAGE_OUTPUT_FILE);
230 code_coverage_v_lcov_ign = $(code_coverage_v_lcov_ign_$(V))
231 code_coverage_v_lcov_ign_ = $(code_coverage_v_lcov_ign_$(AM_DEFAULT_VERBOSITY))
232 code_coverage_v_lcov_ign_0 = @echo " LCOV --remove /tmp/*"\
233 $(CODE_COVERAGE_IGNORE_PATTERN);
234 code_coverage_v_genhtml = $(code_coverage_v_genhtml_$(V))
235 code_coverage_v_genhtml_ = $(code_coverage_v_genhtml_$(AM_DEFAULT_VERBOSITY))
236 code_coverage_v_genhtml_0 = @echo " GEN " $(CODE_COVERAGE_OUTPUT_DIRECTORY);
237 code_coverage_quiet = $(code_coverage_quiet_$(V))
238 code_coverage_quiet_ = $(code_coverage_quiet_$(AM_DEFAULT_VERBOSITY))
239 code_coverage_quiet_0 = --quiet
240
241 # sanitizes the test-name: replaces with underscores: dashes and dots
242 code_coverage_sanitize = $(subst -,_,$(subst .,_,$(1)))
243
244 # Use recursive makes in order to ignore errors during check
245 check-code-coverage:'"$CODE_COVERAGE_RULES_CHECK"'
246
247 # Capture code coverage data
248 code-coverage-capture: code-coverage-capture-hook'"$CODE_COVERAGE_RULES_CAPTURE"'
249
250 # Hook rule executed before code-coverage-capture, overridable by the user
251 code-coverage-capture-hook:
252
253 '"$CODE_COVERAGE_RULES_CLEAN"'
254
255 A''M_DISTCHECK_CONFIGURE_FLAGS ?=
256 A''M_DISTCHECK_CONFIGURE_FLAGS += --disable-code-coverage
257
258 .PHONY: check-code-coverage code-coverage-capture code-coverage-capture-hook code-coverage-clean
259 ']
260
261 AC_SUBST([CODE_COVERAGE_RULES])
262 m4_ifdef([_AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE([CODE_COVERAGE_RULES])])
263 ])
0 # ===========================================================================
1 # https://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx.html
2 # ===========================================================================
3 #
4 # SYNOPSIS
5 #
6 # AX_CXX_COMPILE_STDCXX(VERSION, [ext|noext], [mandatory|optional])
7 #
8 # DESCRIPTION
9 #
10 # Check for baseline language coverage in the compiler for the specified
11 # version of the C++ standard. If necessary, add switches to CXX and
12 # CXXCPP to enable support. VERSION may be '11' (for the C++11 standard)
13 # or '14' (for the C++14 standard).
14 #
15 # The second argument, if specified, indicates whether you insist on an
16 # extended mode (e.g. -std=gnu++11) or a strict conformance mode (e.g.
17 # -std=c++11). If neither is specified, you get whatever works, with
18 # preference for an extended mode.
19 #
20 # The third argument, if specified 'mandatory' or if left unspecified,
21 # indicates that baseline support for the specified C++ standard is
22 # required and that the macro should error out if no mode with that
23 # support is found. If specified 'optional', then configuration proceeds
24 # regardless, after defining HAVE_CXX${VERSION} if and only if a
25 # supporting mode is found.
26 #
27 # LICENSE
28 #
29 # Copyright (c) 2008 Benjamin Kosnik <bkoz@redhat.com>
30 # Copyright (c) 2012 Zack Weinberg <zackw@panix.com>
31 # Copyright (c) 2013 Roy Stogner <roystgnr@ices.utexas.edu>
32 # Copyright (c) 2014, 2015 Google Inc.; contributed by Alexey Sokolov <sokolov@google.com>
33 # Copyright (c) 2015 Paul Norman <penorman@mac.com>
34 # Copyright (c) 2015 Moritz Klammler <moritz@klammler.eu>
35 # Copyright (c) 2016, 2018 Krzesimir Nowak <qdlacz@gmail.com>
36 # Copyright (c) 2019 Enji Cooper <yaneurabeya@gmail.com>
37 #
38 # Copying and distribution of this file, with or without modification, are
39 # permitted in any medium without royalty provided the copyright notice
40 # and this notice are preserved. This file is offered as-is, without any
41 # warranty.
42
43 #serial 11
44
45 dnl This macro is based on the code from the AX_CXX_COMPILE_STDCXX_11 macro
46 dnl (serial version number 13).
47
48 AC_DEFUN([AX_CXX_COMPILE_STDCXX], [dnl
49 m4_if([$1], [11], [ax_cxx_compile_alternatives="11 0x"],
50 [$1], [14], [ax_cxx_compile_alternatives="14 1y"],
51 [$1], [17], [ax_cxx_compile_alternatives="17 1z"],
52 [m4_fatal([invalid first argument `$1' to AX_CXX_COMPILE_STDCXX])])dnl
53 m4_if([$2], [], [],
54 [$2], [ext], [],
55 [$2], [noext], [],
56 [m4_fatal([invalid second argument `$2' to AX_CXX_COMPILE_STDCXX])])dnl
57 m4_if([$3], [], [ax_cxx_compile_cxx$1_required=true],
58 [$3], [mandatory], [ax_cxx_compile_cxx$1_required=true],
59 [$3], [optional], [ax_cxx_compile_cxx$1_required=false],
60 [m4_fatal([invalid third argument `$3' to AX_CXX_COMPILE_STDCXX])])
61 AC_LANG_PUSH([C++])dnl
62 ac_success=no
63
64 m4_if([$2], [noext], [], [dnl
65 if test x$ac_success = xno; then
66 for alternative in ${ax_cxx_compile_alternatives}; do
67 switch="-std=gnu++${alternative}"
68 cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx$1_$switch])
69 AC_CACHE_CHECK(whether $CXX supports C++$1 features with $switch,
70 $cachevar,
71 [ac_save_CXX="$CXX"
72 CXX="$CXX $switch"
73 AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])],
74 [eval $cachevar=yes],
75 [eval $cachevar=no])
76 CXX="$ac_save_CXX"])
77 if eval test x\$$cachevar = xyes; then
78 CXX="$CXX $switch"
79 if test -n "$CXXCPP" ; then
80 CXXCPP="$CXXCPP $switch"
81 fi
82 ac_success=yes
83 break
84 fi
85 done
86 fi])
87
88 m4_if([$2], [ext], [], [dnl
89 if test x$ac_success = xno; then
90 dnl HP's aCC needs +std=c++11 according to:
91 dnl http://h21007.www2.hp.com/portal/download/files/unprot/aCxx/PDF_Release_Notes/769149-001.pdf
92 dnl Cray's crayCC needs "-h std=c++11"
93 for alternative in ${ax_cxx_compile_alternatives}; do
94 for switch in -std=c++${alternative} +std=c++${alternative} "-h std=c++${alternative}"; do
95 cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx$1_$switch])
96 AC_CACHE_CHECK(whether $CXX supports C++$1 features with $switch,
97 $cachevar,
98 [ac_save_CXX="$CXX"
99 CXX="$CXX $switch"
100 AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])],
101 [eval $cachevar=yes],
102 [eval $cachevar=no])
103 CXX="$ac_save_CXX"])
104 if eval test x\$$cachevar = xyes; then
105 CXX="$CXX $switch"
106 if test -n "$CXXCPP" ; then
107 CXXCPP="$CXXCPP $switch"
108 fi
109 ac_success=yes
110 break
111 fi
112 done
113 if test x$ac_success = xyes; then
114 break
115 fi
116 done
117 fi])
118 AC_LANG_POP([C++])
119 if test x$ax_cxx_compile_cxx$1_required = xtrue; then
120 if test x$ac_success = xno; then
121 AC_MSG_ERROR([*** A compiler with support for C++$1 language features is required.])
122 fi
123 fi
124 if test x$ac_success = xno; then
125 HAVE_CXX$1=0
126 AC_MSG_NOTICE([No compiler with C++$1 support was found])
127 else
128 HAVE_CXX$1=1
129 AC_DEFINE(HAVE_CXX$1,1,
130 [define if the compiler supports basic C++$1 syntax])
131 fi
132 AC_SUBST(HAVE_CXX$1)
133 ])
134
135
136 dnl Test body for checking C++11 support
137
138 m4_define([_AX_CXX_COMPILE_STDCXX_testbody_11],
139 _AX_CXX_COMPILE_STDCXX_testbody_new_in_11
140 )
141
142
143 dnl Test body for checking C++14 support
144
145 m4_define([_AX_CXX_COMPILE_STDCXX_testbody_14],
146 _AX_CXX_COMPILE_STDCXX_testbody_new_in_11
147 _AX_CXX_COMPILE_STDCXX_testbody_new_in_14
148 )
149
150 m4_define([_AX_CXX_COMPILE_STDCXX_testbody_17],
151 _AX_CXX_COMPILE_STDCXX_testbody_new_in_11
152 _AX_CXX_COMPILE_STDCXX_testbody_new_in_14
153 _AX_CXX_COMPILE_STDCXX_testbody_new_in_17
154 )
155
156 dnl Tests for new features in C++11
157
158 m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_11], [[
159
160 // If the compiler admits that it is not ready for C++11, why torture it?
161 // Hopefully, this will speed up the test.
162
163 #ifndef __cplusplus
164
165 #error "This is not a C++ compiler"
166
167 #elif __cplusplus < 201103L
168
169 #error "This is not a C++11 compiler"
170
171 #else
172
173 namespace cxx11
174 {
175
176 namespace test_static_assert
177 {
178
179 template <typename T>
180 struct check
181 {
182 static_assert(sizeof(int) <= sizeof(T), "not big enough");
183 };
184
185 }
186
187 namespace test_final_override
188 {
189
190 struct Base
191 {
192 virtual ~Base() {}
193 virtual void f() {}
194 };
195
196 struct Derived : public Base
197 {
198 virtual ~Derived() override {}
199 virtual void f() override {}
200 };
201
202 }
203
204 namespace test_double_right_angle_brackets
205 {
206
207 template < typename T >
208 struct check {};
209
210 typedef check<void> single_type;
211 typedef check<check<void>> double_type;
212 typedef check<check<check<void>>> triple_type;
213 typedef check<check<check<check<void>>>> quadruple_type;
214
215 }
216
217 namespace test_decltype
218 {
219
220 int
221 f()
222 {
223 int a = 1;
224 decltype(a) b = 2;
225 return a + b;
226 }
227
228 }
229
230 namespace test_type_deduction
231 {
232
233 template < typename T1, typename T2 >
234 struct is_same
235 {
236 static const bool value = false;
237 };
238
239 template < typename T >
240 struct is_same<T, T>
241 {
242 static const bool value = true;
243 };
244
245 template < typename T1, typename T2 >
246 auto
247 add(T1 a1, T2 a2) -> decltype(a1 + a2)
248 {
249 return a1 + a2;
250 }
251
252 int
253 test(const int c, volatile int v)
254 {
255 static_assert(is_same<int, decltype(0)>::value == true, "");
256 static_assert(is_same<int, decltype(c)>::value == false, "");
257 static_assert(is_same<int, decltype(v)>::value == false, "");
258 auto ac = c;
259 auto av = v;
260 auto sumi = ac + av + 'x';
261 auto sumf = ac + av + 1.0;
262 static_assert(is_same<int, decltype(ac)>::value == true, "");
263 static_assert(is_same<int, decltype(av)>::value == true, "");
264 static_assert(is_same<int, decltype(sumi)>::value == true, "");
265 static_assert(is_same<int, decltype(sumf)>::value == false, "");
266 static_assert(is_same<int, decltype(add(c, v))>::value == true, "");
267 return (sumf > 0.0) ? sumi : add(c, v);
268 }
269
270 }
271
272 namespace test_noexcept
273 {
274
275 int f() { return 0; }
276 int g() noexcept { return 0; }
277
278 static_assert(noexcept(f()) == false, "");
279 static_assert(noexcept(g()) == true, "");
280
281 }
282
283 namespace test_constexpr
284 {
285
286 template < typename CharT >
287 unsigned long constexpr
288 strlen_c_r(const CharT *const s, const unsigned long acc) noexcept
289 {
290 return *s ? strlen_c_r(s + 1, acc + 1) : acc;
291 }
292
293 template < typename CharT >
294 unsigned long constexpr
295 strlen_c(const CharT *const s) noexcept
296 {
297 return strlen_c_r(s, 0UL);
298 }
299
300 static_assert(strlen_c("") == 0UL, "");
301 static_assert(strlen_c("1") == 1UL, "");
302 static_assert(strlen_c("example") == 7UL, "");
303 static_assert(strlen_c("another\0example") == 7UL, "");
304
305 }
306
307 namespace test_rvalue_references
308 {
309
310 template < int N >
311 struct answer
312 {
313 static constexpr int value = N;
314 };
315
316 answer<1> f(int&) { return answer<1>(); }
317 answer<2> f(const int&) { return answer<2>(); }
318 answer<3> f(int&&) { return answer<3>(); }
319
320 void
321 test()
322 {
323 int i = 0;
324 const int c = 0;
325 static_assert(decltype(f(i))::value == 1, "");
326 static_assert(decltype(f(c))::value == 2, "");
327 static_assert(decltype(f(0))::value == 3, "");
328 }
329
330 }
331
332 namespace test_uniform_initialization
333 {
334
335 struct test
336 {
337 static const int zero {};
338 static const int one {1};
339 };
340
341 static_assert(test::zero == 0, "");
342 static_assert(test::one == 1, "");
343
344 }
345
346 namespace test_lambdas
347 {
348
349 void
350 test1()
351 {
352 auto lambda1 = [](){};
353 auto lambda2 = lambda1;
354 lambda1();
355 lambda2();
356 }
357
358 int
359 test2()
360 {
361 auto a = [](int i, int j){ return i + j; }(1, 2);
362 auto b = []() -> int { return '0'; }();
363 auto c = [=](){ return a + b; }();
364 auto d = [&](){ return c; }();
365 auto e = [a, &b](int x) mutable {
366 const auto identity = [](int y){ return y; };
367 for (auto i = 0; i < a; ++i)
368 a += b--;
369 return x + identity(a + b);
370 }(0);
371 return a + b + c + d + e;
372 }
373
374 int
375 test3()
376 {
377 const auto nullary = [](){ return 0; };
378 const auto unary = [](int x){ return x; };
379 using nullary_t = decltype(nullary);
380 using unary_t = decltype(unary);
381 const auto higher1st = [](nullary_t f){ return f(); };
382 const auto higher2nd = [unary](nullary_t f1){
383 return [unary, f1](unary_t f2){ return f2(unary(f1())); };
384 };
385 return higher1st(nullary) + higher2nd(nullary)(unary);
386 }
387
388 }
389
390 namespace test_variadic_templates
391 {
392
393 template <int...>
394 struct sum;
395
396 template <int N0, int... N1toN>
397 struct sum<N0, N1toN...>
398 {
399 static constexpr auto value = N0 + sum<N1toN...>::value;
400 };
401
402 template <>
403 struct sum<>
404 {
405 static constexpr auto value = 0;
406 };
407
408 static_assert(sum<>::value == 0, "");
409 static_assert(sum<1>::value == 1, "");
410 static_assert(sum<23>::value == 23, "");
411 static_assert(sum<1, 2>::value == 3, "");
412 static_assert(sum<5, 5, 11>::value == 21, "");
413 static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, "");
414
415 }
416
417 // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae
418 // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function
419 // because of this.
420 namespace test_template_alias_sfinae
421 {
422
423 struct foo {};
424
425 template<typename T>
426 using member = typename T::member_type;
427
428 template<typename T>
429 void func(...) {}
430
431 template<typename T>
432 void func(member<T>*) {}
433
434 void test();
435
436 void test() { func<foo>(0); }
437
438 }
439
440 } // namespace cxx11
441
442 #endif // __cplusplus >= 201103L
443
444 ]])
445
446
447 dnl Tests for new features in C++14
448
449 m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_14], [[
450
451 // If the compiler admits that it is not ready for C++14, why torture it?
452 // Hopefully, this will speed up the test.
453
454 #ifndef __cplusplus
455
456 #error "This is not a C++ compiler"
457
458 #elif __cplusplus < 201402L
459
460 #error "This is not a C++14 compiler"
461
462 #else
463
464 namespace cxx14
465 {
466
467 namespace test_polymorphic_lambdas
468 {
469
470 int
471 test()
472 {
473 const auto lambda = [](auto&&... args){
474 const auto istiny = [](auto x){
475 return (sizeof(x) == 1UL) ? 1 : 0;
476 };
477 const int aretiny[] = { istiny(args)... };
478 return aretiny[0];
479 };
480 return lambda(1, 1L, 1.0f, '1');
481 }
482
483 }
484
485 namespace test_binary_literals
486 {
487
488 constexpr auto ivii = 0b0000000000101010;
489 static_assert(ivii == 42, "wrong value");
490
491 }
492
493 namespace test_generalized_constexpr
494 {
495
496 template < typename CharT >
497 constexpr unsigned long
498 strlen_c(const CharT *const s) noexcept
499 {
500 auto length = 0UL;
501 for (auto p = s; *p; ++p)
502 ++length;
503 return length;
504 }
505
506 static_assert(strlen_c("") == 0UL, "");
507 static_assert(strlen_c("x") == 1UL, "");
508 static_assert(strlen_c("test") == 4UL, "");
509 static_assert(strlen_c("another\0test") == 7UL, "");
510
511 }
512
513 namespace test_lambda_init_capture
514 {
515
516 int
517 test()
518 {
519 auto x = 0;
520 const auto lambda1 = [a = x](int b){ return a + b; };
521 const auto lambda2 = [a = lambda1(x)](){ return a; };
522 return lambda2();
523 }
524
525 }
526
527 namespace test_digit_separators
528 {
529
530 constexpr auto ten_million = 100'000'000;
531 static_assert(ten_million == 100000000, "");
532
533 }
534
535 namespace test_return_type_deduction
536 {
537
538 auto f(int& x) { return x; }
539 decltype(auto) g(int& x) { return x; }
540
541 template < typename T1, typename T2 >
542 struct is_same
543 {
544 static constexpr auto value = false;
545 };
546
547 template < typename T >
548 struct is_same<T, T>
549 {
550 static constexpr auto value = true;
551 };
552
553 int
554 test()
555 {
556 auto x = 0;
557 static_assert(is_same<int, decltype(f(x))>::value, "");
558 static_assert(is_same<int&, decltype(g(x))>::value, "");
559 return x;
560 }
561
562 }
563
564 } // namespace cxx14
565
566 #endif // __cplusplus >= 201402L
567
568 ]])
569
570
571 dnl Tests for new features in C++17
572
573 m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_17], [[
574
575 // If the compiler admits that it is not ready for C++17, why torture it?
576 // Hopefully, this will speed up the test.
577
578 #ifndef __cplusplus
579
580 #error "This is not a C++ compiler"
581
582 #elif __cplusplus < 201703L
583
584 #error "This is not a C++17 compiler"
585
586 #else
587
588 #include <initializer_list>
589 #include <utility>
590 #include <type_traits>
591
592 namespace cxx17
593 {
594
595 namespace test_constexpr_lambdas
596 {
597
598 constexpr int foo = [](){return 42;}();
599
600 }
601
602 namespace test::nested_namespace::definitions
603 {
604
605 }
606
607 namespace test_fold_expression
608 {
609
610 template<typename... Args>
611 int multiply(Args... args)
612 {
613 return (args * ... * 1);
614 }
615
616 template<typename... Args>
617 bool all(Args... args)
618 {
619 return (args && ...);
620 }
621
622 }
623
624 namespace test_extended_static_assert
625 {
626
627 static_assert (true);
628
629 }
630
631 namespace test_auto_brace_init_list
632 {
633
634 auto foo = {5};
635 auto bar {5};
636
637 static_assert(std::is_same<std::initializer_list<int>, decltype(foo)>::value);
638 static_assert(std::is_same<int, decltype(bar)>::value);
639 }
640
641 namespace test_typename_in_template_template_parameter
642 {
643
644 template<template<typename> typename X> struct D;
645
646 }
647
648 namespace test_fallthrough_nodiscard_maybe_unused_attributes
649 {
650
651 int f1()
652 {
653 return 42;
654 }
655
656 [[nodiscard]] int f2()
657 {
658 [[maybe_unused]] auto unused = f1();
659
660 switch (f1())
661 {
662 case 17:
663 f1();
664 [[fallthrough]];
665 case 42:
666 f1();
667 }
668 return f1();
669 }
670
671 }
672
673 namespace test_extended_aggregate_initialization
674 {
675
676 struct base1
677 {
678 int b1, b2 = 42;
679 };
680
681 struct base2
682 {
683 base2() {
684 b3 = 42;
685 }
686 int b3;
687 };
688
689 struct derived : base1, base2
690 {
691 int d;
692 };
693
694 derived d1 {{1, 2}, {}, 4}; // full initialization
695 derived d2 {{}, {}, 4}; // value-initialized bases
696
697 }
698
699 namespace test_general_range_based_for_loop
700 {
701
702 struct iter
703 {
704 int i;
705
706 int& operator* ()
707 {
708 return i;
709 }
710
711 const int& operator* () const
712 {
713 return i;
714 }
715
716 iter& operator++()
717 {
718 ++i;
719 return *this;
720 }
721 };
722
723 struct sentinel
724 {
725 int i;
726 };
727
728 bool operator== (const iter& i, const sentinel& s)
729 {
730 return i.i == s.i;
731 }
732
733 bool operator!= (const iter& i, const sentinel& s)
734 {
735 return !(i == s);
736 }
737
738 struct range
739 {
740 iter begin() const
741 {
742 return {0};
743 }
744
745 sentinel end() const
746 {
747 return {5};
748 }
749 };
750
751 void f()
752 {
753 range r {};
754
755 for (auto i : r)
756 {
757 [[maybe_unused]] auto v = i;
758 }
759 }
760
761 }
762
763 namespace test_lambda_capture_asterisk_this_by_value
764 {
765
766 struct t
767 {
768 int i;
769 int foo()
770 {
771 return [*this]()
772 {
773 return i;
774 }();
775 }
776 };
777
778 }
779
780 namespace test_enum_class_construction
781 {
782
783 enum class byte : unsigned char
784 {};
785
786 byte foo {42};
787
788 }
789
790 namespace test_constexpr_if
791 {
792
793 template <bool cond>
794 int f ()
795 {
796 if constexpr(cond)
797 {
798 return 13;
799 }
800 else
801 {
802 return 42;
803 }
804 }
805
806 }
807
808 namespace test_selection_statement_with_initializer
809 {
810
811 int f()
812 {
813 return 13;
814 }
815
816 int f2()
817 {
818 if (auto i = f(); i > 0)
819 {
820 return 3;
821 }
822
823 switch (auto i = f(); i + 4)
824 {
825 case 17:
826 return 2;
827
828 default:
829 return 1;
830 }
831 }
832
833 }
834
835 namespace test_template_argument_deduction_for_class_templates
836 {
837
838 template <typename T1, typename T2>
839 struct pair
840 {
841 pair (T1 p1, T2 p2)
842 : m1 {p1},
843 m2 {p2}
844 {}
845
846 T1 m1;
847 T2 m2;
848 };
849
850 void f()
851 {
852 [[maybe_unused]] auto p = pair{13, 42u};
853 }
854
855 }
856
857 namespace test_non_type_auto_template_parameters
858 {
859
860 template <auto n>
861 struct B
862 {};
863
864 B<5> b1;
865 B<'a'> b2;
866
867 }
868
869 namespace test_structured_bindings
870 {
871
872 int arr[2] = { 1, 2 };
873 std::pair<int, int> pr = { 1, 2 };
874
875 auto f1() -> int(&)[2]
876 {
877 return arr;
878 }
879
880 auto f2() -> std::pair<int, int>&
881 {
882 return pr;
883 }
884
885 struct S
886 {
887 int x1 : 2;
888 volatile double y1;
889 };
890
891 S f3()
892 {
893 return {};
894 }
895
896 auto [ x1, y1 ] = f1();
897 auto& [ xr1, yr1 ] = f1();
898 auto [ x2, y2 ] = f2();
899 auto& [ xr2, yr2 ] = f2();
900 const auto [ x3, y3 ] = f3();
901
902 }
903
904 namespace test_exception_spec_type_system
905 {
906
907 struct Good {};
908 struct Bad {};
909
910 void g1() noexcept;
911 void g2();
912
913 template<typename T>
914 Bad
915 f(T*, T*);
916
917 template<typename T1, typename T2>
918 Good
919 f(T1*, T2*);
920
921 static_assert (std::is_same_v<Good, decltype(f(g1, g2))>);
922
923 }
924
925 namespace test_inline_variables
926 {
927
928 template<class T> void f(T)
929 {}
930
931 template<class T> inline T g(T)
932 {
933 return T{};
934 }
935
936 template<> inline void f<>(int)
937 {}
938
939 template<> int g<>(int)
940 {
941 return 5;
942 }
943
944 }
945
946 } // namespace cxx17
947
948 #endif // __cplusplus < 201703L
949
950 ]])
0 # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
1 #
2 # Copyright (C) 1996-2001, 2003-2015 Free Software Foundation, Inc.
3 # Written by Gordon Matzigkeit, 1996
4 #
5 # This file is free software; the Free Software Foundation gives
6 # unlimited permission to copy and/or distribute it, with or without
7 # modifications, as long as this notice is preserved.
8
9 m4_define([_LT_COPYING], [dnl
10 # Copyright (C) 2014 Free Software Foundation, Inc.
11 # This is free software; see the source for copying conditions. There is NO
12 # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13
14 # GNU Libtool is free software; you can redistribute it and/or modify
15 # it under the terms of the GNU General Public License as published by
16 # the Free Software Foundation; either version 2 of of the License, or
17 # (at your option) any later version.
18 #
19 # As a special exception to the GNU General Public License, if you
20 # distribute this file as part of a program or library that is built
21 # using GNU Libtool, you may include this file under the same
22 # distribution terms that you use for the rest of that program.
23 #
24 # GNU Libtool is distributed in the hope that it will be useful, but
25 # WITHOUT ANY WARRANTY; without even the implied warranty of
26 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27 # GNU General Public License for more details.
28 #
29 # You should have received a copy of the GNU General Public License
30 # along with this program. If not, see <http://www.gnu.org/licenses/>.
31 ])
32
33 # serial 58 LT_INIT
34
35
36 # LT_PREREQ(VERSION)
37 # ------------------
38 # Complain and exit if this libtool version is less that VERSION.
39 m4_defun([LT_PREREQ],
40 [m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
41 [m4_default([$3],
42 [m4_fatal([Libtool version $1 or higher is required],
43 63)])],
44 [$2])])
45
46
47 # _LT_CHECK_BUILDDIR
48 # ------------------
49 # Complain if the absolute build directory name contains unusual characters
50 m4_defun([_LT_CHECK_BUILDDIR],
51 [case `pwd` in
52 *\ * | *\ *)
53 AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
54 esac
55 ])
56
57
58 # LT_INIT([OPTIONS])
59 # ------------------
60 AC_DEFUN([LT_INIT],
61 [AC_PREREQ([2.62])dnl We use AC_PATH_PROGS_FEATURE_CHECK
62 AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
63 AC_BEFORE([$0], [LT_LANG])dnl
64 AC_BEFORE([$0], [LT_OUTPUT])dnl
65 AC_BEFORE([$0], [LTDL_INIT])dnl
66 m4_require([_LT_CHECK_BUILDDIR])dnl
67
68 dnl Autoconf doesn't catch unexpanded LT_ macros by default:
69 m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
70 m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
71 dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
72 dnl unless we require an AC_DEFUNed macro:
73 AC_REQUIRE([LTOPTIONS_VERSION])dnl
74 AC_REQUIRE([LTSUGAR_VERSION])dnl
75 AC_REQUIRE([LTVERSION_VERSION])dnl
76 AC_REQUIRE([LTOBSOLETE_VERSION])dnl
77 m4_require([_LT_PROG_LTMAIN])dnl
78
79 _LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}])
80
81 dnl Parse OPTIONS
82 _LT_SET_OPTIONS([$0], [$1])
83
84 # This can be used to rebuild libtool when needed
85 LIBTOOL_DEPS=$ltmain
86
87 # Always use our own libtool.
88 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
89 AC_SUBST(LIBTOOL)dnl
90
91 _LT_SETUP
92
93 # Only expand once:
94 m4_define([LT_INIT])
95 ])# LT_INIT
96
97 # Old names:
98 AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
99 AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
100 dnl aclocal-1.4 backwards compatibility:
101 dnl AC_DEFUN([AC_PROG_LIBTOOL], [])
102 dnl AC_DEFUN([AM_PROG_LIBTOOL], [])
103
104
105 # _LT_PREPARE_CC_BASENAME
106 # -----------------------
107 m4_defun([_LT_PREPARE_CC_BASENAME], [
108 # Calculate cc_basename. Skip known compiler wrappers and cross-prefix.
109 func_cc_basename ()
110 {
111 for cc_temp in @S|@*""; do
112 case $cc_temp in
113 compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
114 distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
115 \-*) ;;
116 *) break;;
117 esac
118 done
119 func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
120 }
121 ])# _LT_PREPARE_CC_BASENAME
122
123
124 # _LT_CC_BASENAME(CC)
125 # -------------------
126 # It would be clearer to call AC_REQUIREs from _LT_PREPARE_CC_BASENAME,
127 # but that macro is also expanded into generated libtool script, which
128 # arranges for $SED and $ECHO to be set by different means.
129 m4_defun([_LT_CC_BASENAME],
130 [m4_require([_LT_PREPARE_CC_BASENAME])dnl
131 AC_REQUIRE([_LT_DECL_SED])dnl
132 AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
133 func_cc_basename $1
134 cc_basename=$func_cc_basename_result
135 ])
136
137
138 # _LT_FILEUTILS_DEFAULTS
139 # ----------------------
140 # It is okay to use these file commands and assume they have been set
141 # sensibly after 'm4_require([_LT_FILEUTILS_DEFAULTS])'.
142 m4_defun([_LT_FILEUTILS_DEFAULTS],
143 [: ${CP="cp -f"}
144 : ${MV="mv -f"}
145 : ${RM="rm -f"}
146 ])# _LT_FILEUTILS_DEFAULTS
147
148
149 # _LT_SETUP
150 # ---------
151 m4_defun([_LT_SETUP],
152 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
153 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
154 AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl
155 AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
156
157 _LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl
158 dnl
159 _LT_DECL([], [host_alias], [0], [The host system])dnl
160 _LT_DECL([], [host], [0])dnl
161 _LT_DECL([], [host_os], [0])dnl
162 dnl
163 _LT_DECL([], [build_alias], [0], [The build system])dnl
164 _LT_DECL([], [build], [0])dnl
165 _LT_DECL([], [build_os], [0])dnl
166 dnl
167 AC_REQUIRE([AC_PROG_CC])dnl
168 AC_REQUIRE([LT_PATH_LD])dnl
169 AC_REQUIRE([LT_PATH_NM])dnl
170 dnl
171 AC_REQUIRE([AC_PROG_LN_S])dnl
172 test -z "$LN_S" && LN_S="ln -s"
173 _LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
174 dnl
175 AC_REQUIRE([LT_CMD_MAX_LEN])dnl
176 _LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
177 _LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
178 dnl
179 m4_require([_LT_FILEUTILS_DEFAULTS])dnl
180 m4_require([_LT_CHECK_SHELL_FEATURES])dnl
181 m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl
182 m4_require([_LT_CMD_RELOAD])dnl
183 m4_require([_LT_CHECK_MAGIC_METHOD])dnl
184 m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl
185 m4_require([_LT_CMD_OLD_ARCHIVE])dnl
186 m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
187 m4_require([_LT_WITH_SYSROOT])dnl
188 m4_require([_LT_CMD_TRUNCATE])dnl
189
190 _LT_CONFIG_LIBTOOL_INIT([
191 # See if we are running on zsh, and set the options that allow our
192 # commands through without removal of \ escapes INIT.
193 if test -n "\${ZSH_VERSION+set}"; then
194 setopt NO_GLOB_SUBST
195 fi
196 ])
197 if test -n "${ZSH_VERSION+set}"; then
198 setopt NO_GLOB_SUBST
199 fi
200
201 _LT_CHECK_OBJDIR
202
203 m4_require([_LT_TAG_COMPILER])dnl
204
205 case $host_os in
206 aix3*)
207 # AIX sometimes has problems with the GCC collect2 program. For some
208 # reason, if we set the COLLECT_NAMES environment variable, the problems
209 # vanish in a puff of smoke.
210 if test set != "${COLLECT_NAMES+set}"; then
211 COLLECT_NAMES=
212 export COLLECT_NAMES
213 fi
214 ;;
215 esac
216
217 # Global variables:
218 ofile=libtool
219 can_build_shared=yes
220
221 # All known linkers require a '.a' archive for static linking (except MSVC,
222 # which needs '.lib').
223 libext=a
224
225 with_gnu_ld=$lt_cv_prog_gnu_ld
226
227 old_CC=$CC
228 old_CFLAGS=$CFLAGS
229
230 # Set sane defaults for various variables
231 test -z "$CC" && CC=cc
232 test -z "$LTCC" && LTCC=$CC
233 test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
234 test -z "$LD" && LD=ld
235 test -z "$ac_objext" && ac_objext=o
236
237 _LT_CC_BASENAME([$compiler])
238
239 # Only perform the check for file, if the check method requires it
240 test -z "$MAGIC_CMD" && MAGIC_CMD=file
241 case $deplibs_check_method in
242 file_magic*)
243 if test "$file_magic_cmd" = '$MAGIC_CMD'; then
244 _LT_PATH_MAGIC
245 fi
246 ;;
247 esac
248
249 # Use C for the default configuration in the libtool script
250 LT_SUPPORTED_TAG([CC])
251 _LT_LANG_C_CONFIG
252 _LT_LANG_DEFAULT_CONFIG
253 _LT_CONFIG_COMMANDS
254 ])# _LT_SETUP
255
256
257 # _LT_PREPARE_SED_QUOTE_VARS
258 # --------------------------
259 # Define a few sed substitution that help us do robust quoting.
260 m4_defun([_LT_PREPARE_SED_QUOTE_VARS],
261 [# Backslashify metacharacters that are still active within
262 # double-quoted strings.
263 sed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
264
265 # Same as above, but do not quote variable references.
266 double_quote_subst='s/\([["`\\]]\)/\\\1/g'
267
268 # Sed substitution to delay expansion of an escaped shell variable in a
269 # double_quote_subst'ed string.
270 delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
271
272 # Sed substitution to delay expansion of an escaped single quote.
273 delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
274
275 # Sed substitution to avoid accidental globbing in evaled expressions
276 no_glob_subst='s/\*/\\\*/g'
277 ])
278
279 # _LT_PROG_LTMAIN
280 # ---------------
281 # Note that this code is called both from 'configure', and 'config.status'
282 # now that we use AC_CONFIG_COMMANDS to generate libtool. Notably,
283 # 'config.status' has no value for ac_aux_dir unless we are using Automake,
284 # so we pass a copy along to make sure it has a sensible value anyway.
285 m4_defun([_LT_PROG_LTMAIN],
286 [m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
287 _LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
288 ltmain=$ac_aux_dir/ltmain.sh
289 ])# _LT_PROG_LTMAIN
290
291
292 ## ------------------------------------- ##
293 ## Accumulate code for creating libtool. ##
294 ## ------------------------------------- ##
295
296 # So that we can recreate a full libtool script including additional
297 # tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
298 # in macros and then make a single call at the end using the 'libtool'
299 # label.
300
301
302 # _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
303 # ----------------------------------------
304 # Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
305 m4_define([_LT_CONFIG_LIBTOOL_INIT],
306 [m4_ifval([$1],
307 [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
308 [$1
309 ])])])
310
311 # Initialize.
312 m4_define([_LT_OUTPUT_LIBTOOL_INIT])
313
314
315 # _LT_CONFIG_LIBTOOL([COMMANDS])
316 # ------------------------------
317 # Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
318 m4_define([_LT_CONFIG_LIBTOOL],
319 [m4_ifval([$1],
320 [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
321 [$1
322 ])])])
323
324 # Initialize.
325 m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
326
327
328 # _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
329 # -----------------------------------------------------
330 m4_defun([_LT_CONFIG_SAVE_COMMANDS],
331 [_LT_CONFIG_LIBTOOL([$1])
332 _LT_CONFIG_LIBTOOL_INIT([$2])
333 ])
334
335
336 # _LT_FORMAT_COMMENT([COMMENT])
337 # -----------------------------
338 # Add leading comment marks to the start of each line, and a trailing
339 # full-stop to the whole comment if one is not present already.
340 m4_define([_LT_FORMAT_COMMENT],
341 [m4_ifval([$1], [
342 m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
343 [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
344 )])
345
346
347
348 ## ------------------------ ##
349 ## FIXME: Eliminate VARNAME ##
350 ## ------------------------ ##
351
352
353 # _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
354 # -------------------------------------------------------------------
355 # CONFIGNAME is the name given to the value in the libtool script.
356 # VARNAME is the (base) name used in the configure script.
357 # VALUE may be 0, 1 or 2 for a computed quote escaped value based on
358 # VARNAME. Any other value will be used directly.
359 m4_define([_LT_DECL],
360 [lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
361 [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
362 [m4_ifval([$1], [$1], [$2])])
363 lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
364 m4_ifval([$4],
365 [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
366 lt_dict_add_subkey([lt_decl_dict], [$2],
367 [tagged?], [m4_ifval([$5], [yes], [no])])])
368 ])
369
370
371 # _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
372 # --------------------------------------------------------
373 m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
374
375
376 # lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
377 # ------------------------------------------------
378 m4_define([lt_decl_tag_varnames],
379 [_lt_decl_filter([tagged?], [yes], $@)])
380
381
382 # _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
383 # ---------------------------------------------------------
384 m4_define([_lt_decl_filter],
385 [m4_case([$#],
386 [0], [m4_fatal([$0: too few arguments: $#])],
387 [1], [m4_fatal([$0: too few arguments: $#: $1])],
388 [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
389 [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
390 [lt_dict_filter([lt_decl_dict], $@)])[]dnl
391 ])
392
393
394 # lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
395 # --------------------------------------------------
396 m4_define([lt_decl_quote_varnames],
397 [_lt_decl_filter([value], [1], $@)])
398
399
400 # lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
401 # ---------------------------------------------------
402 m4_define([lt_decl_dquote_varnames],
403 [_lt_decl_filter([value], [2], $@)])
404
405
406 # lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
407 # ---------------------------------------------------
408 m4_define([lt_decl_varnames_tagged],
409 [m4_assert([$# <= 2])dnl
410 _$0(m4_quote(m4_default([$1], [[, ]])),
411 m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
412 m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
413 m4_define([_lt_decl_varnames_tagged],
414 [m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
415
416
417 # lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
418 # ------------------------------------------------
419 m4_define([lt_decl_all_varnames],
420 [_$0(m4_quote(m4_default([$1], [[, ]])),
421 m4_if([$2], [],
422 m4_quote(lt_decl_varnames),
423 m4_quote(m4_shift($@))))[]dnl
424 ])
425 m4_define([_lt_decl_all_varnames],
426 [lt_join($@, lt_decl_varnames_tagged([$1],
427 lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
428 ])
429
430
431 # _LT_CONFIG_STATUS_DECLARE([VARNAME])
432 # ------------------------------------
433 # Quote a variable value, and forward it to 'config.status' so that its
434 # declaration there will have the same value as in 'configure'. VARNAME
435 # must have a single quote delimited value for this to work.
436 m4_define([_LT_CONFIG_STATUS_DECLARE],
437 [$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`'])
438
439
440 # _LT_CONFIG_STATUS_DECLARATIONS
441 # ------------------------------
442 # We delimit libtool config variables with single quotes, so when
443 # we write them to config.status, we have to be sure to quote all
444 # embedded single quotes properly. In configure, this macro expands
445 # each variable declared with _LT_DECL (and _LT_TAGDECL) into:
446 #
447 # <var>='`$ECHO "$<var>" | $SED "$delay_single_quote_subst"`'
448 m4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
449 [m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
450 [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
451
452
453 # _LT_LIBTOOL_TAGS
454 # ----------------
455 # Output comment and list of tags supported by the script
456 m4_defun([_LT_LIBTOOL_TAGS],
457 [_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
458 available_tags='_LT_TAGS'dnl
459 ])
460
461
462 # _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
463 # -----------------------------------
464 # Extract the dictionary values for VARNAME (optionally with TAG) and
465 # expand to a commented shell variable setting:
466 #
467 # # Some comment about what VAR is for.
468 # visible_name=$lt_internal_name
469 m4_define([_LT_LIBTOOL_DECLARE],
470 [_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
471 [description])))[]dnl
472 m4_pushdef([_libtool_name],
473 m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
474 m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
475 [0], [_libtool_name=[$]$1],
476 [1], [_libtool_name=$lt_[]$1],
477 [2], [_libtool_name=$lt_[]$1],
478 [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
479 m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
480 ])
481
482
483 # _LT_LIBTOOL_CONFIG_VARS
484 # -----------------------
485 # Produce commented declarations of non-tagged libtool config variables
486 # suitable for insertion in the LIBTOOL CONFIG section of the 'libtool'
487 # script. Tagged libtool config variables (even for the LIBTOOL CONFIG
488 # section) are produced by _LT_LIBTOOL_TAG_VARS.
489 m4_defun([_LT_LIBTOOL_CONFIG_VARS],
490 [m4_foreach([_lt_var],
491 m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
492 [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
493
494
495 # _LT_LIBTOOL_TAG_VARS(TAG)
496 # -------------------------
497 m4_define([_LT_LIBTOOL_TAG_VARS],
498 [m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
499 [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
500
501
502 # _LT_TAGVAR(VARNAME, [TAGNAME])
503 # ------------------------------
504 m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
505
506
507 # _LT_CONFIG_COMMANDS
508 # -------------------
509 # Send accumulated output to $CONFIG_STATUS. Thanks to the lists of
510 # variables for single and double quote escaping we saved from calls
511 # to _LT_DECL, we can put quote escaped variables declarations
512 # into 'config.status', and then the shell code to quote escape them in
513 # for loops in 'config.status'. Finally, any additional code accumulated
514 # from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
515 m4_defun([_LT_CONFIG_COMMANDS],
516 [AC_PROVIDE_IFELSE([LT_OUTPUT],
517 dnl If the libtool generation code has been placed in $CONFIG_LT,
518 dnl instead of duplicating it all over again into config.status,
519 dnl then we will have config.status run $CONFIG_LT later, so it
520 dnl needs to know what name is stored there:
521 [AC_CONFIG_COMMANDS([libtool],
522 [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
523 dnl If the libtool generation code is destined for config.status,
524 dnl expand the accumulated commands and init code now:
525 [AC_CONFIG_COMMANDS([libtool],
526 [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
527 ])#_LT_CONFIG_COMMANDS
528
529
530 # Initialize.
531 m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
532 [
533
534 # The HP-UX ksh and POSIX shell print the target directory to stdout
535 # if CDPATH is set.
536 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
537
538 sed_quote_subst='$sed_quote_subst'
539 double_quote_subst='$double_quote_subst'
540 delay_variable_subst='$delay_variable_subst'
541 _LT_CONFIG_STATUS_DECLARATIONS
542 LTCC='$LTCC'
543 LTCFLAGS='$LTCFLAGS'
544 compiler='$compiler_DEFAULT'
545
546 # A function that is used when there is no print builtin or printf.
547 func_fallback_echo ()
548 {
549 eval 'cat <<_LTECHO_EOF
550 \$[]1
551 _LTECHO_EOF'
552 }
553
554 # Quote evaled strings.
555 for var in lt_decl_all_varnames([[ \
556 ]], lt_decl_quote_varnames); do
557 case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
558 *[[\\\\\\\`\\"\\\$]]*)
559 eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
560 ;;
561 *)
562 eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
563 ;;
564 esac
565 done
566
567 # Double-quote double-evaled strings.
568 for var in lt_decl_all_varnames([[ \
569 ]], lt_decl_dquote_varnames); do
570 case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
571 *[[\\\\\\\`\\"\\\$]]*)
572 eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
573 ;;
574 *)
575 eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
576 ;;
577 esac
578 done
579
580 _LT_OUTPUT_LIBTOOL_INIT
581 ])
582
583 # _LT_GENERATED_FILE_INIT(FILE, [COMMENT])
584 # ------------------------------------
585 # Generate a child script FILE with all initialization necessary to
586 # reuse the environment learned by the parent script, and make the
587 # file executable. If COMMENT is supplied, it is inserted after the
588 # '#!' sequence but before initialization text begins. After this
589 # macro, additional text can be appended to FILE to form the body of
590 # the child script. The macro ends with non-zero status if the
591 # file could not be fully written (such as if the disk is full).
592 m4_ifdef([AS_INIT_GENERATED],
593 [m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])],
594 [m4_defun([_LT_GENERATED_FILE_INIT],
595 [m4_require([AS_PREPARE])]dnl
596 [m4_pushdef([AS_MESSAGE_LOG_FD])]dnl
597 [lt_write_fail=0
598 cat >$1 <<_ASEOF || lt_write_fail=1
599 #! $SHELL
600 # Generated by $as_me.
601 $2
602 SHELL=\${CONFIG_SHELL-$SHELL}
603 export SHELL
604 _ASEOF
605 cat >>$1 <<\_ASEOF || lt_write_fail=1
606 AS_SHELL_SANITIZE
607 _AS_PREPARE
608 exec AS_MESSAGE_FD>&1
609 _ASEOF
610 test 0 = "$lt_write_fail" && chmod +x $1[]dnl
611 m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT
612
613 # LT_OUTPUT
614 # ---------
615 # This macro allows early generation of the libtool script (before
616 # AC_OUTPUT is called), incase it is used in configure for compilation
617 # tests.
618 AC_DEFUN([LT_OUTPUT],
619 [: ${CONFIG_LT=./config.lt}
620 AC_MSG_NOTICE([creating $CONFIG_LT])
621 _LT_GENERATED_FILE_INIT(["$CONFIG_LT"],
622 [# Run this file to recreate a libtool stub with the current configuration.])
623
624 cat >>"$CONFIG_LT" <<\_LTEOF
625 lt_cl_silent=false
626 exec AS_MESSAGE_LOG_FD>>config.log
627 {
628 echo
629 AS_BOX([Running $as_me.])
630 } >&AS_MESSAGE_LOG_FD
631
632 lt_cl_help="\
633 '$as_me' creates a local libtool stub from the current configuration,
634 for use in further configure time tests before the real libtool is
635 generated.
636
637 Usage: $[0] [[OPTIONS]]
638
639 -h, --help print this help, then exit
640 -V, --version print version number, then exit
641 -q, --quiet do not print progress messages
642 -d, --debug don't remove temporary files
643
644 Report bugs to <bug-libtool@gnu.org>."
645
646 lt_cl_version="\
647 m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
648 m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
649 configured by $[0], generated by m4_PACKAGE_STRING.
650
651 Copyright (C) 2011 Free Software Foundation, Inc.
652 This config.lt script is free software; the Free Software Foundation
653 gives unlimited permision to copy, distribute and modify it."
654
655 while test 0 != $[#]
656 do
657 case $[1] in
658 --version | --v* | -V )
659 echo "$lt_cl_version"; exit 0 ;;
660 --help | --h* | -h )
661 echo "$lt_cl_help"; exit 0 ;;
662 --debug | --d* | -d )
663 debug=: ;;
664 --quiet | --q* | --silent | --s* | -q )
665 lt_cl_silent=: ;;
666
667 -*) AC_MSG_ERROR([unrecognized option: $[1]
668 Try '$[0] --help' for more information.]) ;;
669
670 *) AC_MSG_ERROR([unrecognized argument: $[1]
671 Try '$[0] --help' for more information.]) ;;
672 esac
673 shift
674 done
675
676 if $lt_cl_silent; then
677 exec AS_MESSAGE_FD>/dev/null
678 fi
679 _LTEOF
680
681 cat >>"$CONFIG_LT" <<_LTEOF
682 _LT_OUTPUT_LIBTOOL_COMMANDS_INIT
683 _LTEOF
684
685 cat >>"$CONFIG_LT" <<\_LTEOF
686 AC_MSG_NOTICE([creating $ofile])
687 _LT_OUTPUT_LIBTOOL_COMMANDS
688 AS_EXIT(0)
689 _LTEOF
690 chmod +x "$CONFIG_LT"
691
692 # configure is writing to config.log, but config.lt does its own redirection,
693 # appending to config.log, which fails on DOS, as config.log is still kept
694 # open by configure. Here we exec the FD to /dev/null, effectively closing
695 # config.log, so it can be properly (re)opened and appended to by config.lt.
696 lt_cl_success=:
697 test yes = "$silent" &&
698 lt_config_lt_args="$lt_config_lt_args --quiet"
699 exec AS_MESSAGE_LOG_FD>/dev/null
700 $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
701 exec AS_MESSAGE_LOG_FD>>config.log
702 $lt_cl_success || AS_EXIT(1)
703 ])# LT_OUTPUT
704
705
706 # _LT_CONFIG(TAG)
707 # ---------------
708 # If TAG is the built-in tag, create an initial libtool script with a
709 # default configuration from the untagged config vars. Otherwise add code
710 # to config.status for appending the configuration named by TAG from the
711 # matching tagged config vars.
712 m4_defun([_LT_CONFIG],
713 [m4_require([_LT_FILEUTILS_DEFAULTS])dnl
714 _LT_CONFIG_SAVE_COMMANDS([
715 m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
716 m4_if(_LT_TAG, [C], [
717 # See if we are running on zsh, and set the options that allow our
718 # commands through without removal of \ escapes.
719 if test -n "${ZSH_VERSION+set}"; then
720 setopt NO_GLOB_SUBST
721 fi
722
723 cfgfile=${ofile}T
724 trap "$RM \"$cfgfile\"; exit 1" 1 2 15
725 $RM "$cfgfile"
726
727 cat <<_LT_EOF >> "$cfgfile"
728 #! $SHELL
729 # Generated automatically by $as_me ($PACKAGE) $VERSION
730 # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
731 # NOTE: Changes made to this file will be lost: look at ltmain.sh.
732
733 # Provide generalized library-building support services.
734 # Written by Gordon Matzigkeit, 1996
735
736 _LT_COPYING
737 _LT_LIBTOOL_TAGS
738
739 # Configured defaults for sys_lib_dlsearch_path munging.
740 : \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"}
741
742 # ### BEGIN LIBTOOL CONFIG
743 _LT_LIBTOOL_CONFIG_VARS
744 _LT_LIBTOOL_TAG_VARS
745 # ### END LIBTOOL CONFIG
746
747 _LT_EOF
748
749 cat <<'_LT_EOF' >> "$cfgfile"
750
751 # ### BEGIN FUNCTIONS SHARED WITH CONFIGURE
752
753 _LT_PREPARE_MUNGE_PATH_LIST
754 _LT_PREPARE_CC_BASENAME
755
756 # ### END FUNCTIONS SHARED WITH CONFIGURE
757
758 _LT_EOF
759
760 case $host_os in
761 aix3*)
762 cat <<\_LT_EOF >> "$cfgfile"
763 # AIX sometimes has problems with the GCC collect2 program. For some
764 # reason, if we set the COLLECT_NAMES environment variable, the problems
765 # vanish in a puff of smoke.
766 if test set != "${COLLECT_NAMES+set}"; then
767 COLLECT_NAMES=
768 export COLLECT_NAMES
769 fi
770 _LT_EOF
771 ;;
772 esac
773
774 _LT_PROG_LTMAIN
775
776 # We use sed instead of cat because bash on DJGPP gets confused if
777 # if finds mixed CR/LF and LF-only lines. Since sed operates in
778 # text mode, it properly converts lines to CR/LF. This bash problem
779 # is reportedly fixed, but why not run on old versions too?
780 sed '$q' "$ltmain" >> "$cfgfile" \
781 || (rm -f "$cfgfile"; exit 1)
782
783 mv -f "$cfgfile" "$ofile" ||
784 (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
785 chmod +x "$ofile"
786 ],
787 [cat <<_LT_EOF >> "$ofile"
788
789 dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
790 dnl in a comment (ie after a #).
791 # ### BEGIN LIBTOOL TAG CONFIG: $1
792 _LT_LIBTOOL_TAG_VARS(_LT_TAG)
793 # ### END LIBTOOL TAG CONFIG: $1
794 _LT_EOF
795 ])dnl /m4_if
796 ],
797 [m4_if([$1], [], [
798 PACKAGE='$PACKAGE'
799 VERSION='$VERSION'
800 RM='$RM'
801 ofile='$ofile'], [])
802 ])dnl /_LT_CONFIG_SAVE_COMMANDS
803 ])# _LT_CONFIG
804
805
806 # LT_SUPPORTED_TAG(TAG)
807 # ---------------------
808 # Trace this macro to discover what tags are supported by the libtool
809 # --tag option, using:
810 # autoconf --trace 'LT_SUPPORTED_TAG:$1'
811 AC_DEFUN([LT_SUPPORTED_TAG], [])
812
813
814 # C support is built-in for now
815 m4_define([_LT_LANG_C_enabled], [])
816 m4_define([_LT_TAGS], [])
817
818
819 # LT_LANG(LANG)
820 # -------------
821 # Enable libtool support for the given language if not already enabled.
822 AC_DEFUN([LT_LANG],
823 [AC_BEFORE([$0], [LT_OUTPUT])dnl
824 m4_case([$1],
825 [C], [_LT_LANG(C)],
826 [C++], [_LT_LANG(CXX)],
827 [Go], [_LT_LANG(GO)],
828 [Java], [_LT_LANG(GCJ)],
829 [Fortran 77], [_LT_LANG(F77)],
830 [Fortran], [_LT_LANG(FC)],
831 [Windows Resource], [_LT_LANG(RC)],
832 [m4_ifdef([_LT_LANG_]$1[_CONFIG],
833 [_LT_LANG($1)],
834 [m4_fatal([$0: unsupported language: "$1"])])])dnl
835 ])# LT_LANG
836
837
838 # _LT_LANG(LANGNAME)
839 # ------------------
840 m4_defun([_LT_LANG],
841 [m4_ifdef([_LT_LANG_]$1[_enabled], [],
842 [LT_SUPPORTED_TAG([$1])dnl
843 m4_append([_LT_TAGS], [$1 ])dnl
844 m4_define([_LT_LANG_]$1[_enabled], [])dnl
845 _LT_LANG_$1_CONFIG($1)])dnl
846 ])# _LT_LANG
847
848
849 m4_ifndef([AC_PROG_GO], [
850 ############################################################
851 # NOTE: This macro has been submitted for inclusion into #
852 # GNU Autoconf as AC_PROG_GO. When it is available in #
853 # a released version of Autoconf we should remove this #
854 # macro and use it instead. #
855 ############################################################
856 m4_defun([AC_PROG_GO],
857 [AC_LANG_PUSH(Go)dnl
858 AC_ARG_VAR([GOC], [Go compiler command])dnl
859 AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl
860 _AC_ARG_VAR_LDFLAGS()dnl
861 AC_CHECK_TOOL(GOC, gccgo)
862 if test -z "$GOC"; then
863 if test -n "$ac_tool_prefix"; then
864 AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo])
865 fi
866 fi
867 if test -z "$GOC"; then
868 AC_CHECK_PROG(GOC, gccgo, gccgo, false)
869 fi
870 ])#m4_defun
871 ])#m4_ifndef
872
873
874 # _LT_LANG_DEFAULT_CONFIG
875 # -----------------------
876 m4_defun([_LT_LANG_DEFAULT_CONFIG],
877 [AC_PROVIDE_IFELSE([AC_PROG_CXX],
878 [LT_LANG(CXX)],
879 [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
880
881 AC_PROVIDE_IFELSE([AC_PROG_F77],
882 [LT_LANG(F77)],
883 [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
884
885 AC_PROVIDE_IFELSE([AC_PROG_FC],
886 [LT_LANG(FC)],
887 [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
888
889 dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
890 dnl pulling things in needlessly.
891 AC_PROVIDE_IFELSE([AC_PROG_GCJ],
892 [LT_LANG(GCJ)],
893 [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
894 [LT_LANG(GCJ)],
895 [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
896 [LT_LANG(GCJ)],
897 [m4_ifdef([AC_PROG_GCJ],
898 [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
899 m4_ifdef([A][M_PROG_GCJ],
900 [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
901 m4_ifdef([LT_PROG_GCJ],
902 [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
903
904 AC_PROVIDE_IFELSE([AC_PROG_GO],
905 [LT_LANG(GO)],
906 [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])])
907
908 AC_PROVIDE_IFELSE([LT_PROG_RC],
909 [LT_LANG(RC)],
910 [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
911 ])# _LT_LANG_DEFAULT_CONFIG
912
913 # Obsolete macros:
914 AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
915 AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
916 AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
917 AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
918 AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)])
919 dnl aclocal-1.4 backwards compatibility:
920 dnl AC_DEFUN([AC_LIBTOOL_CXX], [])
921 dnl AC_DEFUN([AC_LIBTOOL_F77], [])
922 dnl AC_DEFUN([AC_LIBTOOL_FC], [])
923 dnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
924 dnl AC_DEFUN([AC_LIBTOOL_RC], [])
925
926
927 # _LT_TAG_COMPILER
928 # ----------------
929 m4_defun([_LT_TAG_COMPILER],
930 [AC_REQUIRE([AC_PROG_CC])dnl
931
932 _LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
933 _LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
934 _LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
935 _LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
936
937 # If no C compiler was specified, use CC.
938 LTCC=${LTCC-"$CC"}
939
940 # If no C compiler flags were specified, use CFLAGS.
941 LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
942
943 # Allow CC to be a program name with arguments.
944 compiler=$CC
945 ])# _LT_TAG_COMPILER
946
947
948 # _LT_COMPILER_BOILERPLATE
949 # ------------------------
950 # Check for compiler boilerplate output or warnings with
951 # the simple compiler test code.
952 m4_defun([_LT_COMPILER_BOILERPLATE],
953 [m4_require([_LT_DECL_SED])dnl
954 ac_outfile=conftest.$ac_objext
955 echo "$lt_simple_compile_test_code" >conftest.$ac_ext
956 eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
957 _lt_compiler_boilerplate=`cat conftest.err`
958 $RM conftest*
959 ])# _LT_COMPILER_BOILERPLATE
960
961
962 # _LT_LINKER_BOILERPLATE
963 # ----------------------
964 # Check for linker boilerplate output or warnings with
965 # the simple link test code.
966 m4_defun([_LT_LINKER_BOILERPLATE],
967 [m4_require([_LT_DECL_SED])dnl
968 ac_outfile=conftest.$ac_objext
969 echo "$lt_simple_link_test_code" >conftest.$ac_ext
970 eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
971 _lt_linker_boilerplate=`cat conftest.err`
972 $RM -r conftest*
973 ])# _LT_LINKER_BOILERPLATE
974
975 # _LT_REQUIRED_DARWIN_CHECKS
976 # -------------------------
977 m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
978 case $host_os in
979 rhapsody* | darwin*)
980 AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
981 AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
982 AC_CHECK_TOOL([LIPO], [lipo], [:])
983 AC_CHECK_TOOL([OTOOL], [otool], [:])
984 AC_CHECK_TOOL([OTOOL64], [otool64], [:])
985 _LT_DECL([], [DSYMUTIL], [1],
986 [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
987 _LT_DECL([], [NMEDIT], [1],
988 [Tool to change global to local symbols on Mac OS X])
989 _LT_DECL([], [LIPO], [1],
990 [Tool to manipulate fat objects and archives on Mac OS X])
991 _LT_DECL([], [OTOOL], [1],
992 [ldd/readelf like tool for Mach-O binaries on Mac OS X])
993 _LT_DECL([], [OTOOL64], [1],
994 [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
995
996 AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
997 [lt_cv_apple_cc_single_mod=no
998 if test -z "$LT_MULTI_MODULE"; then
999 # By default we will add the -single_module flag. You can override
1000 # by either setting the environment variable LT_MULTI_MODULE
1001 # non-empty at configure time, or by adding -multi_module to the
1002 # link flags.
1003 rm -rf libconftest.dylib*
1004 echo "int foo(void){return 1;}" > conftest.c
1005 echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
1006 -dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
1007 $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
1008 -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
1009 _lt_result=$?
1010 # If there is a non-empty error log, and "single_module"
1011 # appears in it, assume the flag caused a linker warning
1012 if test -s conftest.err && $GREP single_module conftest.err; then
1013 cat conftest.err >&AS_MESSAGE_LOG_FD
1014 # Otherwise, if the output was created with a 0 exit code from
1015 # the compiler, it worked.
1016 elif test -f libconftest.dylib && test 0 = "$_lt_result"; then
1017 lt_cv_apple_cc_single_mod=yes
1018 else
1019 cat conftest.err >&AS_MESSAGE_LOG_FD
1020 fi
1021 rm -rf libconftest.dylib*
1022 rm -f conftest.*
1023 fi])
1024
1025 AC_CACHE_CHECK([for -exported_symbols_list linker flag],
1026 [lt_cv_ld_exported_symbols_list],
1027 [lt_cv_ld_exported_symbols_list=no
1028 save_LDFLAGS=$LDFLAGS
1029 echo "_main" > conftest.sym
1030 LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
1031 AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
1032 [lt_cv_ld_exported_symbols_list=yes],
1033 [lt_cv_ld_exported_symbols_list=no])
1034 LDFLAGS=$save_LDFLAGS
1035 ])
1036
1037 AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load],
1038 [lt_cv_ld_force_load=no
1039 cat > conftest.c << _LT_EOF
1040 int forced_loaded() { return 2;}
1041 _LT_EOF
1042 echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD
1043 $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD
1044 echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
1045 $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
1046 echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
1047 $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
1048 cat > conftest.c << _LT_EOF
1049 int main() { return 0;}
1050 _LT_EOF
1051 echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD
1052 $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
1053 _lt_result=$?
1054 if test -s conftest.err && $GREP force_load conftest.err; then
1055 cat conftest.err >&AS_MESSAGE_LOG_FD
1056 elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then
1057 lt_cv_ld_force_load=yes
1058 else
1059 cat conftest.err >&AS_MESSAGE_LOG_FD
1060 fi
1061 rm -f conftest.err libconftest.a conftest conftest.c
1062 rm -rf conftest.dSYM
1063 ])
1064 case $host_os in
1065 rhapsody* | darwin1.[[012]])
1066 _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;;
1067 darwin1.*)
1068 _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
1069 darwin*) # darwin 5.x on
1070 # if running on 10.5 or later, the deployment target defaults
1071 # to the OS version, if on x86, and 10.4, the deployment
1072 # target defaults to 10.4. Don't you love it?
1073 case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
1074 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
1075 _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
1076 10.[[012]][[,.]]*)
1077 _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
1078 10.*)
1079 _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
1080 esac
1081 ;;
1082 esac
1083 if test yes = "$lt_cv_apple_cc_single_mod"; then
1084 _lt_dar_single_mod='$single_module'
1085 fi
1086 if test yes = "$lt_cv_ld_exported_symbols_list"; then
1087 _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym'
1088 else
1089 _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib'
1090 fi
1091 if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then
1092 _lt_dsymutil='~$DSYMUTIL $lib || :'
1093 else
1094 _lt_dsymutil=
1095 fi
1096 ;;
1097 esac
1098 ])
1099
1100
1101 # _LT_DARWIN_LINKER_FEATURES([TAG])
1102 # ---------------------------------
1103 # Checks for linker and compiler features on darwin
1104 m4_defun([_LT_DARWIN_LINKER_FEATURES],
1105 [
1106 m4_require([_LT_REQUIRED_DARWIN_CHECKS])
1107 _LT_TAGVAR(archive_cmds_need_lc, $1)=no
1108 _LT_TAGVAR(hardcode_direct, $1)=no
1109 _LT_TAGVAR(hardcode_automatic, $1)=yes
1110 _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
1111 if test yes = "$lt_cv_ld_force_load"; then
1112 _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
1113 m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes],
1114 [FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes])
1115 else
1116 _LT_TAGVAR(whole_archive_flag_spec, $1)=''
1117 fi
1118 _LT_TAGVAR(link_all_deplibs, $1)=yes
1119 _LT_TAGVAR(allow_undefined_flag, $1)=$_lt_dar_allow_undefined
1120 case $cc_basename in
1121 ifort*|nagfor*) _lt_dar_can_shared=yes ;;
1122 *) _lt_dar_can_shared=$GCC ;;
1123 esac
1124 if test yes = "$_lt_dar_can_shared"; then
1125 output_verbose_link_cmd=func_echo_all
1126 _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil"
1127 _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil"
1128 _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil"
1129 _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil"
1130 m4_if([$1], [CXX],
1131 [ if test yes != "$lt_cv_apple_cc_single_mod"; then
1132 _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dsymutil"
1133 _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil"
1134 fi
1135 ],[])
1136 else
1137 _LT_TAGVAR(ld_shlibs, $1)=no
1138 fi
1139 ])
1140
1141 # _LT_SYS_MODULE_PATH_AIX([TAGNAME])
1142 # ----------------------------------
1143 # Links a minimal program and checks the executable
1144 # for the system default hardcoded library path. In most cases,
1145 # this is /usr/lib:/lib, but when the MPI compilers are used
1146 # the location of the communication and MPI libs are included too.
1147 # If we don't find anything, use the default library path according
1148 # to the aix ld manual.
1149 # Store the results from the different compilers for each TAGNAME.
1150 # Allow to override them for all tags through lt_cv_aix_libpath.
1151 m4_defun([_LT_SYS_MODULE_PATH_AIX],
1152 [m4_require([_LT_DECL_SED])dnl
1153 if test set = "${lt_cv_aix_libpath+set}"; then
1154 aix_libpath=$lt_cv_aix_libpath
1155 else
1156 AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])],
1157 [AC_LINK_IFELSE([AC_LANG_PROGRAM],[
1158 lt_aix_libpath_sed='[
1159 /Import File Strings/,/^$/ {
1160 /^0/ {
1161 s/^0 *\([^ ]*\) *$/\1/
1162 p
1163 }
1164 }]'
1165 _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
1166 # Check for a 64-bit object if we didn't find anything.
1167 if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
1168 _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
1169 fi],[])
1170 if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
1171 _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=/usr/lib:/lib
1172 fi
1173 ])
1174 aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])
1175 fi
1176 ])# _LT_SYS_MODULE_PATH_AIX
1177
1178
1179 # _LT_SHELL_INIT(ARG)
1180 # -------------------
1181 m4_define([_LT_SHELL_INIT],
1182 [m4_divert_text([M4SH-INIT], [$1
1183 ])])# _LT_SHELL_INIT
1184
1185
1186
1187 # _LT_PROG_ECHO_BACKSLASH
1188 # -----------------------
1189 # Find how we can fake an echo command that does not interpret backslash.
1190 # In particular, with Autoconf 2.60 or later we add some code to the start
1191 # of the generated configure script that will find a shell with a builtin
1192 # printf (that we can use as an echo command).
1193 m4_defun([_LT_PROG_ECHO_BACKSLASH],
1194 [ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
1195 ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
1196 ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
1197
1198 AC_MSG_CHECKING([how to print strings])
1199 # Test print first, because it will be a builtin if present.
1200 if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
1201 test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
1202 ECHO='print -r --'
1203 elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
1204 ECHO='printf %s\n'
1205 else
1206 # Use this function as a fallback that always works.
1207 func_fallback_echo ()
1208 {
1209 eval 'cat <<_LTECHO_EOF
1210 $[]1
1211 _LTECHO_EOF'
1212 }
1213 ECHO='func_fallback_echo'
1214 fi
1215
1216 # func_echo_all arg...
1217 # Invoke $ECHO with all args, space-separated.
1218 func_echo_all ()
1219 {
1220 $ECHO "$*"
1221 }
1222
1223 case $ECHO in
1224 printf*) AC_MSG_RESULT([printf]) ;;
1225 print*) AC_MSG_RESULT([print -r]) ;;
1226 *) AC_MSG_RESULT([cat]) ;;
1227 esac
1228
1229 m4_ifdef([_AS_DETECT_SUGGESTED],
1230 [_AS_DETECT_SUGGESTED([
1231 test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || (
1232 ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
1233 ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
1234 ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
1235 PATH=/empty FPATH=/empty; export PATH FPATH
1236 test "X`printf %s $ECHO`" = "X$ECHO" \
1237 || test "X`print -r -- $ECHO`" = "X$ECHO" )])])
1238
1239 _LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
1240 _LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])
1241 ])# _LT_PROG_ECHO_BACKSLASH
1242
1243
1244 # _LT_WITH_SYSROOT
1245 # ----------------
1246 AC_DEFUN([_LT_WITH_SYSROOT],
1247 [AC_MSG_CHECKING([for sysroot])
1248 AC_ARG_WITH([sysroot],
1249 [AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
1250 [Search for dependent libraries within DIR (or the compiler's sysroot
1251 if not specified).])],
1252 [], [with_sysroot=no])
1253
1254 dnl lt_sysroot will always be passed unquoted. We quote it here
1255 dnl in case the user passed a directory name.
1256 lt_sysroot=
1257 case $with_sysroot in #(
1258 yes)
1259 if test yes = "$GCC"; then
1260 lt_sysroot=`$CC --print-sysroot 2>/dev/null`
1261 fi
1262 ;; #(
1263 /*)
1264 lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
1265 ;; #(
1266 no|'')
1267 ;; #(
1268 *)
1269 AC_MSG_RESULT([$with_sysroot])
1270 AC_MSG_ERROR([The sysroot must be an absolute path.])
1271 ;;
1272 esac
1273
1274 AC_MSG_RESULT([${lt_sysroot:-no}])
1275 _LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl
1276 [dependent libraries, and where our libraries should be installed.])])
1277
1278 # _LT_ENABLE_LOCK
1279 # ---------------
1280 m4_defun([_LT_ENABLE_LOCK],
1281 [AC_ARG_ENABLE([libtool-lock],
1282 [AS_HELP_STRING([--disable-libtool-lock],
1283 [avoid locking (might break parallel builds)])])
1284 test no = "$enable_libtool_lock" || enable_libtool_lock=yes
1285
1286 # Some flags need to be propagated to the compiler or linker for good
1287 # libtool support.
1288 case $host in
1289 ia64-*-hpux*)
1290 # Find out what ABI is being produced by ac_compile, and set mode
1291 # options accordingly.
1292 echo 'int i;' > conftest.$ac_ext
1293 if AC_TRY_EVAL(ac_compile); then
1294 case `/usr/bin/file conftest.$ac_objext` in
1295 *ELF-32*)
1296 HPUX_IA64_MODE=32
1297 ;;
1298 *ELF-64*)
1299 HPUX_IA64_MODE=64
1300 ;;
1301 esac
1302 fi
1303 rm -rf conftest*
1304 ;;
1305 *-*-irix6*)
1306 # Find out what ABI is being produced by ac_compile, and set linker
1307 # options accordingly.
1308 echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
1309 if AC_TRY_EVAL(ac_compile); then
1310 if test yes = "$lt_cv_prog_gnu_ld"; then
1311 case `/usr/bin/file conftest.$ac_objext` in
1312 *32-bit*)
1313 LD="${LD-ld} -melf32bsmip"
1314 ;;
1315 *N32*)
1316 LD="${LD-ld} -melf32bmipn32"
1317 ;;
1318 *64-bit*)
1319 LD="${LD-ld} -melf64bmip"
1320 ;;
1321 esac
1322 else
1323 case `/usr/bin/file conftest.$ac_objext` in
1324 *32-bit*)
1325 LD="${LD-ld} -32"
1326 ;;
1327 *N32*)
1328 LD="${LD-ld} -n32"
1329 ;;
1330 *64-bit*)
1331 LD="${LD-ld} -64"
1332 ;;
1333 esac
1334 fi
1335 fi
1336 rm -rf conftest*
1337 ;;
1338
1339 mips64*-*linux*)
1340 # Find out what ABI is being produced by ac_compile, and set linker
1341 # options accordingly.
1342 echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
1343 if AC_TRY_EVAL(ac_compile); then
1344 emul=elf
1345 case `/usr/bin/file conftest.$ac_objext` in
1346 *32-bit*)
1347 emul="${emul}32"
1348 ;;
1349 *64-bit*)
1350 emul="${emul}64"
1351 ;;
1352 esac
1353 case `/usr/bin/file conftest.$ac_objext` in
1354 *MSB*)
1355 emul="${emul}btsmip"
1356 ;;
1357 *LSB*)
1358 emul="${emul}ltsmip"
1359 ;;
1360 esac
1361 case `/usr/bin/file conftest.$ac_objext` in
1362 *N32*)
1363 emul="${emul}n32"
1364 ;;
1365 esac
1366 LD="${LD-ld} -m $emul"
1367 fi
1368 rm -rf conftest*
1369 ;;
1370
1371 x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \
1372 s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
1373 # Find out what ABI is being produced by ac_compile, and set linker
1374 # options accordingly. Note that the listed cases only cover the
1375 # situations where additional linker options are needed (such as when
1376 # doing 32-bit compilation for a host where ld defaults to 64-bit, or
1377 # vice versa); the common cases where no linker options are needed do
1378 # not appear in the list.
1379 echo 'int i;' > conftest.$ac_ext
1380 if AC_TRY_EVAL(ac_compile); then
1381 case `/usr/bin/file conftest.o` in
1382 *32-bit*)
1383 case $host in
1384 x86_64-*kfreebsd*-gnu)
1385 LD="${LD-ld} -m elf_i386_fbsd"
1386 ;;
1387 x86_64-*linux*)
1388 case `/usr/bin/file conftest.o` in
1389 *x86-64*)
1390 LD="${LD-ld} -m elf32_x86_64"
1391 ;;
1392 *)
1393 LD="${LD-ld} -m elf_i386"
1394 ;;
1395 esac
1396 ;;
1397 powerpc64le-*linux*)
1398 LD="${LD-ld} -m elf32lppclinux"
1399 ;;
1400 powerpc64-*linux*)
1401 LD="${LD-ld} -m elf32ppclinux"
1402 ;;
1403 s390x-*linux*)
1404 LD="${LD-ld} -m elf_s390"
1405 ;;
1406 sparc64-*linux*)
1407 LD="${LD-ld} -m elf32_sparc"
1408 ;;
1409 esac
1410 ;;
1411 *64-bit*)
1412 case $host in
1413 x86_64-*kfreebsd*-gnu)
1414 LD="${LD-ld} -m elf_x86_64_fbsd"
1415 ;;
1416 x86_64-*linux*)
1417 LD="${LD-ld} -m elf_x86_64"
1418 ;;
1419 powerpcle-*linux*)
1420 LD="${LD-ld} -m elf64lppc"
1421 ;;
1422 powerpc-*linux*)
1423 LD="${LD-ld} -m elf64ppc"
1424 ;;
1425 s390*-*linux*|s390*-*tpf*)
1426 LD="${LD-ld} -m elf64_s390"
1427 ;;
1428 sparc*-*linux*)
1429 LD="${LD-ld} -m elf64_sparc"
1430 ;;
1431 esac
1432 ;;
1433 esac
1434 fi
1435 rm -rf conftest*
1436 ;;
1437
1438 *-*-sco3.2v5*)
1439 # On SCO OpenServer 5, we need -belf to get full-featured binaries.
1440 SAVE_CFLAGS=$CFLAGS
1441 CFLAGS="$CFLAGS -belf"
1442 AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
1443 [AC_LANG_PUSH(C)
1444 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
1445 AC_LANG_POP])
1446 if test yes != "$lt_cv_cc_needs_belf"; then
1447 # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
1448 CFLAGS=$SAVE_CFLAGS
1449 fi
1450 ;;
1451 *-*solaris*)
1452 # Find out what ABI is being produced by ac_compile, and set linker
1453 # options accordingly.
1454 echo 'int i;' > conftest.$ac_ext
1455 if AC_TRY_EVAL(ac_compile); then
1456 case `/usr/bin/file conftest.o` in
1457 *64-bit*)
1458 case $lt_cv_prog_gnu_ld in
1459 yes*)
1460 case $host in
1461 i?86-*-solaris*|x86_64-*-solaris*)
1462 LD="${LD-ld} -m elf_x86_64"
1463 ;;
1464 sparc*-*-solaris*)
1465 LD="${LD-ld} -m elf64_sparc"
1466 ;;
1467 esac
1468 # GNU ld 2.21 introduced _sol2 emulations. Use them if available.
1469 if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
1470 LD=${LD-ld}_sol2
1471 fi
1472 ;;
1473 *)
1474 if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
1475 LD="${LD-ld} -64"
1476 fi
1477 ;;
1478 esac
1479 ;;
1480 esac
1481 fi
1482 rm -rf conftest*
1483 ;;
1484 esac
1485
1486 need_locks=$enable_libtool_lock
1487 ])# _LT_ENABLE_LOCK
1488
1489
1490 # _LT_PROG_AR
1491 # -----------
1492 m4_defun([_LT_PROG_AR],
1493 [AC_CHECK_TOOLS(AR, [ar], false)
1494 : ${AR=ar}
1495 : ${AR_FLAGS=cru}
1496 _LT_DECL([], [AR], [1], [The archiver])
1497 _LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive])
1498
1499 AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
1500 [lt_cv_ar_at_file=no
1501 AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
1502 [echo conftest.$ac_objext > conftest.lst
1503 lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD'
1504 AC_TRY_EVAL([lt_ar_try])
1505 if test 0 -eq "$ac_status"; then
1506 # Ensure the archiver fails upon bogus file names.
1507 rm -f conftest.$ac_objext libconftest.a
1508 AC_TRY_EVAL([lt_ar_try])
1509 if test 0 -ne "$ac_status"; then
1510 lt_cv_ar_at_file=@
1511 fi
1512 fi
1513 rm -f conftest.* libconftest.a
1514 ])
1515 ])
1516
1517 if test no = "$lt_cv_ar_at_file"; then
1518 archiver_list_spec=
1519 else
1520 archiver_list_spec=$lt_cv_ar_at_file
1521 fi
1522 _LT_DECL([], [archiver_list_spec], [1],
1523 [How to feed a file listing to the archiver])
1524 ])# _LT_PROG_AR
1525
1526
1527 # _LT_CMD_OLD_ARCHIVE
1528 # -------------------
1529 m4_defun([_LT_CMD_OLD_ARCHIVE],
1530 [_LT_PROG_AR
1531
1532 AC_CHECK_TOOL(STRIP, strip, :)
1533 test -z "$STRIP" && STRIP=:
1534 _LT_DECL([], [STRIP], [1], [A symbol stripping program])
1535
1536 AC_CHECK_TOOL(RANLIB, ranlib, :)
1537 test -z "$RANLIB" && RANLIB=:
1538 _LT_DECL([], [RANLIB], [1],
1539 [Commands used to install an old-style archive])
1540
1541 # Determine commands to create old-style static archives.
1542 old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
1543 old_postinstall_cmds='chmod 644 $oldlib'
1544 old_postuninstall_cmds=
1545
1546 if test -n "$RANLIB"; then
1547 case $host_os in
1548 bitrig* | openbsd*)
1549 old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
1550 ;;
1551 *)
1552 old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
1553 ;;
1554 esac
1555 old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
1556 fi
1557
1558 case $host_os in
1559 darwin*)
1560 lock_old_archive_extraction=yes ;;
1561 *)
1562 lock_old_archive_extraction=no ;;
1563 esac
1564 _LT_DECL([], [old_postinstall_cmds], [2])
1565 _LT_DECL([], [old_postuninstall_cmds], [2])
1566 _LT_TAGDECL([], [old_archive_cmds], [2],
1567 [Commands used to build an old-style archive])
1568 _LT_DECL([], [lock_old_archive_extraction], [0],
1569 [Whether to use a lock for old archive extraction])
1570 ])# _LT_CMD_OLD_ARCHIVE
1571
1572
1573 # _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
1574 # [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
1575 # ----------------------------------------------------------------
1576 # Check whether the given compiler option works
1577 AC_DEFUN([_LT_COMPILER_OPTION],
1578 [m4_require([_LT_FILEUTILS_DEFAULTS])dnl
1579 m4_require([_LT_DECL_SED])dnl
1580 AC_CACHE_CHECK([$1], [$2],
1581 [$2=no
1582 m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
1583 echo "$lt_simple_compile_test_code" > conftest.$ac_ext
1584 lt_compiler_flag="$3" ## exclude from sc_useless_quotes_in_assignment
1585 # Insert the option either (1) after the last *FLAGS variable, or
1586 # (2) before a word containing "conftest.", or (3) at the end.
1587 # Note that $ac_compile itself does not contain backslashes and begins
1588 # with a dollar sign (not a hyphen), so the echo should work correctly.
1589 # The option is referenced via a variable to avoid confusing sed.
1590 lt_compile=`echo "$ac_compile" | $SED \
1591 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
1592 -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
1593 -e 's:$: $lt_compiler_flag:'`
1594 (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
1595 (eval "$lt_compile" 2>conftest.err)
1596 ac_status=$?
1597 cat conftest.err >&AS_MESSAGE_LOG_FD
1598 echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
1599 if (exit $ac_status) && test -s "$ac_outfile"; then
1600 # The compiler can only warn and ignore the option if not recognized
1601 # So say no if there are warnings other than the usual output.
1602 $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
1603 $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
1604 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
1605 $2=yes
1606 fi
1607 fi
1608 $RM conftest*
1609 ])
1610
1611 if test yes = "[$]$2"; then
1612 m4_if([$5], , :, [$5])
1613 else
1614 m4_if([$6], , :, [$6])
1615 fi
1616 ])# _LT_COMPILER_OPTION
1617
1618 # Old name:
1619 AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
1620 dnl aclocal-1.4 backwards compatibility:
1621 dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
1622
1623
1624 # _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
1625 # [ACTION-SUCCESS], [ACTION-FAILURE])
1626 # ----------------------------------------------------
1627 # Check whether the given linker option works
1628 AC_DEFUN([_LT_LINKER_OPTION],
1629 [m4_require([_LT_FILEUTILS_DEFAULTS])dnl
1630 m4_require([_LT_DECL_SED])dnl
1631 AC_CACHE_CHECK([$1], [$2],
1632 [$2=no
1633 save_LDFLAGS=$LDFLAGS
1634 LDFLAGS="$LDFLAGS $3"
1635 echo "$lt_simple_link_test_code" > conftest.$ac_ext
1636 if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
1637 # The linker can only warn and ignore the option if not recognized
1638 # So say no if there are warnings
1639 if test -s conftest.err; then
1640 # Append any errors to the config.log.
1641 cat conftest.err 1>&AS_MESSAGE_LOG_FD
1642 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
1643 $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
1644 if diff conftest.exp conftest.er2 >/dev/null; then
1645 $2=yes
1646 fi
1647 else
1648 $2=yes
1649 fi
1650 fi
1651 $RM -r conftest*
1652 LDFLAGS=$save_LDFLAGS
1653 ])
1654
1655 if test yes = "[$]$2"; then
1656 m4_if([$4], , :, [$4])
1657 else
1658 m4_if([$5], , :, [$5])
1659 fi
1660 ])# _LT_LINKER_OPTION
1661
1662 # Old name:
1663 AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
1664 dnl aclocal-1.4 backwards compatibility:
1665 dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
1666
1667
1668 # LT_CMD_MAX_LEN
1669 #---------------
1670 AC_DEFUN([LT_CMD_MAX_LEN],
1671 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
1672 # find the maximum length of command line arguments
1673 AC_MSG_CHECKING([the maximum length of command line arguments])
1674 AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
1675 i=0
1676 teststring=ABCD
1677
1678 case $build_os in
1679 msdosdjgpp*)
1680 # On DJGPP, this test can blow up pretty badly due to problems in libc
1681 # (any single argument exceeding 2000 bytes causes a buffer overrun
1682 # during glob expansion). Even if it were fixed, the result of this
1683 # check would be larger than it should be.
1684 lt_cv_sys_max_cmd_len=12288; # 12K is about right
1685 ;;
1686
1687 gnu*)
1688 # Under GNU Hurd, this test is not required because there is
1689 # no limit to the length of command line arguments.
1690 # Libtool will interpret -1 as no limit whatsoever
1691 lt_cv_sys_max_cmd_len=-1;
1692 ;;
1693
1694 cygwin* | mingw* | cegcc*)
1695 # On Win9x/ME, this test blows up -- it succeeds, but takes
1696 # about 5 minutes as the teststring grows exponentially.
1697 # Worse, since 9x/ME are not pre-emptively multitasking,
1698 # you end up with a "frozen" computer, even though with patience
1699 # the test eventually succeeds (with a max line length of 256k).
1700 # Instead, let's just punt: use the minimum linelength reported by
1701 # all of the supported platforms: 8192 (on NT/2K/XP).
1702 lt_cv_sys_max_cmd_len=8192;
1703 ;;
1704
1705 mint*)
1706 # On MiNT this can take a long time and run out of memory.
1707 lt_cv_sys_max_cmd_len=8192;
1708 ;;
1709
1710 amigaos*)
1711 # On AmigaOS with pdksh, this test takes hours, literally.
1712 # So we just punt and use a minimum line length of 8192.
1713 lt_cv_sys_max_cmd_len=8192;
1714 ;;
1715
1716 bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*)
1717 # This has been around since 386BSD, at least. Likely further.
1718 if test -x /sbin/sysctl; then
1719 lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
1720 elif test -x /usr/sbin/sysctl; then
1721 lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
1722 else
1723 lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs
1724 fi
1725 # And add a safety zone
1726 lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
1727 lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
1728 ;;
1729
1730 interix*)
1731 # We know the value 262144 and hardcode it with a safety zone (like BSD)
1732 lt_cv_sys_max_cmd_len=196608
1733 ;;
1734
1735 os2*)
1736 # The test takes a long time on OS/2.
1737 lt_cv_sys_max_cmd_len=8192
1738 ;;
1739
1740 osf*)
1741 # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
1742 # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
1743 # nice to cause kernel panics so lets avoid the loop below.
1744 # First set a reasonable default.
1745 lt_cv_sys_max_cmd_len=16384
1746 #
1747 if test -x /sbin/sysconfig; then
1748 case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
1749 *1*) lt_cv_sys_max_cmd_len=-1 ;;
1750 esac
1751 fi
1752 ;;
1753 sco3.2v5*)
1754 lt_cv_sys_max_cmd_len=102400
1755 ;;
1756 sysv5* | sco5v6* | sysv4.2uw2*)
1757 kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
1758 if test -n "$kargmax"; then
1759 lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'`
1760 else
1761 lt_cv_sys_max_cmd_len=32768
1762 fi
1763 ;;
1764 *)
1765 lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
1766 if test -n "$lt_cv_sys_max_cmd_len" && \
1767 test undefined != "$lt_cv_sys_max_cmd_len"; then
1768 lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
1769 lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
1770 else
1771 # Make teststring a little bigger before we do anything with it.
1772 # a 1K string should be a reasonable start.
1773 for i in 1 2 3 4 5 6 7 8; do
1774 teststring=$teststring$teststring
1775 done
1776 SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
1777 # If test is not a shell built-in, we'll probably end up computing a
1778 # maximum length that is only half of the actual maximum length, but
1779 # we can't tell.
1780 while { test X`env echo "$teststring$teststring" 2>/dev/null` \
1781 = "X$teststring$teststring"; } >/dev/null 2>&1 &&
1782 test 17 != "$i" # 1/2 MB should be enough
1783 do
1784 i=`expr $i + 1`
1785 teststring=$teststring$teststring
1786 done
1787 # Only check the string length outside the loop.
1788 lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
1789 teststring=
1790 # Add a significant safety factor because C++ compilers can tack on
1791 # massive amounts of additional arguments before passing them to the
1792 # linker. It appears as though 1/2 is a usable value.
1793 lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
1794 fi
1795 ;;
1796 esac
1797 ])
1798 if test -n "$lt_cv_sys_max_cmd_len"; then
1799 AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
1800 else
1801 AC_MSG_RESULT(none)
1802 fi
1803 max_cmd_len=$lt_cv_sys_max_cmd_len
1804 _LT_DECL([], [max_cmd_len], [0],
1805 [What is the maximum length of a command?])
1806 ])# LT_CMD_MAX_LEN
1807
1808 # Old name:
1809 AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
1810 dnl aclocal-1.4 backwards compatibility:
1811 dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
1812
1813
1814 # _LT_HEADER_DLFCN
1815 # ----------------
1816 m4_defun([_LT_HEADER_DLFCN],
1817 [AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
1818 ])# _LT_HEADER_DLFCN
1819
1820
1821 # _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
1822 # ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
1823 # ----------------------------------------------------------------
1824 m4_defun([_LT_TRY_DLOPEN_SELF],
1825 [m4_require([_LT_HEADER_DLFCN])dnl
1826 if test yes = "$cross_compiling"; then :
1827 [$4]
1828 else
1829 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
1830 lt_status=$lt_dlunknown
1831 cat > conftest.$ac_ext <<_LT_EOF
1832 [#line $LINENO "configure"
1833 #include "confdefs.h"
1834
1835 #if HAVE_DLFCN_H
1836 #include <dlfcn.h>
1837 #endif
1838
1839 #include <stdio.h>
1840
1841 #ifdef RTLD_GLOBAL
1842 # define LT_DLGLOBAL RTLD_GLOBAL
1843 #else
1844 # ifdef DL_GLOBAL
1845 # define LT_DLGLOBAL DL_GLOBAL
1846 # else
1847 # define LT_DLGLOBAL 0
1848 # endif
1849 #endif
1850
1851 /* We may have to define LT_DLLAZY_OR_NOW in the command line if we
1852 find out it does not work in some platform. */
1853 #ifndef LT_DLLAZY_OR_NOW
1854 # ifdef RTLD_LAZY
1855 # define LT_DLLAZY_OR_NOW RTLD_LAZY
1856 # else
1857 # ifdef DL_LAZY
1858 # define LT_DLLAZY_OR_NOW DL_LAZY
1859 # else
1860 # ifdef RTLD_NOW
1861 # define LT_DLLAZY_OR_NOW RTLD_NOW
1862 # else
1863 # ifdef DL_NOW
1864 # define LT_DLLAZY_OR_NOW DL_NOW
1865 # else
1866 # define LT_DLLAZY_OR_NOW 0
1867 # endif
1868 # endif
1869 # endif
1870 # endif
1871 #endif
1872
1873 /* When -fvisibility=hidden is used, assume the code has been annotated
1874 correspondingly for the symbols needed. */
1875 #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
1876 int fnord () __attribute__((visibility("default")));
1877 #endif
1878
1879 int fnord () { return 42; }
1880 int main ()
1881 {
1882 void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
1883 int status = $lt_dlunknown;
1884
1885 if (self)
1886 {
1887 if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
1888 else
1889 {
1890 if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
1891 else puts (dlerror ());
1892 }
1893 /* dlclose (self); */
1894 }
1895 else
1896 puts (dlerror ());
1897
1898 return status;
1899 }]
1900 _LT_EOF
1901 if AC_TRY_EVAL(ac_link) && test -s "conftest$ac_exeext" 2>/dev/null; then
1902 (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
1903 lt_status=$?
1904 case x$lt_status in
1905 x$lt_dlno_uscore) $1 ;;
1906 x$lt_dlneed_uscore) $2 ;;
1907 x$lt_dlunknown|x*) $3 ;;
1908 esac
1909 else :
1910 # compilation failed
1911 $3
1912 fi
1913 fi
1914 rm -fr conftest*
1915 ])# _LT_TRY_DLOPEN_SELF
1916
1917
1918 # LT_SYS_DLOPEN_SELF
1919 # ------------------
1920 AC_DEFUN([LT_SYS_DLOPEN_SELF],
1921 [m4_require([_LT_HEADER_DLFCN])dnl
1922 if test yes != "$enable_dlopen"; then
1923 enable_dlopen=unknown
1924 enable_dlopen_self=unknown
1925 enable_dlopen_self_static=unknown
1926 else
1927 lt_cv_dlopen=no
1928 lt_cv_dlopen_libs=
1929
1930 case $host_os in
1931 beos*)
1932 lt_cv_dlopen=load_add_on
1933 lt_cv_dlopen_libs=
1934 lt_cv_dlopen_self=yes
1935 ;;
1936
1937 mingw* | pw32* | cegcc*)
1938 lt_cv_dlopen=LoadLibrary
1939 lt_cv_dlopen_libs=
1940 ;;
1941
1942 cygwin*)
1943 lt_cv_dlopen=dlopen
1944 lt_cv_dlopen_libs=
1945 ;;
1946
1947 darwin*)
1948 # if libdl is installed we need to link against it
1949 AC_CHECK_LIB([dl], [dlopen],
1950 [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],[
1951 lt_cv_dlopen=dyld
1952 lt_cv_dlopen_libs=
1953 lt_cv_dlopen_self=yes
1954 ])
1955 ;;
1956
1957 tpf*)
1958 # Don't try to run any link tests for TPF. We know it's impossible
1959 # because TPF is a cross-compiler, and we know how we open DSOs.
1960 lt_cv_dlopen=dlopen
1961 lt_cv_dlopen_libs=
1962 lt_cv_dlopen_self=no
1963 ;;
1964
1965 *)
1966 AC_CHECK_FUNC([shl_load],
1967 [lt_cv_dlopen=shl_load],
1968 [AC_CHECK_LIB([dld], [shl_load],
1969 [lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld],
1970 [AC_CHECK_FUNC([dlopen],
1971 [lt_cv_dlopen=dlopen],
1972 [AC_CHECK_LIB([dl], [dlopen],
1973 [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],
1974 [AC_CHECK_LIB([svld], [dlopen],
1975 [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld],
1976 [AC_CHECK_LIB([dld], [dld_link],
1977 [lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld])
1978 ])
1979 ])
1980 ])
1981 ])
1982 ])
1983 ;;
1984 esac
1985
1986 if test no = "$lt_cv_dlopen"; then
1987 enable_dlopen=no
1988 else
1989 enable_dlopen=yes
1990 fi
1991
1992 case $lt_cv_dlopen in
1993 dlopen)
1994 save_CPPFLAGS=$CPPFLAGS
1995 test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
1996
1997 save_LDFLAGS=$LDFLAGS
1998 wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
1999
2000 save_LIBS=$LIBS
2001 LIBS="$lt_cv_dlopen_libs $LIBS"
2002
2003 AC_CACHE_CHECK([whether a program can dlopen itself],
2004 lt_cv_dlopen_self, [dnl
2005 _LT_TRY_DLOPEN_SELF(
2006 lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
2007 lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
2008 ])
2009
2010 if test yes = "$lt_cv_dlopen_self"; then
2011 wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
2012 AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
2013 lt_cv_dlopen_self_static, [dnl
2014 _LT_TRY_DLOPEN_SELF(
2015 lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
2016 lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross)
2017 ])
2018 fi
2019
2020 CPPFLAGS=$save_CPPFLAGS
2021 LDFLAGS=$save_LDFLAGS
2022 LIBS=$save_LIBS
2023 ;;
2024 esac
2025
2026 case $lt_cv_dlopen_self in
2027 yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
2028 *) enable_dlopen_self=unknown ;;
2029 esac
2030
2031 case $lt_cv_dlopen_self_static in
2032 yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
2033 *) enable_dlopen_self_static=unknown ;;
2034 esac
2035 fi
2036 _LT_DECL([dlopen_support], [enable_dlopen], [0],
2037 [Whether dlopen is supported])
2038 _LT_DECL([dlopen_self], [enable_dlopen_self], [0],
2039 [Whether dlopen of programs is supported])
2040 _LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
2041 [Whether dlopen of statically linked programs is supported])
2042 ])# LT_SYS_DLOPEN_SELF
2043
2044 # Old name:
2045 AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
2046 dnl aclocal-1.4 backwards compatibility:
2047 dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
2048
2049
2050 # _LT_COMPILER_C_O([TAGNAME])
2051 # ---------------------------
2052 # Check to see if options -c and -o are simultaneously supported by compiler.
2053 # This macro does not hard code the compiler like AC_PROG_CC_C_O.
2054 m4_defun([_LT_COMPILER_C_O],
2055 [m4_require([_LT_DECL_SED])dnl
2056 m4_require([_LT_FILEUTILS_DEFAULTS])dnl
2057 m4_require([_LT_TAG_COMPILER])dnl
2058 AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
2059 [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
2060 [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
2061 $RM -r conftest 2>/dev/null
2062 mkdir conftest
2063 cd conftest
2064 mkdir out
2065 echo "$lt_simple_compile_test_code" > conftest.$ac_ext
2066
2067 lt_compiler_flag="-o out/conftest2.$ac_objext"
2068 # Insert the option either (1) after the last *FLAGS variable, or
2069 # (2) before a word containing "conftest.", or (3) at the end.
2070 # Note that $ac_compile itself does not contain backslashes and begins
2071 # with a dollar sign (not a hyphen), so the echo should work correctly.
2072 lt_compile=`echo "$ac_compile" | $SED \
2073 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
2074 -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
2075 -e 's:$: $lt_compiler_flag:'`
2076 (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
2077 (eval "$lt_compile" 2>out/conftest.err)
2078 ac_status=$?
2079 cat out/conftest.err >&AS_MESSAGE_LOG_FD
2080 echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
2081 if (exit $ac_status) && test -s out/conftest2.$ac_objext
2082 then
2083 # The compiler can only warn and ignore the option if not recognized
2084 # So say no if there are warnings
2085 $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
2086 $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
2087 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
2088 _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
2089 fi
2090 fi
2091 chmod u+w . 2>&AS_MESSAGE_LOG_FD
2092 $RM conftest*
2093 # SGI C++ compiler will create directory out/ii_files/ for
2094 # template instantiation
2095 test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
2096 $RM out/* && rmdir out
2097 cd ..
2098 $RM -r conftest
2099 $RM conftest*
2100 ])
2101 _LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
2102 [Does compiler simultaneously support -c and -o options?])
2103 ])# _LT_COMPILER_C_O
2104
2105
2106 # _LT_COMPILER_FILE_LOCKS([TAGNAME])
2107 # ----------------------------------
2108 # Check to see if we can do hard links to lock some files if needed
2109 m4_defun([_LT_COMPILER_FILE_LOCKS],
2110 [m4_require([_LT_ENABLE_LOCK])dnl
2111 m4_require([_LT_FILEUTILS_DEFAULTS])dnl
2112 _LT_COMPILER_C_O([$1])
2113
2114 hard_links=nottested
2115 if test no = "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" && test no != "$need_locks"; then
2116 # do not overwrite the value of need_locks provided by the user
2117 AC_MSG_CHECKING([if we can lock with hard links])
2118 hard_links=yes
2119 $RM conftest*
2120 ln conftest.a conftest.b 2>/dev/null && hard_links=no
2121 touch conftest.a
2122 ln conftest.a conftest.b 2>&5 || hard_links=no
2123 ln conftest.a conftest.b 2>/dev/null && hard_links=no
2124 AC_MSG_RESULT([$hard_links])
2125 if test no = "$hard_links"; then
2126 AC_MSG_WARN(['$CC' does not support '-c -o', so 'make -j' may be unsafe])
2127 need_locks=warn
2128 fi
2129 else
2130 need_locks=no
2131 fi
2132 _LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
2133 ])# _LT_COMPILER_FILE_LOCKS
2134
2135
2136 # _LT_CHECK_OBJDIR
2137 # ----------------
2138 m4_defun([_LT_CHECK_OBJDIR],
2139 [AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
2140 [rm -f .libs 2>/dev/null
2141 mkdir .libs 2>/dev/null
2142 if test -d .libs; then
2143 lt_cv_objdir=.libs
2144 else
2145 # MS-DOS does not allow filenames that begin with a dot.
2146 lt_cv_objdir=_libs
2147 fi
2148 rmdir .libs 2>/dev/null])
2149 objdir=$lt_cv_objdir
2150 _LT_DECL([], [objdir], [0],
2151 [The name of the directory that contains temporary libtool files])dnl
2152 m4_pattern_allow([LT_OBJDIR])dnl
2153 AC_DEFINE_UNQUOTED([LT_OBJDIR], "$lt_cv_objdir/",
2154 [Define to the sub-directory where libtool stores uninstalled libraries.])
2155 ])# _LT_CHECK_OBJDIR
2156
2157
2158 # _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
2159 # --------------------------------------
2160 # Check hardcoding attributes.
2161 m4_defun([_LT_LINKER_HARDCODE_LIBPATH],
2162 [AC_MSG_CHECKING([how to hardcode library paths into programs])
2163 _LT_TAGVAR(hardcode_action, $1)=
2164 if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
2165 test -n "$_LT_TAGVAR(runpath_var, $1)" ||
2166 test yes = "$_LT_TAGVAR(hardcode_automatic, $1)"; then
2167
2168 # We can hardcode non-existent directories.
2169 if test no != "$_LT_TAGVAR(hardcode_direct, $1)" &&
2170 # If the only mechanism to avoid hardcoding is shlibpath_var, we
2171 # have to relink, otherwise we might link with an installed library
2172 # when we should be linking with a yet-to-be-installed one
2173 ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" &&
2174 test no != "$_LT_TAGVAR(hardcode_minus_L, $1)"; then
2175 # Linking always hardcodes the temporary library directory.
2176 _LT_TAGVAR(hardcode_action, $1)=relink
2177 else
2178 # We can link without hardcoding, and we can hardcode nonexisting dirs.
2179 _LT_TAGVAR(hardcode_action, $1)=immediate
2180 fi
2181 else
2182 # We cannot hardcode anything, or else we can only hardcode existing
2183 # directories.
2184 _LT_TAGVAR(hardcode_action, $1)=unsupported
2185 fi
2186 AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
2187
2188 if test relink = "$_LT_TAGVAR(hardcode_action, $1)" ||
2189 test yes = "$_LT_TAGVAR(inherit_rpath, $1)"; then
2190 # Fast installation is not supported
2191 enable_fast_install=no
2192 elif test yes = "$shlibpath_overrides_runpath" ||
2193 test no = "$enable_shared"; then
2194 # Fast installation is not necessary
2195 enable_fast_install=needless
2196 fi
2197 _LT_TAGDECL([], [hardcode_action], [0],
2198 [How to hardcode a shared library path into an executable])
2199 ])# _LT_LINKER_HARDCODE_LIBPATH
2200
2201
2202 # _LT_CMD_STRIPLIB
2203 # ----------------
2204 m4_defun([_LT_CMD_STRIPLIB],
2205 [m4_require([_LT_DECL_EGREP])
2206 striplib=
2207 old_striplib=
2208 AC_MSG_CHECKING([whether stripping libraries is possible])
2209 if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
2210 test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
2211 test -z "$striplib" && striplib="$STRIP --strip-unneeded"
2212 AC_MSG_RESULT([yes])
2213 else
2214 # FIXME - insert some real tests, host_os isn't really good enough
2215 case $host_os in
2216 darwin*)
2217 if test -n "$STRIP"; then
2218 striplib="$STRIP -x"
2219 old_striplib="$STRIP -S"
2220 AC_MSG_RESULT([yes])
2221 else
2222 AC_MSG_RESULT([no])
2223 fi
2224 ;;
2225 *)
2226 AC_MSG_RESULT([no])
2227 ;;
2228 esac
2229 fi
2230 _LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
2231 _LT_DECL([], [striplib], [1])
2232 ])# _LT_CMD_STRIPLIB
2233
2234
2235 # _LT_PREPARE_MUNGE_PATH_LIST
2236 # ---------------------------
2237 # Make sure func_munge_path_list() is defined correctly.
2238 m4_defun([_LT_PREPARE_MUNGE_PATH_LIST],
2239 [[# func_munge_path_list VARIABLE PATH
2240 # -----------------------------------
2241 # VARIABLE is name of variable containing _space_ separated list of
2242 # directories to be munged by the contents of PATH, which is string
2243 # having a format:
2244 # "DIR[:DIR]:"
2245 # string "DIR[ DIR]" will be prepended to VARIABLE
2246 # ":DIR[:DIR]"
2247 # string "DIR[ DIR]" will be appended to VARIABLE
2248 # "DIRP[:DIRP]::[DIRA:]DIRA"
2249 # string "DIRP[ DIRP]" will be prepended to VARIABLE and string
2250 # "DIRA[ DIRA]" will be appended to VARIABLE
2251 # "DIR[:DIR]"
2252 # VARIABLE will be replaced by "DIR[ DIR]"
2253 func_munge_path_list ()
2254 {
2255 case x@S|@2 in
2256 x)
2257 ;;
2258 *:)
2259 eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'` \@S|@@S|@1\"
2260 ;;
2261 x:*)
2262 eval @S|@1=\"\@S|@@S|@1 `$ECHO @S|@2 | $SED 's/:/ /g'`\"
2263 ;;
2264 *::*)
2265 eval @S|@1=\"\@S|@@S|@1\ `$ECHO @S|@2 | $SED -e 's/.*:://' -e 's/:/ /g'`\"
2266 eval @S|@1=\"`$ECHO @S|@2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \@S|@@S|@1\"
2267 ;;
2268 *)
2269 eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'`\"
2270 ;;
2271 esac
2272 }
2273 ]])# _LT_PREPARE_PATH_LIST
2274
2275
2276 # _LT_SYS_DYNAMIC_LINKER([TAG])
2277 # -----------------------------
2278 # PORTME Fill in your ld.so characteristics
2279 m4_defun([_LT_SYS_DYNAMIC_LINKER],
2280 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
2281 m4_require([_LT_DECL_EGREP])dnl
2282 m4_require([_LT_FILEUTILS_DEFAULTS])dnl
2283 m4_require([_LT_DECL_OBJDUMP])dnl
2284 m4_require([_LT_DECL_SED])dnl
2285 m4_require([_LT_CHECK_SHELL_FEATURES])dnl
2286 m4_require([_LT_PREPARE_MUNGE_PATH_LIST])dnl
2287 AC_MSG_CHECKING([dynamic linker characteristics])
2288 m4_if([$1],
2289 [], [
2290 if test yes = "$GCC"; then
2291 case $host_os in
2292 darwin*) lt_awk_arg='/^libraries:/,/LR/' ;;
2293 *) lt_awk_arg='/^libraries:/' ;;
2294 esac
2295 case $host_os in
2296 mingw* | cegcc*) lt_sed_strip_eq='s|=\([[A-Za-z]]:\)|\1|g' ;;
2297 *) lt_sed_strip_eq='s|=/|/|g' ;;
2298 esac
2299 lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
2300 case $lt_search_path_spec in
2301 *\;*)
2302 # if the path contains ";" then we assume it to be the separator
2303 # otherwise default to the standard path separator (i.e. ":") - it is
2304 # assumed that no part of a normal pathname contains ";" but that should
2305 # okay in the real world where ";" in dirpaths is itself problematic.
2306 lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
2307 ;;
2308 *)
2309 lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
2310 ;;
2311 esac
2312 # Ok, now we have the path, separated by spaces, we can step through it
2313 # and add multilib dir if necessary...
2314 lt_tmp_lt_search_path_spec=
2315 lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
2316 # ...but if some path component already ends with the multilib dir we assume
2317 # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer).
2318 case "$lt_multi_os_dir; $lt_search_path_spec " in
2319 "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*)
2320 lt_multi_os_dir=
2321 ;;
2322 esac
2323 for lt_sys_path in $lt_search_path_spec; do
2324 if test -d "$lt_sys_path$lt_multi_os_dir"; then
2325 lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir"
2326 elif test -n "$lt_multi_os_dir"; then
2327 test -d "$lt_sys_path" && \
2328 lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
2329 fi
2330 done
2331 lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
2332 BEGIN {RS = " "; FS = "/|\n";} {
2333 lt_foo = "";
2334 lt_count = 0;
2335 for (lt_i = NF; lt_i > 0; lt_i--) {
2336 if ($lt_i != "" && $lt_i != ".") {
2337 if ($lt_i == "..") {
2338 lt_count++;
2339 } else {
2340 if (lt_count == 0) {
2341 lt_foo = "/" $lt_i lt_foo;
2342 } else {
2343 lt_count--;
2344 }
2345 }
2346 }
2347 }
2348 if (lt_foo != "") { lt_freq[[lt_foo]]++; }
2349 if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
2350 }'`
2351 # AWK program above erroneously prepends '/' to C:/dos/paths
2352 # for these hosts.
2353 case $host_os in
2354 mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
2355 $SED 's|/\([[A-Za-z]]:\)|\1|g'` ;;
2356 esac
2357 sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
2358 else
2359 sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
2360 fi])
2361 library_names_spec=
2362 libname_spec='lib$name'
2363 soname_spec=
2364 shrext_cmds=.so
2365 postinstall_cmds=
2366 postuninstall_cmds=
2367 finish_cmds=
2368 finish_eval=
2369 shlibpath_var=
2370 shlibpath_overrides_runpath=unknown
2371 version_type=none
2372 dynamic_linker="$host_os ld.so"
2373 sys_lib_dlsearch_path_spec="/lib /usr/lib"
2374 need_lib_prefix=unknown
2375 hardcode_into_libs=no
2376
2377 # when you set need_version to no, make sure it does not cause -set_version
2378 # flags to be left without arguments
2379 need_version=unknown
2380
2381 AC_ARG_VAR([LT_SYS_LIBRARY_PATH],
2382 [User-defined run-time library search path.])
2383
2384 case $host_os in
2385 aix3*)
2386 version_type=linux # correct to gnu/linux during the next big refactor
2387 library_names_spec='$libname$release$shared_ext$versuffix $libname.a'
2388 shlibpath_var=LIBPATH
2389
2390 # AIX 3 has no versioning support, so we append a major version to the name.
2391 soname_spec='$libname$release$shared_ext$major'
2392 ;;
2393
2394 aix[[4-9]]*)
2395 version_type=linux # correct to gnu/linux during the next big refactor
2396 need_lib_prefix=no
2397 need_version=no
2398 hardcode_into_libs=yes
2399 if test ia64 = "$host_cpu"; then
2400 # AIX 5 supports IA64
2401 library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext'
2402 shlibpath_var=LD_LIBRARY_PATH
2403 else
2404 # With GCC up to 2.95.x, collect2 would create an import file
2405 # for dependence libraries. The import file would start with
2406 # the line '#! .'. This would cause the generated library to
2407 # depend on '.', always an invalid library. This was fixed in
2408 # development snapshots of GCC prior to 3.0.
2409 case $host_os in
2410 aix4 | aix4.[[01]] | aix4.[[01]].*)
2411 if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
2412 echo ' yes '
2413 echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then
2414 :
2415 else
2416 can_build_shared=no
2417 fi
2418 ;;
2419 esac
2420 # Using Import Files as archive members, it is possible to support
2421 # filename-based versioning of shared library archives on AIX. While
2422 # this would work for both with and without runtime linking, it will
2423 # prevent static linking of such archives. So we do filename-based
2424 # shared library versioning with .so extension only, which is used
2425 # when both runtime linking and shared linking is enabled.
2426 # Unfortunately, runtime linking may impact performance, so we do
2427 # not want this to be the default eventually. Also, we use the
2428 # versioned .so libs for executables only if there is the -brtl
2429 # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only.
2430 # To allow for filename-based versioning support, we need to create
2431 # libNAME.so.V as an archive file, containing:
2432 # *) an Import File, referring to the versioned filename of the
2433 # archive as well as the shared archive member, telling the
2434 # bitwidth (32 or 64) of that shared object, and providing the
2435 # list of exported symbols of that shared object, eventually
2436 # decorated with the 'weak' keyword
2437 # *) the shared object with the F_LOADONLY flag set, to really avoid
2438 # it being seen by the linker.
2439 # At run time we better use the real file rather than another symlink,
2440 # but for link time we create the symlink libNAME.so -> libNAME.so.V
2441
2442 case $with_aix_soname,$aix_use_runtimelinking in
2443 # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct
2444 # soname into executable. Probably we can add versioning support to
2445 # collect2, so additional links can be useful in future.
2446 aix,yes) # traditional libtool
2447 dynamic_linker='AIX unversionable lib.so'
2448 # If using run time linking (on AIX 4.2 or later) use lib<name>.so
2449 # instead of lib<name>.a to let people know that these are not
2450 # typical AIX shared libraries.
2451 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2452 ;;
2453 aix,no) # traditional AIX only
2454 dynamic_linker='AIX lib.a[(]lib.so.V[)]'
2455 # We preserve .a as extension for shared libraries through AIX4.2
2456 # and later when we are not doing run time linking.
2457 library_names_spec='$libname$release.a $libname.a'
2458 soname_spec='$libname$release$shared_ext$major'
2459 ;;
2460 svr4,*) # full svr4 only
2461 dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)]"
2462 library_names_spec='$libname$release$shared_ext$major $libname$shared_ext'
2463 # We do not specify a path in Import Files, so LIBPATH fires.
2464 shlibpath_overrides_runpath=yes
2465 ;;
2466 *,yes) # both, prefer svr4
2467 dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)], lib.a[(]lib.so.V[)]"
2468 library_names_spec='$libname$release$shared_ext$major $libname$shared_ext'
2469 # unpreferred sharedlib libNAME.a needs extra handling
2470 postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"'
2471 postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"'
2472 # We do not specify a path in Import Files, so LIBPATH fires.
2473 shlibpath_overrides_runpath=yes
2474 ;;
2475 *,no) # both, prefer aix
2476 dynamic_linker="AIX lib.a[(]lib.so.V[)], lib.so.V[(]$shared_archive_member_spec.o[)]"
2477 library_names_spec='$libname$release.a $libname.a'
2478 soname_spec='$libname$release$shared_ext$major'
2479 # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling
2480 postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)'
2481 postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"'
2482 ;;
2483 esac
2484 shlibpath_var=LIBPATH
2485 fi
2486 ;;
2487
2488 amigaos*)
2489 case $host_cpu in
2490 powerpc)
2491 # Since July 2007 AmigaOS4 officially supports .so libraries.
2492 # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
2493 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2494 ;;
2495 m68k)
2496 library_names_spec='$libname.ixlibrary $libname.a'
2497 # Create ${libname}_ixlibrary.a entries in /sys/libs.
2498 finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
2499 ;;
2500 esac
2501 ;;
2502
2503 beos*)
2504 library_names_spec='$libname$shared_ext'
2505 dynamic_linker="$host_os ld.so"
2506 shlibpath_var=LIBRARY_PATH
2507 ;;
2508
2509 bsdi[[45]]*)
2510 version_type=linux # correct to gnu/linux during the next big refactor
2511 need_version=no
2512 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2513 soname_spec='$libname$release$shared_ext$major'
2514 finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
2515 shlibpath_var=LD_LIBRARY_PATH
2516 sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
2517 sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
2518 # the default ld.so.conf also contains /usr/contrib/lib and
2519 # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
2520 # libtool to hard-code these into programs
2521 ;;
2522
2523 cygwin* | mingw* | pw32* | cegcc*)
2524 version_type=windows
2525 shrext_cmds=.dll
2526 need_version=no
2527 need_lib_prefix=no
2528
2529 case $GCC,$cc_basename in
2530 yes,*)
2531 # gcc
2532 library_names_spec='$libname.dll.a'
2533 # DLL is installed to $(libdir)/../bin by postinstall_cmds
2534 postinstall_cmds='base_file=`basename \$file`~
2535 dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
2536 dldir=$destdir/`dirname \$dlpath`~
2537 test -d \$dldir || mkdir -p \$dldir~
2538 $install_prog $dir/$dlname \$dldir/$dlname~
2539 chmod a+x \$dldir/$dlname~
2540 if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
2541 eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
2542 fi'
2543 postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
2544 dlpath=$dir/\$dldll~
2545 $RM \$dlpath'
2546 shlibpath_overrides_runpath=yes
2547
2548 case $host_os in
2549 cygwin*)
2550 # Cygwin DLLs use 'cyg' prefix rather than 'lib'
2551 soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
2552 m4_if([$1], [],[
2553 sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
2554 ;;
2555 mingw* | cegcc*)
2556 # MinGW DLLs use traditional 'lib' prefix
2557 soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
2558 ;;
2559 pw32*)
2560 # pw32 DLLs use 'pw' prefix rather than 'lib'
2561 library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
2562 ;;
2563 esac
2564 dynamic_linker='Win32 ld.exe'
2565 ;;
2566
2567 *,cl*)
2568 # Native MSVC
2569 libname_spec='$name'
2570 soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
2571 library_names_spec='$libname.dll.lib'
2572
2573 case $build_os in
2574 mingw*)
2575 sys_lib_search_path_spec=
2576 lt_save_ifs=$IFS
2577 IFS=';'
2578 for lt_path in $LIB
2579 do
2580 IFS=$lt_save_ifs
2581 # Let DOS variable expansion print the short 8.3 style file name.
2582 lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
2583 sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
2584 done
2585 IFS=$lt_save_ifs
2586 # Convert to MSYS style.
2587 sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'`
2588 ;;
2589 cygwin*)
2590 # Convert to unix form, then to dos form, then back to unix form
2591 # but this time dos style (no spaces!) so that the unix form looks
2592 # like /cygdrive/c/PROGRA~1:/cygdr...
2593 sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
2594 sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
2595 sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
2596 ;;
2597 *)
2598 sys_lib_search_path_spec=$LIB
2599 if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
2600 # It is most probably a Windows format PATH.
2601 sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
2602 else
2603 sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
2604 fi
2605 # FIXME: find the short name or the path components, as spaces are
2606 # common. (e.g. "Program Files" -> "PROGRA~1")
2607 ;;
2608 esac
2609
2610 # DLL is installed to $(libdir)/../bin by postinstall_cmds
2611 postinstall_cmds='base_file=`basename \$file`~
2612 dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
2613 dldir=$destdir/`dirname \$dlpath`~
2614 test -d \$dldir || mkdir -p \$dldir~
2615 $install_prog $dir/$dlname \$dldir/$dlname'
2616 postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
2617 dlpath=$dir/\$dldll~
2618 $RM \$dlpath'
2619 shlibpath_overrides_runpath=yes
2620 dynamic_linker='Win32 link.exe'
2621 ;;
2622
2623 *)
2624 # Assume MSVC wrapper
2625 library_names_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext $libname.lib'
2626 dynamic_linker='Win32 ld.exe'
2627 ;;
2628 esac
2629 # FIXME: first we should search . and the directory the executable is in
2630 shlibpath_var=PATH
2631 ;;
2632
2633 darwin* | rhapsody*)
2634 dynamic_linker="$host_os dyld"
2635 version_type=darwin
2636 need_lib_prefix=no
2637 need_version=no
2638 library_names_spec='$libname$release$major$shared_ext $libname$shared_ext'
2639 soname_spec='$libname$release$major$shared_ext'
2640 shlibpath_overrides_runpath=yes
2641 shlibpath_var=DYLD_LIBRARY_PATH
2642 shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
2643 m4_if([$1], [],[
2644 sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
2645 sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
2646 ;;
2647
2648 dgux*)
2649 version_type=linux # correct to gnu/linux during the next big refactor
2650 need_lib_prefix=no
2651 need_version=no
2652 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2653 soname_spec='$libname$release$shared_ext$major'
2654 shlibpath_var=LD_LIBRARY_PATH
2655 ;;
2656
2657 freebsd* | dragonfly*)
2658 # DragonFly does not have aout. When/if they implement a new
2659 # versioning mechanism, adjust this.
2660 if test -x /usr/bin/objformat; then
2661 objformat=`/usr/bin/objformat`
2662 else
2663 case $host_os in
2664 freebsd[[23]].*) objformat=aout ;;
2665 *) objformat=elf ;;
2666 esac
2667 fi
2668 version_type=freebsd-$objformat
2669 case $version_type in
2670 freebsd-elf*)
2671 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2672 soname_spec='$libname$release$shared_ext$major'
2673 need_version=no
2674 need_lib_prefix=no
2675 ;;
2676 freebsd-*)
2677 library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
2678 need_version=yes
2679 ;;
2680 esac
2681 shlibpath_var=LD_LIBRARY_PATH
2682 case $host_os in
2683 freebsd2.*)
2684 shlibpath_overrides_runpath=yes
2685 ;;
2686 freebsd3.[[01]]* | freebsdelf3.[[01]]*)
2687 shlibpath_overrides_runpath=yes
2688 hardcode_into_libs=yes
2689 ;;
2690 freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
2691 freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
2692 shlibpath_overrides_runpath=no
2693 hardcode_into_libs=yes
2694 ;;
2695 *) # from 4.6 on, and DragonFly
2696 shlibpath_overrides_runpath=yes
2697 hardcode_into_libs=yes
2698 ;;
2699 esac
2700 ;;
2701
2702 haiku*)
2703 version_type=linux # correct to gnu/linux during the next big refactor
2704 need_lib_prefix=no
2705 need_version=no
2706 dynamic_linker="$host_os runtime_loader"
2707 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2708 soname_spec='$libname$release$shared_ext$major'
2709 shlibpath_var=LIBRARY_PATH
2710 shlibpath_overrides_runpath=no
2711 sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
2712 hardcode_into_libs=yes
2713 ;;
2714
2715 hpux9* | hpux10* | hpux11*)
2716 # Give a soname corresponding to the major version so that dld.sl refuses to
2717 # link against other versions.
2718 version_type=sunos
2719 need_lib_prefix=no
2720 need_version=no
2721 case $host_cpu in
2722 ia64*)
2723 shrext_cmds='.so'
2724 hardcode_into_libs=yes
2725 dynamic_linker="$host_os dld.so"
2726 shlibpath_var=LD_LIBRARY_PATH
2727 shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
2728 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2729 soname_spec='$libname$release$shared_ext$major'
2730 if test 32 = "$HPUX_IA64_MODE"; then
2731 sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
2732 sys_lib_dlsearch_path_spec=/usr/lib/hpux32
2733 else
2734 sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
2735 sys_lib_dlsearch_path_spec=/usr/lib/hpux64
2736 fi
2737 ;;
2738 hppa*64*)
2739 shrext_cmds='.sl'
2740 hardcode_into_libs=yes
2741 dynamic_linker="$host_os dld.sl"
2742 shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
2743 shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
2744 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2745 soname_spec='$libname$release$shared_ext$major'
2746 sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
2747 sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
2748 ;;
2749 *)
2750 shrext_cmds='.sl'
2751 dynamic_linker="$host_os dld.sl"
2752 shlibpath_var=SHLIB_PATH
2753 shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
2754 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2755 soname_spec='$libname$release$shared_ext$major'
2756 ;;
2757 esac
2758 # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
2759 postinstall_cmds='chmod 555 $lib'
2760 # or fails outright, so override atomically:
2761 install_override_mode=555
2762 ;;
2763
2764 interix[[3-9]]*)
2765 version_type=linux # correct to gnu/linux during the next big refactor
2766 need_lib_prefix=no
2767 need_version=no
2768 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2769 soname_spec='$libname$release$shared_ext$major'
2770 dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
2771 shlibpath_var=LD_LIBRARY_PATH
2772 shlibpath_overrides_runpath=no
2773 hardcode_into_libs=yes
2774 ;;
2775
2776 irix5* | irix6* | nonstopux*)
2777 case $host_os in
2778 nonstopux*) version_type=nonstopux ;;
2779 *)
2780 if test yes = "$lt_cv_prog_gnu_ld"; then
2781 version_type=linux # correct to gnu/linux during the next big refactor
2782 else
2783 version_type=irix
2784 fi ;;
2785 esac
2786 need_lib_prefix=no
2787 need_version=no
2788 soname_spec='$libname$release$shared_ext$major'
2789 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext'
2790 case $host_os in
2791 irix5* | nonstopux*)
2792 libsuff= shlibsuff=
2793 ;;
2794 *)
2795 case $LD in # libtool.m4 will add one of these switches to LD
2796 *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
2797 libsuff= shlibsuff= libmagic=32-bit;;
2798 *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
2799 libsuff=32 shlibsuff=N32 libmagic=N32;;
2800 *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
2801 libsuff=64 shlibsuff=64 libmagic=64-bit;;
2802 *) libsuff= shlibsuff= libmagic=never-match;;
2803 esac
2804 ;;
2805 esac
2806 shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
2807 shlibpath_overrides_runpath=no
2808 sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff"
2809 sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff"
2810 hardcode_into_libs=yes
2811 ;;
2812
2813 # No shared lib support for Linux oldld, aout, or coff.
2814 linux*oldld* | linux*aout* | linux*coff*)
2815 dynamic_linker=no
2816 ;;
2817
2818 linux*android*)
2819 version_type=none # Android doesn't support versioned libraries.
2820 need_lib_prefix=no
2821 need_version=no
2822 library_names_spec='$libname$release$shared_ext'
2823 soname_spec='$libname$release$shared_ext'
2824 finish_cmds=
2825 shlibpath_var=LD_LIBRARY_PATH
2826 shlibpath_overrides_runpath=yes
2827
2828 # This implies no fast_install, which is unacceptable.
2829 # Some rework will be needed to allow for fast_install
2830 # before this can be enabled.
2831 hardcode_into_libs=yes
2832
2833 dynamic_linker='Android linker'
2834 # Don't embed -rpath directories since the linker doesn't support them.
2835 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
2836 ;;
2837
2838 # This must be glibc/ELF.
2839 linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
2840 version_type=linux # correct to gnu/linux during the next big refactor
2841 need_lib_prefix=no
2842 need_version=no
2843 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2844 soname_spec='$libname$release$shared_ext$major'
2845 finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
2846 shlibpath_var=LD_LIBRARY_PATH
2847 shlibpath_overrides_runpath=no
2848
2849 # Some binutils ld are patched to set DT_RUNPATH
2850 AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath],
2851 [lt_cv_shlibpath_overrides_runpath=no
2852 save_LDFLAGS=$LDFLAGS
2853 save_libdir=$libdir
2854 eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
2855 LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
2856 AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
2857 [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
2858 [lt_cv_shlibpath_overrides_runpath=yes])])
2859 LDFLAGS=$save_LDFLAGS
2860 libdir=$save_libdir
2861 ])
2862 shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
2863
2864 # This implies no fast_install, which is unacceptable.
2865 # Some rework will be needed to allow for fast_install
2866 # before this can be enabled.
2867 hardcode_into_libs=yes
2868
2869 # Add ABI-specific directories to the system library path.
2870 sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib"
2871
2872 # Ideally, we could use ldconfig to report *all* directores which are
2873 # searched for libraries, however this is still not possible. Aside from not
2874 # being certain /sbin/ldconfig is available, command
2875 # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64,
2876 # even though it is searched at run-time. Try to do the best guess by
2877 # appending ld.so.conf contents (and includes) to the search path.
2878 if test -f /etc/ld.so.conf; then
2879 lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
2880 sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra"
2881 fi
2882
2883 # We used to test for /lib/ld.so.1 and disable shared libraries on
2884 # powerpc, because MkLinux only supported shared libraries with the
2885 # GNU dynamic linker. Since this was broken with cross compilers,
2886 # most powerpc-linux boxes support dynamic linking these days and
2887 # people can always --disable-shared, the test was removed, and we
2888 # assume the GNU/Linux dynamic linker is in use.
2889 dynamic_linker='GNU/Linux ld.so'
2890 ;;
2891
2892 netbsd*)
2893 version_type=sunos
2894 need_lib_prefix=no
2895 need_version=no
2896 if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
2897 library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
2898 finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
2899 dynamic_linker='NetBSD (a.out) ld.so'
2900 else
2901 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2902 soname_spec='$libname$release$shared_ext$major'
2903 dynamic_linker='NetBSD ld.elf_so'
2904 fi
2905 shlibpath_var=LD_LIBRARY_PATH
2906 shlibpath_overrides_runpath=yes
2907 hardcode_into_libs=yes
2908 ;;
2909
2910 newsos6)
2911 version_type=linux # correct to gnu/linux during the next big refactor
2912 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2913 shlibpath_var=LD_LIBRARY_PATH
2914 shlibpath_overrides_runpath=yes
2915 ;;
2916
2917 *nto* | *qnx*)
2918 version_type=qnx
2919 need_lib_prefix=no
2920 need_version=no
2921 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2922 soname_spec='$libname$release$shared_ext$major'
2923 shlibpath_var=LD_LIBRARY_PATH
2924 shlibpath_overrides_runpath=no
2925 hardcode_into_libs=yes
2926 dynamic_linker='ldqnx.so'
2927 ;;
2928
2929 openbsd* | bitrig*)
2930 version_type=sunos
2931 sys_lib_dlsearch_path_spec=/usr/lib
2932 need_lib_prefix=no
2933 if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
2934 need_version=no
2935 else
2936 need_version=yes
2937 fi
2938 library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
2939 finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
2940 shlibpath_var=LD_LIBRARY_PATH
2941 shlibpath_overrides_runpath=yes
2942 ;;
2943
2944 os2*)
2945 libname_spec='$name'
2946 version_type=windows
2947 shrext_cmds=.dll
2948 need_version=no
2949 need_lib_prefix=no
2950 # OS/2 can only load a DLL with a base name of 8 characters or less.
2951 soname_spec='`test -n "$os2dllname" && libname="$os2dllname";
2952 v=$($ECHO $release$versuffix | tr -d .-);
2953 n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _);
2954 $ECHO $n$v`$shared_ext'
2955 library_names_spec='${libname}_dll.$libext'
2956 dynamic_linker='OS/2 ld.exe'
2957 shlibpath_var=BEGINLIBPATH
2958 sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
2959 sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
2960 postinstall_cmds='base_file=`basename \$file`~
2961 dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~
2962 dldir=$destdir/`dirname \$dlpath`~
2963 test -d \$dldir || mkdir -p \$dldir~
2964 $install_prog $dir/$dlname \$dldir/$dlname~
2965 chmod a+x \$dldir/$dlname~
2966 if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
2967 eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
2968 fi'
2969 postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~
2970 dlpath=$dir/\$dldll~
2971 $RM \$dlpath'
2972 ;;
2973
2974 osf3* | osf4* | osf5*)
2975 version_type=osf
2976 need_lib_prefix=no
2977 need_version=no
2978 soname_spec='$libname$release$shared_ext$major'
2979 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2980 shlibpath_var=LD_LIBRARY_PATH
2981 sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
2982 sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
2983 ;;
2984
2985 rdos*)
2986 dynamic_linker=no
2987 ;;
2988
2989 solaris*)
2990 version_type=linux # correct to gnu/linux during the next big refactor
2991 need_lib_prefix=no
2992 need_version=no
2993 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2994 soname_spec='$libname$release$shared_ext$major'
2995 shlibpath_var=LD_LIBRARY_PATH
2996 shlibpath_overrides_runpath=yes
2997 hardcode_into_libs=yes
2998 # ldd complains unless libraries are executable
2999 postinstall_cmds='chmod +x $lib'
3000 ;;
3001
3002 sunos4*)
3003 version_type=sunos
3004 library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
3005 finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
3006 shlibpath_var=LD_LIBRARY_PATH
3007 shlibpath_overrides_runpath=yes
3008 if test yes = "$with_gnu_ld"; then
3009 need_lib_prefix=no
3010 fi
3011 need_version=yes
3012 ;;
3013
3014 sysv4 | sysv4.3*)
3015 version_type=linux # correct to gnu/linux during the next big refactor
3016 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
3017 soname_spec='$libname$release$shared_ext$major'
3018 shlibpath_var=LD_LIBRARY_PATH
3019 case $host_vendor in
3020 sni)
3021 shlibpath_overrides_runpath=no
3022 need_lib_prefix=no
3023 runpath_var=LD_RUN_PATH
3024 ;;
3025 siemens)
3026 need_lib_prefix=no
3027 ;;
3028 motorola)
3029 need_lib_prefix=no
3030 need_version=no
3031 shlibpath_overrides_runpath=no
3032 sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
3033 ;;
3034 esac
3035 ;;
3036
3037 sysv4*MP*)
3038 if test -d /usr/nec; then
3039 version_type=linux # correct to gnu/linux during the next big refactor
3040 library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext'
3041 soname_spec='$libname$shared_ext.$major'
3042 shlibpath_var=LD_LIBRARY_PATH
3043 fi
3044 ;;
3045
3046 sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
3047 version_type=sco
3048 need_lib_prefix=no
3049 need_version=no
3050 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext'
3051 soname_spec='$libname$release$shared_ext$major'
3052 shlibpath_var=LD_LIBRARY_PATH
3053 shlibpath_overrides_runpath=yes
3054 hardcode_into_libs=yes
3055 if test yes = "$with_gnu_ld"; then
3056 sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
3057 else
3058 sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
3059 case $host_os in
3060 sco3.2v5*)
3061 sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
3062 ;;
3063 esac
3064 fi
3065 sys_lib_dlsearch_path_spec='/usr/lib'
3066 ;;
3067
3068 tpf*)
3069 # TPF is a cross-target only. Preferred cross-host = GNU/Linux.
3070 version_type=linux # correct to gnu/linux during the next big refactor
3071 need_lib_prefix=no
3072 need_version=no
3073 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
3074 shlibpath_var=LD_LIBRARY_PATH
3075 shlibpath_overrides_runpath=no
3076 hardcode_into_libs=yes
3077 ;;
3078
3079 uts4*)
3080 version_type=linux # correct to gnu/linux during the next big refactor
3081 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
3082 soname_spec='$libname$release$shared_ext$major'
3083 shlibpath_var=LD_LIBRARY_PATH
3084 ;;
3085
3086 *)
3087 dynamic_linker=no
3088 ;;
3089 esac
3090 AC_MSG_RESULT([$dynamic_linker])
3091 test no = "$dynamic_linker" && can_build_shared=no
3092
3093 variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
3094 if test yes = "$GCC"; then
3095 variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
3096 fi
3097
3098 if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then
3099 sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec
3100 fi
3101
3102 if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then
3103 sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec
3104 fi
3105
3106 # remember unaugmented sys_lib_dlsearch_path content for libtool script decls...
3107 configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec
3108
3109 # ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code
3110 func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH"
3111
3112 # to be used as default LT_SYS_LIBRARY_PATH value in generated libtool
3113 configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH
3114
3115 _LT_DECL([], [variables_saved_for_relink], [1],
3116 [Variables whose values should be saved in libtool wrapper scripts and
3117 restored at link time])
3118 _LT_DECL([], [need_lib_prefix], [0],
3119 [Do we need the "lib" prefix for modules?])
3120 _LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
3121 _LT_DECL([], [version_type], [0], [Library versioning type])
3122 _LT_DECL([], [runpath_var], [0], [Shared library runtime path variable])
3123 _LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
3124 _LT_DECL([], [shlibpath_overrides_runpath], [0],
3125 [Is shlibpath searched before the hard-coded library search path?])
3126 _LT_DECL([], [libname_spec], [1], [Format of library name prefix])
3127 _LT_DECL([], [library_names_spec], [1],
3128 [[List of archive names. First name is the real one, the rest are links.
3129 The last name is the one that the linker finds with -lNAME]])
3130 _LT_DECL([], [soname_spec], [1],
3131 [[The coded name of the library, if different from the real name]])
3132 _LT_DECL([], [install_override_mode], [1],
3133 [Permission mode override for installation of shared libraries])
3134 _LT_DECL([], [postinstall_cmds], [2],
3135 [Command to use after installation of a shared archive])
3136 _LT_DECL([], [postuninstall_cmds], [2],
3137 [Command to use after uninstallation of a shared archive])
3138 _LT_DECL([], [finish_cmds], [2],
3139 [Commands used to finish a libtool library installation in a directory])
3140 _LT_DECL([], [finish_eval], [1],
3141 [[As "finish_cmds", except a single script fragment to be evaled but
3142 not shown]])
3143 _LT_DECL([], [hardcode_into_libs], [0],
3144 [Whether we should hardcode library paths into libraries])
3145 _LT_DECL([], [sys_lib_search_path_spec], [2],
3146 [Compile-time system search path for libraries])
3147 _LT_DECL([sys_lib_dlsearch_path_spec], [configure_time_dlsearch_path], [2],
3148 [Detected run-time system search path for libraries])
3149 _LT_DECL([], [configure_time_lt_sys_library_path], [2],
3150 [Explicit LT_SYS_LIBRARY_PATH set during ./configure time])
3151 ])# _LT_SYS_DYNAMIC_LINKER
3152
3153
3154 # _LT_PATH_TOOL_PREFIX(TOOL)
3155 # --------------------------
3156 # find a file program that can recognize shared library
3157 AC_DEFUN([_LT_PATH_TOOL_PREFIX],
3158 [m4_require([_LT_DECL_EGREP])dnl
3159 AC_MSG_CHECKING([for $1])
3160 AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
3161 [case $MAGIC_CMD in
3162 [[\\/*] | ?:[\\/]*])
3163 lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path.
3164 ;;
3165 *)
3166 lt_save_MAGIC_CMD=$MAGIC_CMD
3167 lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
3168 dnl $ac_dummy forces splitting on constant user-supplied paths.
3169 dnl POSIX.2 word splitting is done only on the output of word expansions,
3170 dnl not every word. This closes a longstanding sh security hole.
3171 ac_dummy="m4_if([$2], , $PATH, [$2])"
3172 for ac_dir in $ac_dummy; do
3173 IFS=$lt_save_ifs
3174 test -z "$ac_dir" && ac_dir=.
3175 if test -f "$ac_dir/$1"; then
3176 lt_cv_path_MAGIC_CMD=$ac_dir/"$1"
3177 if test -n "$file_magic_test_file"; then
3178 case $deplibs_check_method in
3179 "file_magic "*)
3180 file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
3181 MAGIC_CMD=$lt_cv_path_MAGIC_CMD
3182 if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
3183 $EGREP "$file_magic_regex" > /dev/null; then
3184 :
3185 else
3186 cat <<_LT_EOF 1>&2
3187
3188 *** Warning: the command libtool uses to detect shared libraries,
3189 *** $file_magic_cmd, produces output that libtool cannot recognize.
3190 *** The result is that libtool may fail to recognize shared libraries
3191 *** as such. This will affect the creation of libtool libraries that
3192 *** depend on shared libraries, but programs linked with such libtool
3193 *** libraries will work regardless of this problem. Nevertheless, you
3194 *** may want to report the problem to your system manager and/or to
3195 *** bug-libtool@gnu.org
3196
3197 _LT_EOF
3198 fi ;;
3199 esac
3200 fi
3201 break
3202 fi
3203 done
3204 IFS=$lt_save_ifs
3205 MAGIC_CMD=$lt_save_MAGIC_CMD
3206 ;;
3207 esac])
3208 MAGIC_CMD=$lt_cv_path_MAGIC_CMD
3209 if test -n "$MAGIC_CMD"; then
3210 AC_MSG_RESULT($MAGIC_CMD)
3211 else
3212 AC_MSG_RESULT(no)
3213 fi
3214 _LT_DECL([], [MAGIC_CMD], [0],
3215 [Used to examine libraries when file_magic_cmd begins with "file"])dnl
3216 ])# _LT_PATH_TOOL_PREFIX
3217
3218 # Old name:
3219 AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
3220 dnl aclocal-1.4 backwards compatibility:
3221 dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
3222
3223
3224 # _LT_PATH_MAGIC
3225 # --------------
3226 # find a file program that can recognize a shared library
3227 m4_defun([_LT_PATH_MAGIC],
3228 [_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
3229 if test -z "$lt_cv_path_MAGIC_CMD"; then
3230 if test -n "$ac_tool_prefix"; then
3231 _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
3232 else
3233 MAGIC_CMD=:
3234 fi
3235 fi
3236 ])# _LT_PATH_MAGIC
3237
3238
3239 # LT_PATH_LD
3240 # ----------
3241 # find the pathname to the GNU or non-GNU linker
3242 AC_DEFUN([LT_PATH_LD],
3243 [AC_REQUIRE([AC_PROG_CC])dnl
3244 AC_REQUIRE([AC_CANONICAL_HOST])dnl
3245 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
3246 m4_require([_LT_DECL_SED])dnl
3247 m4_require([_LT_DECL_EGREP])dnl
3248 m4_require([_LT_PROG_ECHO_BACKSLASH])dnl
3249
3250 AC_ARG_WITH([gnu-ld],
3251 [AS_HELP_STRING([--with-gnu-ld],
3252 [assume the C compiler uses GNU ld @<:@default=no@:>@])],
3253 [test no = "$withval" || with_gnu_ld=yes],
3254 [with_gnu_ld=no])dnl
3255
3256 ac_prog=ld
3257 if test yes = "$GCC"; then
3258 # Check if gcc -print-prog-name=ld gives a path.
3259 AC_MSG_CHECKING([for ld used by $CC])
3260 case $host in
3261 *-*-mingw*)
3262 # gcc leaves a trailing carriage return, which upsets mingw
3263 ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
3264 *)
3265 ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
3266 esac
3267 case $ac_prog in
3268 # Accept absolute paths.
3269 [[\\/]]* | ?:[[\\/]]*)
3270 re_direlt='/[[^/]][[^/]]*/\.\./'
3271 # Canonicalize the pathname of ld
3272 ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
3273 while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
3274 ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
3275 done
3276 test -z "$LD" && LD=$ac_prog
3277 ;;
3278 "")
3279 # If it fails, then pretend we aren't using GCC.
3280 ac_prog=ld
3281 ;;
3282 *)
3283 # If it is relative, then search for the first ld in PATH.
3284 with_gnu_ld=unknown
3285 ;;
3286 esac
3287 elif test yes = "$with_gnu_ld"; then
3288 AC_MSG_CHECKING([for GNU ld])
3289 else
3290 AC_MSG_CHECKING([for non-GNU ld])
3291 fi
3292 AC_CACHE_VAL(lt_cv_path_LD,
3293 [if test -z "$LD"; then
3294 lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
3295 for ac_dir in $PATH; do
3296 IFS=$lt_save_ifs
3297 test -z "$ac_dir" && ac_dir=.
3298 if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
3299 lt_cv_path_LD=$ac_dir/$ac_prog
3300 # Check to see if the program is GNU ld. I'd rather use --version,
3301 # but apparently some variants of GNU ld only accept -v.
3302 # Break only if it was the GNU/non-GNU ld that we prefer.
3303 case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
3304 *GNU* | *'with BFD'*)
3305 test no != "$with_gnu_ld" && break
3306 ;;
3307 *)
3308 test yes != "$with_gnu_ld" && break
3309 ;;
3310 esac
3311 fi
3312 done
3313 IFS=$lt_save_ifs
3314 else
3315 lt_cv_path_LD=$LD # Let the user override the test with a path.
3316 fi])
3317 LD=$lt_cv_path_LD
3318 if test -n "$LD"; then
3319 AC_MSG_RESULT($LD)
3320 else
3321 AC_MSG_RESULT(no)
3322 fi
3323 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
3324 _LT_PATH_LD_GNU
3325 AC_SUBST([LD])
3326
3327 _LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
3328 ])# LT_PATH_LD
3329
3330 # Old names:
3331 AU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
3332 AU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
3333 dnl aclocal-1.4 backwards compatibility:
3334 dnl AC_DEFUN([AM_PROG_LD], [])
3335 dnl AC_DEFUN([AC_PROG_LD], [])
3336
3337
3338 # _LT_PATH_LD_GNU
3339 #- --------------
3340 m4_defun([_LT_PATH_LD_GNU],
3341 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
3342 [# I'd rather use --version here, but apparently some GNU lds only accept -v.
3343 case `$LD -v 2>&1 </dev/null` in
3344 *GNU* | *'with BFD'*)
3345 lt_cv_prog_gnu_ld=yes
3346 ;;
3347 *)
3348 lt_cv_prog_gnu_ld=no
3349 ;;
3350 esac])
3351 with_gnu_ld=$lt_cv_prog_gnu_ld
3352 ])# _LT_PATH_LD_GNU
3353
3354
3355 # _LT_CMD_RELOAD
3356 # --------------
3357 # find reload flag for linker
3358 # -- PORTME Some linkers may need a different reload flag.
3359 m4_defun([_LT_CMD_RELOAD],
3360 [AC_CACHE_CHECK([for $LD option to reload object files],
3361 lt_cv_ld_reload_flag,
3362 [lt_cv_ld_reload_flag='-r'])
3363 reload_flag=$lt_cv_ld_reload_flag
3364 case $reload_flag in
3365 "" | " "*) ;;
3366 *) reload_flag=" $reload_flag" ;;
3367 esac
3368 reload_cmds='$LD$reload_flag -o $output$reload_objs'
3369 case $host_os in
3370 cygwin* | mingw* | pw32* | cegcc*)
3371 if test yes != "$GCC"; then
3372 reload_cmds=false
3373 fi
3374 ;;
3375 darwin*)
3376 if test yes = "$GCC"; then
3377 reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs'
3378 else
3379 reload_cmds='$LD$reload_flag -o $output$reload_objs'
3380 fi
3381 ;;
3382 esac
3383 _LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl
3384 _LT_TAGDECL([], [reload_cmds], [2])dnl
3385 ])# _LT_CMD_RELOAD
3386
3387
3388 # _LT_PATH_DD
3389 # -----------
3390 # find a working dd
3391 m4_defun([_LT_PATH_DD],
3392 [AC_CACHE_CHECK([for a working dd], [ac_cv_path_lt_DD],
3393 [printf 0123456789abcdef0123456789abcdef >conftest.i
3394 cat conftest.i conftest.i >conftest2.i
3395 : ${lt_DD:=$DD}
3396 AC_PATH_PROGS_FEATURE_CHECK([lt_DD], [dd],
3397 [if "$ac_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then
3398 cmp -s conftest.i conftest.out \
3399 && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=:
3400 fi])
3401 rm -f conftest.i conftest2.i conftest.out])
3402 ])# _LT_PATH_DD
3403
3404
3405 # _LT_CMD_TRUNCATE
3406 # ----------------
3407 # find command to truncate a binary pipe
3408 m4_defun([_LT_CMD_TRUNCATE],
3409 [m4_require([_LT_PATH_DD])
3410 AC_CACHE_CHECK([how to truncate binary pipes], [lt_cv_truncate_bin],
3411 [printf 0123456789abcdef0123456789abcdef >conftest.i
3412 cat conftest.i conftest.i >conftest2.i
3413 lt_cv_truncate_bin=
3414 if "$ac_cv_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then
3415 cmp -s conftest.i conftest.out \
3416 && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1"
3417 fi
3418 rm -f conftest.i conftest2.i conftest.out
3419 test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q"])
3420 _LT_DECL([lt_truncate_bin], [lt_cv_truncate_bin], [1],
3421 [Command to truncate a binary pipe])
3422 ])# _LT_CMD_TRUNCATE
3423
3424
3425 # _LT_CHECK_MAGIC_METHOD
3426 # ----------------------
3427 # how to check for library dependencies
3428 # -- PORTME fill in with the dynamic library characteristics
3429 m4_defun([_LT_CHECK_MAGIC_METHOD],
3430 [m4_require([_LT_DECL_EGREP])
3431 m4_require([_LT_DECL_OBJDUMP])
3432 AC_CACHE_CHECK([how to recognize dependent libraries],
3433 lt_cv_deplibs_check_method,
3434 [lt_cv_file_magic_cmd='$MAGIC_CMD'
3435 lt_cv_file_magic_test_file=
3436 lt_cv_deplibs_check_method='unknown'
3437 # Need to set the preceding variable on all platforms that support
3438 # interlibrary dependencies.
3439 # 'none' -- dependencies not supported.
3440 # 'unknown' -- same as none, but documents that we really don't know.
3441 # 'pass_all' -- all dependencies passed with no checks.
3442 # 'test_compile' -- check by making test program.
3443 # 'file_magic [[regex]]' -- check by looking for files in library path
3444 # that responds to the $file_magic_cmd with a given extended regex.
3445 # If you have 'file' or equivalent on your system and you're not sure
3446 # whether 'pass_all' will *always* work, you probably want this one.
3447
3448 case $host_os in
3449 aix[[4-9]]*)
3450 lt_cv_deplibs_check_method=pass_all
3451 ;;
3452
3453 beos*)
3454 lt_cv_deplibs_check_method=pass_all
3455 ;;
3456
3457 bsdi[[45]]*)
3458 lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
3459 lt_cv_file_magic_cmd='/usr/bin/file -L'
3460 lt_cv_file_magic_test_file=/shlib/libc.so
3461 ;;
3462
3463 cygwin*)
3464 # func_win32_libid is a shell function defined in ltmain.sh
3465 lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
3466 lt_cv_file_magic_cmd='func_win32_libid'
3467 ;;
3468
3469 mingw* | pw32*)
3470 # Base MSYS/MinGW do not provide the 'file' command needed by
3471 # func_win32_libid shell function, so use a weaker test based on 'objdump',
3472 # unless we find 'file', for example because we are cross-compiling.
3473 if ( file / ) >/dev/null 2>&1; then
3474 lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
3475 lt_cv_file_magic_cmd='func_win32_libid'
3476 else
3477 # Keep this pattern in sync with the one in func_win32_libid.
3478 lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
3479 lt_cv_file_magic_cmd='$OBJDUMP -f'
3480 fi
3481 ;;
3482
3483 cegcc*)
3484 # use the weaker test based on 'objdump'. See mingw*.
3485 lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
3486 lt_cv_file_magic_cmd='$OBJDUMP -f'
3487 ;;
3488
3489 darwin* | rhapsody*)
3490 lt_cv_deplibs_check_method=pass_all
3491 ;;
3492
3493 freebsd* | dragonfly*)
3494 if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
3495 case $host_cpu in
3496 i*86 )
3497 # Not sure whether the presence of OpenBSD here was a mistake.
3498 # Let's accept both of them until this is cleared up.
3499 lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
3500 lt_cv_file_magic_cmd=/usr/bin/file
3501 lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
3502 ;;
3503 esac
3504 else
3505 lt_cv_deplibs_check_method=pass_all
3506 fi
3507 ;;
3508
3509 haiku*)
3510 lt_cv_deplibs_check_method=pass_all
3511 ;;
3512
3513 hpux10.20* | hpux11*)
3514 lt_cv_file_magic_cmd=/usr/bin/file
3515 case $host_cpu in
3516 ia64*)
3517 lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
3518 lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
3519 ;;
3520 hppa*64*)
3521 [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]']
3522 lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
3523 ;;
3524 *)
3525 lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library'
3526 lt_cv_file_magic_test_file=/usr/lib/libc.sl
3527 ;;
3528 esac
3529 ;;
3530
3531 interix[[3-9]]*)
3532 # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
3533 lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
3534 ;;
3535
3536 irix5* | irix6* | nonstopux*)
3537 case $LD in
3538 *-32|*"-32 ") libmagic=32-bit;;
3539 *-n32|*"-n32 ") libmagic=N32;;
3540 *-64|*"-64 ") libmagic=64-bit;;
3541 *) libmagic=never-match;;
3542 esac
3543 lt_cv_deplibs_check_method=pass_all
3544 ;;
3545
3546 # This must be glibc/ELF.
3547 linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
3548 lt_cv_deplibs_check_method=pass_all
3549 ;;
3550
3551 netbsd*)
3552 if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
3553 lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
3554 else
3555 lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
3556 fi
3557 ;;
3558
3559 newos6*)
3560 lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
3561 lt_cv_file_magic_cmd=/usr/bin/file
3562 lt_cv_file_magic_test_file=/usr/lib/libnls.so
3563 ;;
3564
3565 *nto* | *qnx*)
3566 lt_cv_deplibs_check_method=pass_all
3567 ;;
3568
3569 openbsd* | bitrig*)
3570 if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
3571 lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
3572 else
3573 lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
3574 fi
3575 ;;
3576
3577 osf3* | osf4* | osf5*)
3578 lt_cv_deplibs_check_method=pass_all
3579 ;;
3580
3581 rdos*)
3582 lt_cv_deplibs_check_method=pass_all
3583 ;;
3584
3585 solaris*)
3586 lt_cv_deplibs_check_method=pass_all
3587 ;;
3588
3589 sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
3590 lt_cv_deplibs_check_method=pass_all
3591 ;;
3592
3593 sysv4 | sysv4.3*)
3594 case $host_vendor in
3595 motorola)
3596 lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]'
3597 lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
3598 ;;
3599 ncr)
3600 lt_cv_deplibs_check_method=pass_all
3601 ;;
3602 sequent)
3603 lt_cv_file_magic_cmd='/bin/file'
3604 lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
3605 ;;
3606 sni)
3607 lt_cv_file_magic_cmd='/bin/file'
3608 lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
3609 lt_cv_file_magic_test_file=/lib/libc.so
3610 ;;
3611 siemens)
3612 lt_cv_deplibs_check_method=pass_all
3613 ;;
3614 pc)
3615 lt_cv_deplibs_check_method=pass_all
3616 ;;
3617 esac
3618 ;;
3619
3620 tpf*)
3621 lt_cv_deplibs_check_method=pass_all
3622 ;;
3623 os2*)
3624 lt_cv_deplibs_check_method=pass_all
3625 ;;
3626 esac
3627 ])
3628
3629 file_magic_glob=
3630 want_nocaseglob=no
3631 if test "$build" = "$host"; then
3632 case $host_os in
3633 mingw* | pw32*)
3634 if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
3635 want_nocaseglob=yes
3636 else
3637 file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"`
3638 fi
3639 ;;
3640 esac
3641 fi
3642
3643 file_magic_cmd=$lt_cv_file_magic_cmd
3644 deplibs_check_method=$lt_cv_deplibs_check_method
3645 test -z "$deplibs_check_method" && deplibs_check_method=unknown
3646
3647 _LT_DECL([], [deplibs_check_method], [1],
3648 [Method to check whether dependent libraries are shared objects])
3649 _LT_DECL([], [file_magic_cmd], [1],
3650 [Command to use when deplibs_check_method = "file_magic"])
3651 _LT_DECL([], [file_magic_glob], [1],
3652 [How to find potential files when deplibs_check_method = "file_magic"])
3653 _LT_DECL([], [want_nocaseglob], [1],
3654 [Find potential files using nocaseglob when deplibs_check_method = "file_magic"])
3655 ])# _LT_CHECK_MAGIC_METHOD
3656
3657
3658 # LT_PATH_NM
3659 # ----------
3660 # find the pathname to a BSD- or MS-compatible name lister
3661 AC_DEFUN([LT_PATH_NM],
3662 [AC_REQUIRE([AC_PROG_CC])dnl
3663 AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
3664 [if test -n "$NM"; then
3665 # Let the user override the test.
3666 lt_cv_path_NM=$NM
3667 else
3668 lt_nm_to_check=${ac_tool_prefix}nm
3669 if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
3670 lt_nm_to_check="$lt_nm_to_check nm"
3671 fi
3672 for lt_tmp_nm in $lt_nm_to_check; do
3673 lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
3674 for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
3675 IFS=$lt_save_ifs
3676 test -z "$ac_dir" && ac_dir=.
3677 tmp_nm=$ac_dir/$lt_tmp_nm
3678 if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then
3679 # Check to see if the nm accepts a BSD-compat flag.
3680 # Adding the 'sed 1q' prevents false positives on HP-UX, which says:
3681 # nm: unknown option "B" ignored
3682 # Tru64's nm complains that /dev/null is an invalid object file
3683 # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty
3684 case $build_os in
3685 mingw*) lt_bad_file=conftest.nm/nofile ;;
3686 *) lt_bad_file=/dev/null ;;
3687 esac
3688 case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in
3689 *$lt_bad_file* | *'Invalid file or object type'*)
3690 lt_cv_path_NM="$tmp_nm -B"
3691 break 2
3692 ;;
3693 *)
3694 case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
3695 */dev/null*)
3696 lt_cv_path_NM="$tmp_nm -p"
3697 break 2
3698 ;;
3699 *)
3700 lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
3701 continue # so that we can try to find one that supports BSD flags
3702 ;;
3703 esac
3704 ;;
3705 esac
3706 fi
3707 done
3708 IFS=$lt_save_ifs
3709 done
3710 : ${lt_cv_path_NM=no}
3711 fi])
3712 if test no != "$lt_cv_path_NM"; then
3713 NM=$lt_cv_path_NM
3714 else
3715 # Didn't find any BSD compatible name lister, look for dumpbin.
3716 if test -n "$DUMPBIN"; then :
3717 # Let the user override the test.
3718 else
3719 AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :)
3720 case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in
3721 *COFF*)
3722 DUMPBIN="$DUMPBIN -symbols -headers"
3723 ;;
3724 *)
3725 DUMPBIN=:
3726 ;;
3727 esac
3728 fi
3729 AC_SUBST([DUMPBIN])
3730 if test : != "$DUMPBIN"; then
3731 NM=$DUMPBIN
3732 fi
3733 fi
3734 test -z "$NM" && NM=nm
3735 AC_SUBST([NM])
3736 _LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
3737
3738 AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
3739 [lt_cv_nm_interface="BSD nm"
3740 echo "int some_variable = 0;" > conftest.$ac_ext
3741 (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
3742 (eval "$ac_compile" 2>conftest.err)
3743 cat conftest.err >&AS_MESSAGE_LOG_FD
3744 (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
3745 (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
3746 cat conftest.err >&AS_MESSAGE_LOG_FD
3747 (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD)
3748 cat conftest.out >&AS_MESSAGE_LOG_FD
3749 if $GREP 'External.*some_variable' conftest.out > /dev/null; then
3750 lt_cv_nm_interface="MS dumpbin"
3751 fi
3752 rm -f conftest*])
3753 ])# LT_PATH_NM
3754
3755 # Old names:
3756 AU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
3757 AU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
3758 dnl aclocal-1.4 backwards compatibility:
3759 dnl AC_DEFUN([AM_PROG_NM], [])
3760 dnl AC_DEFUN([AC_PROG_NM], [])
3761
3762 # _LT_CHECK_SHAREDLIB_FROM_LINKLIB
3763 # --------------------------------
3764 # how to determine the name of the shared library
3765 # associated with a specific link library.
3766 # -- PORTME fill in with the dynamic library characteristics
3767 m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB],
3768 [m4_require([_LT_DECL_EGREP])
3769 m4_require([_LT_DECL_OBJDUMP])
3770 m4_require([_LT_DECL_DLLTOOL])
3771 AC_CACHE_CHECK([how to associate runtime and link libraries],
3772 lt_cv_sharedlib_from_linklib_cmd,
3773 [lt_cv_sharedlib_from_linklib_cmd='unknown'
3774
3775 case $host_os in
3776 cygwin* | mingw* | pw32* | cegcc*)
3777 # two different shell functions defined in ltmain.sh;
3778 # decide which one to use based on capabilities of $DLLTOOL
3779 case `$DLLTOOL --help 2>&1` in
3780 *--identify-strict*)
3781 lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
3782 ;;
3783 *)
3784 lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
3785 ;;
3786 esac
3787 ;;
3788 *)
3789 # fallback: assume linklib IS sharedlib
3790 lt_cv_sharedlib_from_linklib_cmd=$ECHO
3791 ;;
3792 esac
3793 ])
3794 sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
3795 test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
3796
3797 _LT_DECL([], [sharedlib_from_linklib_cmd], [1],
3798 [Command to associate shared and link libraries])
3799 ])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
3800
3801
3802 # _LT_PATH_MANIFEST_TOOL
3803 # ----------------------
3804 # locate the manifest tool
3805 m4_defun([_LT_PATH_MANIFEST_TOOL],
3806 [AC_CHECK_TOOL(MANIFEST_TOOL, mt, :)
3807 test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
3808 AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool],
3809 [lt_cv_path_mainfest_tool=no
3810 echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD
3811 $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
3812 cat conftest.err >&AS_MESSAGE_LOG_FD
3813 if $GREP 'Manifest Tool' conftest.out > /dev/null; then
3814 lt_cv_path_mainfest_tool=yes
3815 fi
3816 rm -f conftest*])
3817 if test yes != "$lt_cv_path_mainfest_tool"; then
3818 MANIFEST_TOOL=:
3819 fi
3820 _LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl
3821 ])# _LT_PATH_MANIFEST_TOOL
3822
3823
3824 # _LT_DLL_DEF_P([FILE])
3825 # ---------------------
3826 # True iff FILE is a Windows DLL '.def' file.
3827 # Keep in sync with func_dll_def_p in the libtool script
3828 AC_DEFUN([_LT_DLL_DEF_P],
3829 [dnl
3830 test DEF = "`$SED -n dnl
3831 -e '\''s/^[[ ]]*//'\'' dnl Strip leading whitespace
3832 -e '\''/^\(;.*\)*$/d'\'' dnl Delete empty lines and comments
3833 -e '\''s/^\(EXPORTS\|LIBRARY\)\([[ ]].*\)*$/DEF/p'\'' dnl
3834 -e q dnl Only consider the first "real" line
3835 $1`" dnl
3836 ])# _LT_DLL_DEF_P
3837
3838
3839 # LT_LIB_M
3840 # --------
3841 # check for math library
3842 AC_DEFUN([LT_LIB_M],
3843 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
3844 LIBM=
3845 case $host in
3846 *-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*)
3847 # These system don't have libm, or don't need it
3848 ;;
3849 *-ncr-sysv4.3*)
3850 AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM=-lmw)
3851 AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
3852 ;;
3853 *)
3854 AC_CHECK_LIB(m, cos, LIBM=-lm)
3855 ;;
3856 esac
3857 AC_SUBST([LIBM])
3858 ])# LT_LIB_M
3859
3860 # Old name:
3861 AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
3862 dnl aclocal-1.4 backwards compatibility:
3863 dnl AC_DEFUN([AC_CHECK_LIBM], [])
3864
3865
3866 # _LT_COMPILER_NO_RTTI([TAGNAME])
3867 # -------------------------------
3868 m4_defun([_LT_COMPILER_NO_RTTI],
3869 [m4_require([_LT_TAG_COMPILER])dnl
3870
3871 _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
3872
3873 if test yes = "$GCC"; then
3874 case $cc_basename in
3875 nvcc*)
3876 _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;;
3877 *)
3878 _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;;
3879 esac
3880
3881 _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
3882 lt_cv_prog_compiler_rtti_exceptions,
3883 [-fno-rtti -fno-exceptions], [],
3884 [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
3885 fi
3886 _LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
3887 [Compiler flag to turn off builtin functions])
3888 ])# _LT_COMPILER_NO_RTTI
3889
3890
3891 # _LT_CMD_GLOBAL_SYMBOLS
3892 # ----------------------
3893 m4_defun([_LT_CMD_GLOBAL_SYMBOLS],
3894 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
3895 AC_REQUIRE([AC_PROG_CC])dnl
3896 AC_REQUIRE([AC_PROG_AWK])dnl
3897 AC_REQUIRE([LT_PATH_NM])dnl
3898 AC_REQUIRE([LT_PATH_LD])dnl
3899 m4_require([_LT_DECL_SED])dnl
3900 m4_require([_LT_DECL_EGREP])dnl
3901 m4_require([_LT_TAG_COMPILER])dnl
3902
3903 # Check for command to grab the raw symbol name followed by C symbol from nm.
3904 AC_MSG_CHECKING([command to parse $NM output from $compiler object])
3905 AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
3906 [
3907 # These are sane defaults that work on at least a few old systems.
3908 # [They come from Ultrix. What could be older than Ultrix?!! ;)]
3909
3910 # Character class describing NM global symbol codes.
3911 symcode='[[BCDEGRST]]'
3912
3913 # Regexp to match symbols that can be accessed directly from C.
3914 sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
3915
3916 # Define system-specific variables.
3917 case $host_os in
3918 aix*)
3919 symcode='[[BCDT]]'
3920 ;;
3921 cygwin* | mingw* | pw32* | cegcc*)
3922 symcode='[[ABCDGISTW]]'
3923 ;;
3924 hpux*)
3925 if test ia64 = "$host_cpu"; then
3926 symcode='[[ABCDEGRST]]'
3927 fi
3928 ;;
3929 irix* | nonstopux*)
3930 symcode='[[BCDEGRST]]'
3931 ;;
3932 osf*)
3933 symcode='[[BCDEGQRST]]'
3934 ;;
3935 solaris*)
3936 symcode='[[BDRT]]'
3937 ;;
3938 sco3.2v5*)
3939 symcode='[[DT]]'
3940 ;;
3941 sysv4.2uw2*)
3942 symcode='[[DT]]'
3943 ;;
3944 sysv5* | sco5v6* | unixware* | OpenUNIX*)
3945 symcode='[[ABDT]]'
3946 ;;
3947 sysv4)
3948 symcode='[[DFNSTU]]'
3949 ;;
3950 esac
3951
3952 # If we're using GNU nm, then use its standard symbol codes.
3953 case `$NM -V 2>&1` in
3954 *GNU* | *'with BFD'*)
3955 symcode='[[ABCDGIRSTW]]' ;;
3956 esac
3957
3958 if test "$lt_cv_nm_interface" = "MS dumpbin"; then
3959 # Gets list of data symbols to import.
3960 lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'"
3961 # Adjust the below global symbol transforms to fixup imported variables.
3962 lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'"
3963 lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'"
3964 lt_c_name_lib_hook="\
3965 -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\
3966 -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'"
3967 else
3968 # Disable hooks by default.
3969 lt_cv_sys_global_symbol_to_import=
3970 lt_cdecl_hook=
3971 lt_c_name_hook=
3972 lt_c_name_lib_hook=
3973 fi
3974
3975 # Transform an extracted symbol line into a proper C declaration.
3976 # Some systems (esp. on ia64) link data and code symbols differently,
3977 # so use this general approach.
3978 lt_cv_sys_global_symbol_to_cdecl="sed -n"\
3979 $lt_cdecl_hook\
3980 " -e 's/^T .* \(.*\)$/extern int \1();/p'"\
3981 " -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'"
3982
3983 # Transform an extracted symbol line into symbol name and symbol address
3984 lt_cv_sys_global_symbol_to_c_name_address="sed -n"\
3985 $lt_c_name_hook\
3986 " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\
3987 " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'"
3988
3989 # Transform an extracted symbol line into symbol name with lib prefix and
3990 # symbol address.
3991 lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\
3992 $lt_c_name_lib_hook\
3993 " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\
3994 " -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\
3995 " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/p'"
3996
3997 # Handle CRLF in mingw tool chain
3998 opt_cr=
3999 case $build_os in
4000 mingw*)
4001 opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
4002 ;;
4003 esac
4004
4005 # Try without a prefix underscore, then with it.
4006 for ac_symprfx in "" "_"; do
4007
4008 # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
4009 symxfrm="\\1 $ac_symprfx\\2 \\2"
4010
4011 # Write the raw and C identifiers.
4012 if test "$lt_cv_nm_interface" = "MS dumpbin"; then
4013 # Fake it for dumpbin and say T for any non-static function,
4014 # D for any global variable and I for any imported variable.
4015 # Also find C++ and __fastcall symbols from MSVC++,
4016 # which start with @ or ?.
4017 lt_cv_sys_global_symbol_pipe="$AWK ['"\
4018 " {last_section=section; section=\$ 3};"\
4019 " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
4020 " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
4021 " /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\
4022 " /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\
4023 " /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\
4024 " \$ 0!~/External *\|/{next};"\
4025 " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
4026 " {if(hide[section]) next};"\
4027 " {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\
4028 " {split(\$ 0,a,/\||\r/); split(a[2],s)};"\
4029 " s[1]~/^[@?]/{print f,s[1],s[1]; next};"\
4030 " s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\
4031 " ' prfx=^$ac_symprfx]"
4032 else
4033 lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
4034 fi
4035 lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
4036
4037 # Check to see that the pipe works correctly.
4038 pipe_works=no
4039
4040 rm -f conftest*
4041 cat > conftest.$ac_ext <<_LT_EOF
4042 #ifdef __cplusplus
4043 extern "C" {
4044 #endif
4045 char nm_test_var;
4046 void nm_test_func(void);
4047 void nm_test_func(void){}
4048 #ifdef __cplusplus
4049 }
4050 #endif
4051 int main(){nm_test_var='a';nm_test_func();return(0);}
4052 _LT_EOF
4053
4054 if AC_TRY_EVAL(ac_compile); then
4055 # Now try to grab the symbols.
4056 nlist=conftest.nm
4057 if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then
4058 # Try sorting and uniquifying the output.
4059 if sort "$nlist" | uniq > "$nlist"T; then
4060 mv -f "$nlist"T "$nlist"
4061 else
4062 rm -f "$nlist"T
4063 fi
4064
4065 # Make sure that we snagged all the symbols we need.
4066 if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
4067 if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
4068 cat <<_LT_EOF > conftest.$ac_ext
4069 /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */
4070 #if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE
4071 /* DATA imports from DLLs on WIN32 can't be const, because runtime
4072 relocations are performed -- see ld's documentation on pseudo-relocs. */
4073 # define LT@&t@_DLSYM_CONST
4074 #elif defined __osf__
4075 /* This system does not cope well with relocations in const data. */
4076 # define LT@&t@_DLSYM_CONST
4077 #else
4078 # define LT@&t@_DLSYM_CONST const
4079 #endif
4080
4081 #ifdef __cplusplus
4082 extern "C" {
4083 #endif
4084
4085 _LT_EOF
4086 # Now generate the symbol file.
4087 eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
4088
4089 cat <<_LT_EOF >> conftest.$ac_ext
4090
4091 /* The mapping between symbol names and symbols. */
4092 LT@&t@_DLSYM_CONST struct {
4093 const char *name;
4094 void *address;
4095 }
4096 lt__PROGRAM__LTX_preloaded_symbols[[]] =
4097 {
4098 { "@PROGRAM@", (void *) 0 },
4099 _LT_EOF
4100 $SED "s/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
4101 cat <<\_LT_EOF >> conftest.$ac_ext
4102 {0, (void *) 0}
4103 };
4104
4105 /* This works around a problem in FreeBSD linker */
4106 #ifdef FREEBSD_WORKAROUND
4107 static const void *lt_preloaded_setup() {
4108 return lt__PROGRAM__LTX_preloaded_symbols;
4109 }
4110 #endif
4111
4112 #ifdef __cplusplus
4113 }
4114 #endif
4115 _LT_EOF
4116 # Now try linking the two files.
4117 mv conftest.$ac_objext conftstm.$ac_objext
4118 lt_globsym_save_LIBS=$LIBS
4119 lt_globsym_save_CFLAGS=$CFLAGS
4120 LIBS=conftstm.$ac_objext
4121 CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
4122 if AC_TRY_EVAL(ac_link) && test -s conftest$ac_exeext; then
4123 pipe_works=yes
4124 fi
4125 LIBS=$lt_globsym_save_LIBS
4126 CFLAGS=$lt_globsym_save_CFLAGS
4127 else
4128 echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
4129 fi
4130 else
4131 echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
4132 fi
4133 else
4134 echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
4135 fi
4136 else
4137 echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
4138 cat conftest.$ac_ext >&5
4139 fi
4140 rm -rf conftest* conftst*
4141
4142 # Do not use the global_symbol_pipe unless it works.
4143 if test yes = "$pipe_works"; then
4144 break
4145 else
4146 lt_cv_sys_global_symbol_pipe=
4147 fi
4148 done
4149 ])
4150 if test -z "$lt_cv_sys_global_symbol_pipe"; then
4151 lt_cv_sys_global_symbol_to_cdecl=
4152 fi
4153 if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
4154 AC_MSG_RESULT(failed)
4155 else
4156 AC_MSG_RESULT(ok)
4157 fi
4158
4159 # Response file support.
4160 if test "$lt_cv_nm_interface" = "MS dumpbin"; then
4161 nm_file_list_spec='@'
4162 elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then
4163 nm_file_list_spec='@'
4164 fi
4165
4166 _LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
4167 [Take the output of nm and produce a listing of raw symbols and C names])
4168 _LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
4169 [Transform the output of nm in a proper C declaration])
4170 _LT_DECL([global_symbol_to_import], [lt_cv_sys_global_symbol_to_import], [1],
4171 [Transform the output of nm into a list of symbols to manually relocate])
4172 _LT_DECL([global_symbol_to_c_name_address],
4173 [lt_cv_sys_global_symbol_to_c_name_address], [1],
4174 [Transform the output of nm in a C name address pair])
4175 _LT_DECL([global_symbol_to_c_name_address_lib_prefix],
4176 [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
4177 [Transform the output of nm in a C name address pair when lib prefix is needed])
4178 _LT_DECL([nm_interface], [lt_cv_nm_interface], [1],
4179 [The name lister interface])
4180 _LT_DECL([], [nm_file_list_spec], [1],
4181 [Specify filename containing input files for $NM])
4182 ]) # _LT_CMD_GLOBAL_SYMBOLS
4183
4184
4185 # _LT_COMPILER_PIC([TAGNAME])
4186 # ---------------------------
4187 m4_defun([_LT_COMPILER_PIC],
4188 [m4_require([_LT_TAG_COMPILER])dnl
4189 _LT_TAGVAR(lt_prog_compiler_wl, $1)=
4190 _LT_TAGVAR(lt_prog_compiler_pic, $1)=
4191 _LT_TAGVAR(lt_prog_compiler_static, $1)=
4192
4193 m4_if([$1], [CXX], [
4194 # C++ specific cases for pic, static, wl, etc.
4195 if test yes = "$GXX"; then
4196 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4197 _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4198
4199 case $host_os in
4200 aix*)
4201 # All AIX code is PIC.
4202 if test ia64 = "$host_cpu"; then
4203 # AIX 5 now supports IA64 processor
4204 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4205 fi
4206 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4207 ;;
4208
4209 amigaos*)
4210 case $host_cpu in
4211 powerpc)
4212 # see comment about AmigaOS4 .so support
4213 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4214 ;;
4215 m68k)
4216 # FIXME: we need at least 68020 code to build shared libraries, but
4217 # adding the '-m68020' flag to GCC prevents building anything better,
4218 # like '-m68040'.
4219 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
4220 ;;
4221 esac
4222 ;;
4223
4224 beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
4225 # PIC is the default for these OSes.
4226 ;;
4227 mingw* | cygwin* | os2* | pw32* | cegcc*)
4228 # This hack is so that the source file can tell whether it is being
4229 # built for inclusion in a dll (and should export symbols for example).
4230 # Although the cygwin gcc ignores -fPIC, still need this for old-style
4231 # (--disable-auto-import) libraries
4232 m4_if([$1], [GCJ], [],
4233 [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
4234 case $host_os in
4235 os2*)
4236 _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'
4237 ;;
4238 esac
4239 ;;
4240 darwin* | rhapsody*)
4241 # PIC is the default on this platform
4242 # Common symbols not allowed in MH_DYLIB files
4243 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
4244 ;;
4245 *djgpp*)
4246 # DJGPP does not support shared libraries at all
4247 _LT_TAGVAR(lt_prog_compiler_pic, $1)=
4248 ;;
4249 haiku*)
4250 # PIC is the default for Haiku.
4251 # The "-static" flag exists, but is broken.
4252 _LT_TAGVAR(lt_prog_compiler_static, $1)=
4253 ;;
4254 interix[[3-9]]*)
4255 # Interix 3.x gcc -fpic/-fPIC options generate broken code.
4256 # Instead, we relocate shared libraries at runtime.
4257 ;;
4258 sysv4*MP*)
4259 if test -d /usr/nec; then
4260 _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
4261 fi
4262 ;;
4263 hpux*)
4264 # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
4265 # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag
4266 # sets the default TLS model and affects inlining.
4267 case $host_cpu in
4268 hppa*64*)
4269 ;;
4270 *)
4271 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4272 ;;
4273 esac
4274 ;;
4275 *qnx* | *nto*)
4276 # QNX uses GNU C++, but need to define -shared option too, otherwise
4277 # it will coredump.
4278 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
4279 ;;
4280 *)
4281 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4282 ;;
4283 esac
4284 else
4285 case $host_os in
4286 aix[[4-9]]*)
4287 # All AIX code is PIC.
4288 if test ia64 = "$host_cpu"; then
4289 # AIX 5 now supports IA64 processor
4290 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4291 else
4292 _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
4293 fi
4294 ;;
4295 chorus*)
4296 case $cc_basename in
4297 cxch68*)
4298 # Green Hills C++ Compiler
4299 # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
4300 ;;
4301 esac
4302 ;;
4303 mingw* | cygwin* | os2* | pw32* | cegcc*)
4304 # This hack is so that the source file can tell whether it is being
4305 # built for inclusion in a dll (and should export symbols for example).
4306 m4_if([$1], [GCJ], [],
4307 [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
4308 ;;
4309 dgux*)
4310 case $cc_basename in
4311 ec++*)
4312 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4313 ;;
4314 ghcx*)
4315 # Green Hills C++ Compiler
4316 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
4317 ;;
4318 *)
4319 ;;
4320 esac
4321 ;;
4322 freebsd* | dragonfly*)
4323 # FreeBSD uses GNU C++
4324 ;;
4325 hpux9* | hpux10* | hpux11*)
4326 case $cc_basename in
4327 CC*)
4328 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4329 _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'
4330 if test ia64 != "$host_cpu"; then
4331 _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
4332 fi
4333 ;;
4334 aCC*)
4335 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4336 _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'
4337 case $host_cpu in
4338 hppa*64*|ia64*)
4339 # +Z the default
4340 ;;
4341 *)
4342 _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
4343 ;;
4344 esac
4345 ;;
4346 *)
4347 ;;
4348 esac
4349 ;;
4350 interix*)
4351 # This is c89, which is MS Visual C++ (no shared libs)
4352 # Anyone wants to do a port?
4353 ;;
4354 irix5* | irix6* | nonstopux*)
4355 case $cc_basename in
4356 CC*)
4357 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4358 _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4359 # CC pic flag -KPIC is the default.
4360 ;;
4361 *)
4362 ;;
4363 esac
4364 ;;
4365 linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
4366 case $cc_basename in
4367 KCC*)
4368 # KAI C++ Compiler
4369 _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
4370 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4371 ;;
4372 ecpc* )
4373 # old Intel C++ for x86_64, which still supported -KPIC.
4374 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4375 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4376 _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4377 ;;
4378 icpc* )
4379 # Intel C++, used to be incompatible with GCC.
4380 # ICC 10 doesn't accept -KPIC any more.
4381 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4382 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4383 _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4384 ;;
4385 pgCC* | pgcpp*)
4386 # Portland Group C++ compiler
4387 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4388 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
4389 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4390 ;;
4391 cxx*)
4392 # Compaq C++
4393 # Make sure the PIC flag is empty. It appears that all Alpha
4394 # Linux and Compaq Tru64 Unix objects are PIC.
4395 _LT_TAGVAR(lt_prog_compiler_pic, $1)=
4396 _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4397 ;;
4398 xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*)
4399 # IBM XL 8.0, 9.0 on PPC and BlueGene
4400 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4401 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
4402 _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
4403 ;;
4404 *)
4405 case `$CC -V 2>&1 | sed 5q` in
4406 *Sun\ C*)
4407 # Sun C++ 5.9
4408 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4409 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4410 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
4411 ;;
4412 esac
4413 ;;
4414 esac
4415 ;;
4416 lynxos*)
4417 ;;
4418 m88k*)
4419 ;;
4420 mvs*)
4421 case $cc_basename in
4422 cxx*)
4423 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
4424 ;;
4425 *)
4426 ;;
4427 esac
4428 ;;
4429 netbsd*)
4430 ;;
4431 *qnx* | *nto*)
4432 # QNX uses GNU C++, but need to define -shared option too, otherwise
4433 # it will coredump.
4434 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
4435 ;;
4436 osf3* | osf4* | osf5*)
4437 case $cc_basename in
4438 KCC*)
4439 _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
4440 ;;
4441 RCC*)
4442 # Rational C++ 2.4.1
4443 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
4444 ;;
4445 cxx*)
4446 # Digital/Compaq C++
4447 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4448 # Make sure the PIC flag is empty. It appears that all Alpha
4449 # Linux and Compaq Tru64 Unix objects are PIC.
4450 _LT_TAGVAR(lt_prog_compiler_pic, $1)=
4451 _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4452 ;;
4453 *)
4454 ;;
4455 esac
4456 ;;
4457 psos*)
4458 ;;
4459 solaris*)
4460 case $cc_basename in
4461 CC* | sunCC*)
4462 # Sun C++ 4.2, 5.x and Centerline C++
4463 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4464 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4465 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
4466 ;;
4467 gcx*)
4468 # Green Hills C++ Compiler
4469 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
4470 ;;
4471 *)
4472 ;;
4473 esac
4474 ;;
4475 sunos4*)
4476 case $cc_basename in
4477 CC*)
4478 # Sun C++ 4.x
4479 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
4480 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4481 ;;
4482 lcc*)
4483 # Lucid
4484 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
4485 ;;
4486 *)
4487 ;;
4488 esac
4489 ;;
4490 sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
4491 case $cc_basename in
4492 CC*)
4493 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4494 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4495 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4496 ;;
4497 esac
4498 ;;
4499 tandem*)
4500 case $cc_basename in
4501 NCC*)
4502 # NonStop-UX NCC 3.20
4503 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4504 ;;
4505 *)
4506 ;;
4507 esac
4508 ;;
4509 vxworks*)
4510 ;;
4511 *)
4512 _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
4513 ;;
4514 esac
4515 fi
4516 ],
4517 [
4518 if test yes = "$GCC"; then
4519 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4520 _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4521
4522 case $host_os in
4523 aix*)
4524 # All AIX code is PIC.
4525 if test ia64 = "$host_cpu"; then
4526 # AIX 5 now supports IA64 processor
4527 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4528 fi
4529 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4530 ;;
4531
4532 amigaos*)
4533 case $host_cpu in
4534 powerpc)
4535 # see comment about AmigaOS4 .so support
4536 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4537 ;;
4538 m68k)
4539 # FIXME: we need at least 68020 code to build shared libraries, but
4540 # adding the '-m68020' flag to GCC prevents building anything better,
4541 # like '-m68040'.
4542 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
4543 ;;
4544 esac
4545 ;;
4546
4547 beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
4548 # PIC is the default for these OSes.
4549 ;;
4550
4551 mingw* | cygwin* | pw32* | os2* | cegcc*)
4552 # This hack is so that the source file can tell whether it is being
4553 # built for inclusion in a dll (and should export symbols for example).
4554 # Although the cygwin gcc ignores -fPIC, still need this for old-style
4555 # (--disable-auto-import) libraries
4556 m4_if([$1], [GCJ], [],
4557 [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
4558 case $host_os in
4559 os2*)
4560 _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'
4561 ;;
4562 esac
4563 ;;
4564
4565 darwin* | rhapsody*)
4566 # PIC is the default on this platform
4567 # Common symbols not allowed in MH_DYLIB files
4568 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
4569 ;;
4570
4571 haiku*)
4572 # PIC is the default for Haiku.
4573 # The "-static" flag exists, but is broken.
4574 _LT_TAGVAR(lt_prog_compiler_static, $1)=
4575 ;;
4576
4577 hpux*)
4578 # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
4579 # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag
4580 # sets the default TLS model and affects inlining.
4581 case $host_cpu in
4582 hppa*64*)
4583 # +Z the default
4584 ;;
4585 *)
4586 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4587 ;;
4588 esac
4589 ;;
4590
4591 interix[[3-9]]*)
4592 # Interix 3.x gcc -fpic/-fPIC options generate broken code.
4593 # Instead, we relocate shared libraries at runtime.
4594 ;;
4595
4596 msdosdjgpp*)
4597 # Just because we use GCC doesn't mean we suddenly get shared libraries
4598 # on systems that don't support them.
4599 _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
4600 enable_shared=no
4601 ;;
4602
4603 *nto* | *qnx*)
4604 # QNX uses GNU C++, but need to define -shared option too, otherwise
4605 # it will coredump.
4606 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
4607 ;;
4608
4609 sysv4*MP*)
4610 if test -d /usr/nec; then
4611 _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
4612 fi
4613 ;;
4614
4615 *)
4616 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4617 ;;
4618 esac
4619
4620 case $cc_basename in
4621 nvcc*) # Cuda Compiler Driver 2.2
4622 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker '
4623 if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
4624 _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)"
4625 fi
4626 ;;
4627 esac
4628 else
4629 # PORTME Check for flag to pass linker flags through the system compiler.
4630 case $host_os in
4631 aix*)
4632 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4633 if test ia64 = "$host_cpu"; then
4634 # AIX 5 now supports IA64 processor
4635 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4636 else
4637 _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
4638 fi
4639 ;;
4640
4641 darwin* | rhapsody*)
4642 # PIC is the default on this platform
4643 # Common symbols not allowed in MH_DYLIB files
4644 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
4645 case $cc_basename in
4646 nagfor*)
4647 # NAG Fortran compiler
4648 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
4649 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
4650 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4651 ;;
4652 esac
4653 ;;
4654
4655 mingw* | cygwin* | pw32* | os2* | cegcc*)
4656 # This hack is so that the source file can tell whether it is being
4657 # built for inclusion in a dll (and should export symbols for example).
4658 m4_if([$1], [GCJ], [],
4659 [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
4660 case $host_os in
4661 os2*)
4662 _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'
4663 ;;
4664 esac
4665 ;;
4666
4667 hpux9* | hpux10* | hpux11*)
4668 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4669 # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
4670 # not for PA HP-UX.
4671 case $host_cpu in
4672 hppa*64*|ia64*)
4673 # +Z the default
4674 ;;
4675 *)
4676 _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
4677 ;;
4678 esac
4679 # Is there a better lt_prog_compiler_static that works with the bundled CC?
4680 _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'
4681 ;;
4682
4683 irix5* | irix6* | nonstopux*)
4684 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4685 # PIC (with -KPIC) is the default.
4686 _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4687 ;;
4688
4689 linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
4690 case $cc_basename in
4691 # old Intel for x86_64, which still supported -KPIC.
4692 ecc*)
4693 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4694 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4695 _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4696 ;;
4697 # icc used to be incompatible with GCC.
4698 # ICC 10 doesn't accept -KPIC any more.
4699 icc* | ifort*)
4700 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4701 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4702 _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4703 ;;
4704 # Lahey Fortran 8.1.
4705 lf95*)
4706 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4707 _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
4708 _LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
4709 ;;
4710 nagfor*)
4711 # NAG Fortran compiler
4712 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
4713 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
4714 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4715 ;;
4716 tcc*)
4717 # Fabrice Bellard et al's Tiny C Compiler
4718 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4719 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4720 _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4721 ;;
4722 pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
4723 # Portland Group compilers (*not* the Pentium gcc compiler,
4724 # which looks to be a dead project)
4725 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4726 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
4727 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4728 ;;
4729 ccc*)
4730 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4731 # All Alpha code is PIC.
4732 _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4733 ;;
4734 xl* | bgxl* | bgf* | mpixl*)
4735 # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
4736 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4737 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
4738 _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
4739 ;;
4740 *)
4741 case `$CC -V 2>&1 | sed 5q` in
4742 *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*)
4743 # Sun Fortran 8.3 passes all unrecognized flags to the linker
4744 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4745 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4746 _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
4747 ;;
4748 *Sun\ F* | *Sun*Fortran*)
4749 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4750 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4751 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
4752 ;;
4753 *Sun\ C*)
4754 # Sun C 5.9
4755 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4756 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4757 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4758 ;;
4759 *Intel*\ [[CF]]*Compiler*)
4760 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4761 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4762 _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4763 ;;
4764 *Portland\ Group*)
4765 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4766 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
4767 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4768 ;;
4769 esac
4770 ;;
4771 esac
4772 ;;
4773
4774 newsos6)
4775 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4776 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4777 ;;
4778
4779 *nto* | *qnx*)
4780 # QNX uses GNU C++, but need to define -shared option too, otherwise
4781 # it will coredump.
4782 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
4783 ;;
4784
4785 osf3* | osf4* | osf5*)
4786 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4787 # All OSF/1 code is PIC.
4788 _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4789 ;;
4790
4791 rdos*)
4792 _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4793 ;;
4794
4795 solaris*)
4796 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4797 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4798 case $cc_basename in
4799 f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
4800 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
4801 *)
4802 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
4803 esac
4804 ;;
4805
4806 sunos4*)
4807 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
4808 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
4809 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4810 ;;
4811
4812 sysv4 | sysv4.2uw2* | sysv4.3*)
4813 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4814 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4815 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4816 ;;
4817
4818 sysv4*MP*)
4819 if test -d /usr/nec; then
4820 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
4821 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4822 fi
4823 ;;
4824
4825 sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
4826 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4827 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4828 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4829 ;;
4830
4831 unicos*)
4832 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4833 _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
4834 ;;
4835
4836 uts4*)
4837 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
4838 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4839 ;;
4840
4841 *)
4842 _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
4843 ;;
4844 esac
4845 fi
4846 ])
4847 case $host_os in
4848 # For platforms that do not support PIC, -DPIC is meaningless:
4849 *djgpp*)
4850 _LT_TAGVAR(lt_prog_compiler_pic, $1)=
4851 ;;
4852 *)
4853 _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
4854 ;;
4855 esac
4856
4857 AC_CACHE_CHECK([for $compiler option to produce PIC],
4858 [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)],
4859 [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
4860 _LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)
4861
4862 #
4863 # Check to make sure the PIC flag actually works.
4864 #
4865 if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
4866 _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],
4867 [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],
4868 [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],
4869 [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in
4870 "" | " "*) ;;
4871 *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;
4872 esac],
4873 [_LT_TAGVAR(lt_prog_compiler_pic, $1)=
4874 _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
4875 fi
4876 _LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
4877 [Additional compiler flags for building library objects])
4878
4879 _LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
4880 [How to pass a linker flag through the compiler])
4881 #
4882 # Check to make sure the static flag actually works.
4883 #
4884 wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"
4885 _LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
4886 _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),
4887 $lt_tmp_static_flag,
4888 [],
4889 [_LT_TAGVAR(lt_prog_compiler_static, $1)=])
4890 _LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
4891 [Compiler flag to prevent dynamic linking])
4892 ])# _LT_COMPILER_PIC
4893
4894
4895 # _LT_LINKER_SHLIBS([TAGNAME])
4896 # ----------------------------
4897 # See if the linker supports building shared libraries.
4898 m4_defun([_LT_LINKER_SHLIBS],
4899 [AC_REQUIRE([LT_PATH_LD])dnl
4900 AC_REQUIRE([LT_PATH_NM])dnl
4901 m4_require([_LT_PATH_MANIFEST_TOOL])dnl
4902 m4_require([_LT_FILEUTILS_DEFAULTS])dnl
4903 m4_require([_LT_DECL_EGREP])dnl
4904 m4_require([_LT_DECL_SED])dnl
4905 m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
4906 m4_require([_LT_TAG_COMPILER])dnl
4907 AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
4908 m4_if([$1], [CXX], [
4909 _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
4910 _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
4911 case $host_os in
4912 aix[[4-9]]*)
4913 # If we're using GNU nm, then we don't want the "-C" option.
4914 # -C means demangle to GNU nm, but means don't demangle to AIX nm.
4915 # Without the "-l" option, or with the "-B" option, AIX nm treats
4916 # weak defined symbols like other global defined symbols, whereas
4917 # GNU nm marks them as "W".
4918 # While the 'weak' keyword is ignored in the Export File, we need
4919 # it in the Import File for the 'aix-soname' feature, so we have
4920 # to replace the "-B" option with "-P" for AIX nm.
4921 if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
4922 _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols'
4923 else
4924 _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
4925 fi
4926 ;;
4927 pw32*)
4928 _LT_TAGVAR(export_symbols_cmds, $1)=$ltdll_cmds
4929 ;;
4930 cygwin* | mingw* | cegcc*)
4931 case $cc_basename in
4932 cl*)
4933 _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
4934 ;;
4935 *)
4936 _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
4937 _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
4938 ;;
4939 esac
4940 ;;
4941 *)
4942 _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
4943 ;;
4944 esac
4945 ], [
4946 runpath_var=
4947 _LT_TAGVAR(allow_undefined_flag, $1)=
4948 _LT_TAGVAR(always_export_symbols, $1)=no
4949 _LT_TAGVAR(archive_cmds, $1)=
4950 _LT_TAGVAR(archive_expsym_cmds, $1)=
4951 _LT_TAGVAR(compiler_needs_object, $1)=no
4952 _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
4953 _LT_TAGVAR(export_dynamic_flag_spec, $1)=
4954 _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
4955 _LT_TAGVAR(hardcode_automatic, $1)=no
4956 _LT_TAGVAR(hardcode_direct, $1)=no
4957 _LT_TAGVAR(hardcode_direct_absolute, $1)=no
4958 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
4959 _LT_TAGVAR(hardcode_libdir_separator, $1)=
4960 _LT_TAGVAR(hardcode_minus_L, $1)=no
4961 _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
4962 _LT_TAGVAR(inherit_rpath, $1)=no
4963 _LT_TAGVAR(link_all_deplibs, $1)=unknown
4964 _LT_TAGVAR(module_cmds, $1)=
4965 _LT_TAGVAR(module_expsym_cmds, $1)=
4966 _LT_TAGVAR(old_archive_from_new_cmds, $1)=
4967 _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
4968 _LT_TAGVAR(thread_safe_flag_spec, $1)=
4969 _LT_TAGVAR(whole_archive_flag_spec, $1)=
4970 # include_expsyms should be a list of space-separated symbols to be *always*
4971 # included in the symbol list
4972 _LT_TAGVAR(include_expsyms, $1)=
4973 # exclude_expsyms can be an extended regexp of symbols to exclude
4974 # it will be wrapped by ' (' and ')$', so one must not match beginning or
4975 # end of line. Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc',
4976 # as well as any symbol that contains 'd'.
4977 _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
4978 # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
4979 # platforms (ab)use it in PIC code, but their linkers get confused if
4980 # the symbol is explicitly referenced. Since portable code cannot
4981 # rely on this symbol name, it's probably fine to never include it in
4982 # preloaded symbol tables.
4983 # Exclude shared library initialization/finalization symbols.
4984 dnl Note also adjust exclude_expsyms for C++ above.
4985 extract_expsyms_cmds=
4986
4987 case $host_os in
4988 cygwin* | mingw* | pw32* | cegcc*)
4989 # FIXME: the MSVC++ port hasn't been tested in a loooong time
4990 # When not using gcc, we currently assume that we are using
4991 # Microsoft Visual C++.
4992 if test yes != "$GCC"; then
4993 with_gnu_ld=no
4994 fi
4995 ;;
4996 interix*)
4997 # we just hope/assume this is gcc and not c89 (= MSVC++)
4998 with_gnu_ld=yes
4999 ;;
5000 openbsd* | bitrig*)
5001 with_gnu_ld=no
5002 ;;
5003 esac
5004
5005 _LT_TAGVAR(ld_shlibs, $1)=yes
5006
5007 # On some targets, GNU ld is compatible enough with the native linker
5008 # that we're better off using the native interface for both.
5009 lt_use_gnu_ld_interface=no
5010 if test yes = "$with_gnu_ld"; then
5011 case $host_os in
5012 aix*)
5013 # The AIX port of GNU ld has always aspired to compatibility
5014 # with the native linker. However, as the warning in the GNU ld
5015 # block says, versions before 2.19.5* couldn't really create working
5016 # shared libraries, regardless of the interface used.
5017 case `$LD -v 2>&1` in
5018 *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
5019 *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;;
5020 *\ \(GNU\ Binutils\)\ [[3-9]]*) ;;
5021 *)
5022 lt_use_gnu_ld_interface=yes
5023 ;;
5024 esac
5025 ;;
5026 *)
5027 lt_use_gnu_ld_interface=yes
5028 ;;
5029 esac
5030 fi
5031
5032 if test yes = "$lt_use_gnu_ld_interface"; then
5033 # If archive_cmds runs LD, not CC, wlarc should be empty
5034 wlarc='$wl'
5035
5036 # Set some defaults for GNU ld with shared library support. These
5037 # are reset later if shared libraries are not supported. Putting them
5038 # here allows them to be overridden if necessary.
5039 runpath_var=LD_RUN_PATH
5040 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
5041 _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
5042 # ancient GNU ld didn't support --whole-archive et. al.
5043 if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
5044 _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
5045 else
5046 _LT_TAGVAR(whole_archive_flag_spec, $1)=
5047 fi
5048 supports_anon_versioning=no
5049 case `$LD -v | $SED -e 's/([^)]\+)\s\+//' 2>&1` in
5050 *GNU\ gold*) supports_anon_versioning=yes ;;
5051 *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
5052 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
5053 *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
5054 *\ 2.11.*) ;; # other 2.11 versions
5055 *) supports_anon_versioning=yes ;;
5056 esac
5057
5058 # See if GNU ld supports shared libraries.
5059 case $host_os in
5060 aix[[3-9]]*)
5061 # On AIX/PPC, the GNU linker is very broken
5062 if test ia64 != "$host_cpu"; then
5063 _LT_TAGVAR(ld_shlibs, $1)=no
5064 cat <<_LT_EOF 1>&2
5065
5066 *** Warning: the GNU linker, at least up to release 2.19, is reported
5067 *** to be unable to reliably create shared libraries on AIX.
5068 *** Therefore, libtool is disabling shared libraries support. If you
5069 *** really care for shared libraries, you may want to install binutils
5070 *** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
5071 *** You will then need to restart the configuration process.
5072
5073 _LT_EOF
5074 fi
5075 ;;
5076
5077 amigaos*)
5078 case $host_cpu in
5079 powerpc)
5080 # see comment about AmigaOS4 .so support
5081 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
5082 _LT_TAGVAR(archive_expsym_cmds, $1)=''
5083 ;;
5084 m68k)
5085 _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
5086 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5087 _LT_TAGVAR(hardcode_minus_L, $1)=yes
5088 ;;
5089 esac
5090 ;;
5091
5092 beos*)
5093 if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
5094 _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5095 # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
5096 # support --undefined. This deserves some investigation. FIXME
5097 _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
5098 else
5099 _LT_TAGVAR(ld_shlibs, $1)=no
5100 fi
5101 ;;
5102
5103 cygwin* | mingw* | pw32* | cegcc*)
5104 # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
5105 # as there is no search path for DLLs.
5106 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5107 _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols'
5108 _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5109 _LT_TAGVAR(always_export_symbols, $1)=no
5110 _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
5111 _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
5112 _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
5113
5114 if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
5115 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
5116 # If the export-symbols file already is a .def file, use it as
5117 # is; otherwise, prepend EXPORTS...
5118 _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
5119 cp $export_symbols $output_objdir/$soname.def;
5120 else
5121 echo EXPORTS > $output_objdir/$soname.def;
5122 cat $export_symbols >> $output_objdir/$soname.def;
5123 fi~
5124 $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
5125 else
5126 _LT_TAGVAR(ld_shlibs, $1)=no
5127 fi
5128 ;;
5129
5130 haiku*)
5131 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
5132 _LT_TAGVAR(link_all_deplibs, $1)=yes
5133 ;;
5134
5135 os2*)
5136 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5137 _LT_TAGVAR(hardcode_minus_L, $1)=yes
5138 _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5139 shrext_cmds=.dll
5140 _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
5141 $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
5142 $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
5143 $ECHO EXPORTS >> $output_objdir/$libname.def~
5144 emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
5145 $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
5146 emximp -o $lib $output_objdir/$libname.def'
5147 _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
5148 $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
5149 $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
5150 $ECHO EXPORTS >> $output_objdir/$libname.def~
5151 prefix_cmds="$SED"~
5152 if test EXPORTS = "`$SED 1q $export_symbols`"; then
5153 prefix_cmds="$prefix_cmds -e 1d";
5154 fi~
5155 prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
5156 cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
5157 $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
5158 emximp -o $lib $output_objdir/$libname.def'
5159 _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
5160 _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
5161 ;;
5162
5163 interix[[3-9]]*)
5164 _LT_TAGVAR(hardcode_direct, $1)=no
5165 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5166 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
5167 _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
5168 # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
5169 # Instead, shared libraries are loaded at an image base (0x10000000 by
5170 # default) and relocated if they conflict, which is a slow very memory
5171 # consuming and fragmenting process. To avoid this, we pick a random,
5172 # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
5173 # time. Moving up from 0x10000000 also allows more sbrk(2) space.
5174 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
5175 _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
5176 ;;
5177
5178 gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
5179 tmp_diet=no
5180 if test linux-dietlibc = "$host_os"; then
5181 case $cc_basename in
5182 diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn)
5183 esac
5184 fi
5185 if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
5186 && test no = "$tmp_diet"
5187 then
5188 tmp_addflag=' $pic_flag'
5189 tmp_sharedflag='-shared'
5190 case $cc_basename,$host_cpu in
5191 pgcc*) # Portland Group C compiler
5192 _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
5193 tmp_addflag=' $pic_flag'
5194 ;;
5195 pgf77* | pgf90* | pgf95* | pgfortran*)
5196 # Portland Group f77 and f90 compilers
5197 _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
5198 tmp_addflag=' $pic_flag -Mnomain' ;;
5199 ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64
5200 tmp_addflag=' -i_dynamic' ;;
5201 efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64
5202 tmp_addflag=' -i_dynamic -nofor_main' ;;
5203 ifc* | ifort*) # Intel Fortran compiler
5204 tmp_addflag=' -nofor_main' ;;
5205 lf95*) # Lahey Fortran 8.1
5206 _LT_TAGVAR(whole_archive_flag_spec, $1)=
5207 tmp_sharedflag='--shared' ;;
5208 nagfor*) # NAGFOR 5.3
5209 tmp_sharedflag='-Wl,-shared' ;;
5210 xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
5211 tmp_sharedflag='-qmkshrobj'
5212 tmp_addflag= ;;
5213 nvcc*) # Cuda Compiler Driver 2.2
5214 _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
5215 _LT_TAGVAR(compiler_needs_object, $1)=yes
5216 ;;
5217 esac
5218 case `$CC -V 2>&1 | sed 5q` in
5219 *Sun\ C*) # Sun C 5.9
5220 _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
5221 _LT_TAGVAR(compiler_needs_object, $1)=yes
5222 tmp_sharedflag='-G' ;;
5223 *Sun\ F*) # Sun Fortran 8.3
5224 tmp_sharedflag='-G' ;;
5225 esac
5226 _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
5227
5228 if test yes = "$supports_anon_versioning"; then
5229 _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
5230 cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
5231 echo "local: *; };" >> $output_objdir/$libname.ver~
5232 $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
5233 fi
5234
5235 case $cc_basename in
5236 tcc*)
5237 _LT_TAGVAR(export_dynamic_flag_spec, $1)='-rdynamic'
5238 ;;
5239 xlf* | bgf* | bgxlf* | mpixlf*)
5240 # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
5241 _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
5242 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
5243 _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
5244 if test yes = "$supports_anon_versioning"; then
5245 _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
5246 cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
5247 echo "local: *; };" >> $output_objdir/$libname.ver~
5248 $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
5249 fi
5250 ;;
5251 esac
5252 else
5253 _LT_TAGVAR(ld_shlibs, $1)=no
5254 fi
5255 ;;
5256
5257 netbsd*)
5258 if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
5259 _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
5260 wlarc=
5261 else
5262 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
5263 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
5264 fi
5265 ;;
5266
5267 solaris*)
5268 if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
5269 _LT_TAGVAR(ld_shlibs, $1)=no
5270 cat <<_LT_EOF 1>&2
5271
5272 *** Warning: The releases 2.8.* of the GNU linker cannot reliably
5273 *** create shared libraries on Solaris systems. Therefore, libtool
5274 *** is disabling shared libraries support. We urge you to upgrade GNU
5275 *** binutils to release 2.9.1 or newer. Another option is to modify
5276 *** your PATH or compiler configuration so that the native linker is
5277 *** used, and then restart.
5278
5279 _LT_EOF
5280 elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
5281 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
5282 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
5283 else
5284 _LT_TAGVAR(ld_shlibs, $1)=no
5285 fi
5286 ;;
5287
5288 sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
5289 case `$LD -v 2>&1` in
5290 *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
5291 _LT_TAGVAR(ld_shlibs, $1)=no
5292 cat <<_LT_EOF 1>&2
5293
5294 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot
5295 *** reliably create shared libraries on SCO systems. Therefore, libtool
5296 *** is disabling shared libraries support. We urge you to upgrade GNU
5297 *** binutils to release 2.16.91.0.3 or newer. Another option is to modify
5298 *** your PATH or compiler configuration so that the native linker is
5299 *** used, and then restart.
5300
5301 _LT_EOF
5302 ;;
5303 *)
5304 # For security reasons, it is highly recommended that you always
5305 # use absolute paths for naming shared libraries, and exclude the
5306 # DT_RUNPATH tag from executables and libraries. But doing so
5307 # requires that you compile everything twice, which is a pain.
5308 if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
5309 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
5310 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
5311 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
5312 else
5313 _LT_TAGVAR(ld_shlibs, $1)=no
5314 fi
5315 ;;
5316 esac
5317 ;;
5318
5319 sunos4*)
5320 _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
5321 wlarc=
5322 _LT_TAGVAR(hardcode_direct, $1)=yes
5323 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5324 ;;
5325
5326 *)
5327 if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
5328 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
5329 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
5330 else
5331 _LT_TAGVAR(ld_shlibs, $1)=no
5332 fi
5333 ;;
5334 esac
5335
5336 if test no = "$_LT_TAGVAR(ld_shlibs, $1)"; then
5337 runpath_var=
5338 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
5339 _LT_TAGVAR(export_dynamic_flag_spec, $1)=
5340 _LT_TAGVAR(whole_archive_flag_spec, $1)=
5341 fi
5342 else
5343 # PORTME fill in a description of your system's linker (not GNU ld)
5344 case $host_os in
5345 aix3*)
5346 _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5347 _LT_TAGVAR(always_export_symbols, $1)=yes
5348 _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
5349 # Note: this linker hardcodes the directories in LIBPATH if there
5350 # are no directories specified by -L.
5351 _LT_TAGVAR(hardcode_minus_L, $1)=yes
5352 if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then
5353 # Neither direct hardcoding nor static linking is supported with a
5354 # broken collect2.
5355 _LT_TAGVAR(hardcode_direct, $1)=unsupported
5356 fi
5357 ;;
5358
5359 aix[[4-9]]*)
5360 if test ia64 = "$host_cpu"; then
5361 # On IA64, the linker does run time linking by default, so we don't
5362 # have to do anything special.
5363 aix_use_runtimelinking=no
5364 exp_sym_flag='-Bexport'
5365 no_entry_flag=
5366 else
5367 # If we're using GNU nm, then we don't want the "-C" option.
5368 # -C means demangle to GNU nm, but means don't demangle to AIX nm.
5369 # Without the "-l" option, or with the "-B" option, AIX nm treats
5370 # weak defined symbols like other global defined symbols, whereas
5371 # GNU nm marks them as "W".
5372 # While the 'weak' keyword is ignored in the Export File, we need
5373 # it in the Import File for the 'aix-soname' feature, so we have
5374 # to replace the "-B" option with "-P" for AIX nm.
5375 if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
5376 _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols'
5377 else
5378 _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
5379 fi
5380 aix_use_runtimelinking=no
5381
5382 # Test if we are trying to use run time linking or normal
5383 # AIX style linking. If -brtl is somewhere in LDFLAGS, we
5384 # have runtime linking enabled, and use it for executables.
5385 # For shared libraries, we enable/disable runtime linking
5386 # depending on the kind of the shared library created -
5387 # when "with_aix_soname,aix_use_runtimelinking" is:
5388 # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables
5389 # "aix,yes" lib.so shared, rtl:yes, for executables
5390 # lib.a static archive
5391 # "both,no" lib.so.V(shr.o) shared, rtl:yes
5392 # lib.a(lib.so.V) shared, rtl:no, for executables
5393 # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables
5394 # lib.a(lib.so.V) shared, rtl:no
5395 # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables
5396 # lib.a static archive
5397 case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
5398 for ld_flag in $LDFLAGS; do
5399 if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then
5400 aix_use_runtimelinking=yes
5401 break
5402 fi
5403 done
5404 if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then
5405 # With aix-soname=svr4, we create the lib.so.V shared archives only,
5406 # so we don't have lib.a shared libs to link our executables.
5407 # We have to force runtime linking in this case.
5408 aix_use_runtimelinking=yes
5409 LDFLAGS="$LDFLAGS -Wl,-brtl"
5410 fi
5411 ;;
5412 esac
5413
5414 exp_sym_flag='-bexport'
5415 no_entry_flag='-bnoentry'
5416 fi
5417
5418 # When large executables or shared objects are built, AIX ld can
5419 # have problems creating the table of contents. If linking a library
5420 # or program results in "error TOC overflow" add -mminimal-toc to
5421 # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
5422 # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
5423
5424 _LT_TAGVAR(archive_cmds, $1)=''
5425 _LT_TAGVAR(hardcode_direct, $1)=yes
5426 _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
5427 _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
5428 _LT_TAGVAR(link_all_deplibs, $1)=yes
5429 _LT_TAGVAR(file_list_spec, $1)='$wl-f,'
5430 case $with_aix_soname,$aix_use_runtimelinking in
5431 aix,*) ;; # traditional, no import file
5432 svr4,* | *,yes) # use import file
5433 # The Import File defines what to hardcode.
5434 _LT_TAGVAR(hardcode_direct, $1)=no
5435 _LT_TAGVAR(hardcode_direct_absolute, $1)=no
5436 ;;
5437 esac
5438
5439 if test yes = "$GCC"; then
5440 case $host_os in aix4.[[012]]|aix4.[[012]].*)
5441 # We only want to do this on AIX 4.2 and lower, the check
5442 # below for broken collect2 doesn't work under 4.3+
5443 collect2name=`$CC -print-prog-name=collect2`
5444 if test -f "$collect2name" &&
5445 strings "$collect2name" | $GREP resolve_lib_name >/dev/null
5446 then
5447 # We have reworked collect2
5448 :
5449 else
5450 # We have old collect2
5451 _LT_TAGVAR(hardcode_direct, $1)=unsupported
5452 # It fails to find uninstalled libraries when the uninstalled
5453 # path is not listed in the libpath. Setting hardcode_minus_L
5454 # to unsupported forces relinking
5455 _LT_TAGVAR(hardcode_minus_L, $1)=yes
5456 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5457 _LT_TAGVAR(hardcode_libdir_separator, $1)=
5458 fi
5459 ;;
5460 esac
5461 shared_flag='-shared'
5462 if test yes = "$aix_use_runtimelinking"; then
5463 shared_flag="$shared_flag "'$wl-G'
5464 fi
5465 # Need to ensure runtime linking is disabled for the traditional
5466 # shared library, or the linker may eventually find shared libraries
5467 # /with/ Import File - we do not want to mix them.
5468 shared_flag_aix='-shared'
5469 shared_flag_svr4='-shared $wl-G'
5470 else
5471 # not using gcc
5472 if test ia64 = "$host_cpu"; then
5473 # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
5474 # chokes on -Wl,-G. The following line is correct:
5475 shared_flag='-G'
5476 else
5477 if test yes = "$aix_use_runtimelinking"; then
5478 shared_flag='$wl-G'
5479 else
5480 shared_flag='$wl-bM:SRE'
5481 fi
5482 shared_flag_aix='$wl-bM:SRE'
5483 shared_flag_svr4='$wl-G'
5484 fi
5485 fi
5486
5487 _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall'
5488 # It seems that -bexpall does not export symbols beginning with
5489 # underscore (_), so it is better to generate a list of symbols to export.
5490 _LT_TAGVAR(always_export_symbols, $1)=yes
5491 if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then
5492 # Warning - without using the other runtime loading flags (-brtl),
5493 # -berok will link without error, but may produce a broken library.
5494 _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
5495 # Determine the default libpath from the value encoded in an
5496 # empty executable.
5497 _LT_SYS_MODULE_PATH_AIX([$1])
5498 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
5499 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag
5500 else
5501 if test ia64 = "$host_cpu"; then
5502 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib'
5503 _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
5504 _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols"
5505 else
5506 # Determine the default libpath from the value encoded in an
5507 # empty executable.
5508 _LT_SYS_MODULE_PATH_AIX([$1])
5509 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
5510 # Warning - without using the other run time loading flags,
5511 # -berok will link without error, but may produce a broken library.
5512 _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok'
5513 _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok'
5514 if test yes = "$with_gnu_ld"; then
5515 # We only use this code for GNU lds that support --whole-archive.
5516 _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
5517 else
5518 # Exported symbols can be pulled into shared objects from archives
5519 _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
5520 fi
5521 _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
5522 _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d'
5523 # -brtl affects multiple linker settings, -berok does not and is overridden later
5524 compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`'
5525 if test svr4 != "$with_aix_soname"; then
5526 # This is similar to how AIX traditionally builds its shared libraries.
5527 _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname'
5528 fi
5529 if test aix != "$with_aix_soname"; then
5530 _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp'
5531 else
5532 # used by -dlpreopen to get the symbols
5533 _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV $output_objdir/$realname.d/$soname $output_objdir'
5534 fi
5535 _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d'
5536 fi
5537 fi
5538 ;;
5539
5540 amigaos*)
5541 case $host_cpu in
5542 powerpc)
5543 # see comment about AmigaOS4 .so support
5544 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
5545 _LT_TAGVAR(archive_expsym_cmds, $1)=''
5546 ;;
5547 m68k)
5548 _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
5549 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5550 _LT_TAGVAR(hardcode_minus_L, $1)=yes
5551 ;;
5552 esac
5553 ;;
5554
5555 bsdi[[45]]*)
5556 _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
5557 ;;
5558
5559 cygwin* | mingw* | pw32* | cegcc*)
5560 # When not using gcc, we currently assume that we are using
5561 # Microsoft Visual C++.
5562 # hardcode_libdir_flag_spec is actually meaningless, as there is
5563 # no search path for DLLs.
5564 case $cc_basename in
5565 cl*)
5566 # Native MSVC
5567 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
5568 _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5569 _LT_TAGVAR(always_export_symbols, $1)=yes
5570 _LT_TAGVAR(file_list_spec, $1)='@'
5571 # Tell ltmain to make .lib files, not .a files.
5572 libext=lib
5573 # Tell ltmain to make .dll files, not .so files.
5574 shrext_cmds=.dll
5575 # FIXME: Setting linknames here is a bad hack.
5576 _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames='
5577 _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
5578 cp "$export_symbols" "$output_objdir/$soname.def";
5579 echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp";
5580 else
5581 $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp;
5582 fi~
5583 $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
5584 linknames='
5585 # The linker will not automatically build a static lib if we build a DLL.
5586 # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
5587 _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
5588 _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
5589 _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols'
5590 # Don't use ranlib
5591 _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
5592 _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
5593 lt_tool_outputfile="@TOOL_OUTPUT@"~
5594 case $lt_outputfile in
5595 *.exe|*.EXE) ;;
5596 *)
5597 lt_outputfile=$lt_outputfile.exe
5598 lt_tool_outputfile=$lt_tool_outputfile.exe
5599 ;;
5600 esac~
5601 if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then
5602 $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
5603 $RM "$lt_outputfile.manifest";
5604 fi'
5605 ;;
5606 *)
5607 # Assume MSVC wrapper
5608 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
5609 _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5610 # Tell ltmain to make .lib files, not .a files.
5611 libext=lib
5612 # Tell ltmain to make .dll files, not .so files.
5613 shrext_cmds=.dll
5614 # FIXME: Setting linknames here is a bad hack.
5615 _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
5616 # The linker will automatically build a .lib file if we build a DLL.
5617 _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
5618 # FIXME: Should let the user specify the lib program.
5619 _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
5620 _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
5621 ;;
5622 esac
5623 ;;
5624
5625 darwin* | rhapsody*)
5626 _LT_DARWIN_LINKER_FEATURES($1)
5627 ;;
5628
5629 dgux*)
5630 _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5631 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5632 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5633 ;;
5634
5635 # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
5636 # support. Future versions do this automatically, but an explicit c++rt0.o
5637 # does not break anything, and helps significantly (at the cost of a little
5638 # extra space).
5639 freebsd2.2*)
5640 _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
5641 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
5642 _LT_TAGVAR(hardcode_direct, $1)=yes
5643 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5644 ;;
5645
5646 # Unfortunately, older versions of FreeBSD 2 do not have this feature.
5647 freebsd2.*)
5648 _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
5649 _LT_TAGVAR(hardcode_direct, $1)=yes
5650 _LT_TAGVAR(hardcode_minus_L, $1)=yes
5651 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5652 ;;
5653
5654 # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
5655 freebsd* | dragonfly*)
5656 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
5657 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
5658 _LT_TAGVAR(hardcode_direct, $1)=yes
5659 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5660 ;;
5661
5662 hpux9*)
5663 if test yes = "$GCC"; then
5664 _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
5665 else
5666 _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
5667 fi
5668 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
5669 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5670 _LT_TAGVAR(hardcode_direct, $1)=yes
5671
5672 # hardcode_minus_L: Not really in the search PATH,
5673 # but as the default location of the library.
5674 _LT_TAGVAR(hardcode_minus_L, $1)=yes
5675 _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
5676 ;;
5677
5678 hpux10*)
5679 if test yes,no = "$GCC,$with_gnu_ld"; then
5680 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
5681 else
5682 _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
5683 fi
5684 if test no = "$with_gnu_ld"; then
5685 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
5686 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5687 _LT_TAGVAR(hardcode_direct, $1)=yes
5688 _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
5689 _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
5690 # hardcode_minus_L: Not really in the search PATH,
5691 # but as the default location of the library.
5692 _LT_TAGVAR(hardcode_minus_L, $1)=yes
5693 fi
5694 ;;
5695
5696 hpux11*)
5697 if test yes,no = "$GCC,$with_gnu_ld"; then
5698 case $host_cpu in
5699 hppa*64*)
5700 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
5701 ;;
5702 ia64*)
5703 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
5704 ;;
5705 *)
5706 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
5707 ;;
5708 esac
5709 else
5710 case $host_cpu in
5711 hppa*64*)
5712 _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
5713 ;;
5714 ia64*)
5715 _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
5716 ;;
5717 *)
5718 m4_if($1, [], [
5719 # Older versions of the 11.00 compiler do not understand -b yet
5720 # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
5721 _LT_LINKER_OPTION([if $CC understands -b],
5722 _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b],
5723 [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],
5724 [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])],
5725 [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'])
5726 ;;
5727 esac
5728 fi
5729 if test no = "$with_gnu_ld"; then
5730 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
5731 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5732
5733 case $host_cpu in
5734 hppa*64*|ia64*)
5735 _LT_TAGVAR(hardcode_direct, $1)=no
5736 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5737 ;;
5738 *)
5739 _LT_TAGVAR(hardcode_direct, $1)=yes
5740 _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
5741 _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
5742
5743 # hardcode_minus_L: Not really in the search PATH,
5744 # but as the default location of the library.
5745 _LT_TAGVAR(hardcode_minus_L, $1)=yes
5746 ;;
5747 esac
5748 fi
5749 ;;
5750
5751 irix5* | irix6* | nonstopux*)
5752 if test yes = "$GCC"; then
5753 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
5754 # Try to use the -exported_symbol ld option, if it does not
5755 # work, assume that -exports_file does not work either and
5756 # implicitly export all symbols.
5757 # This should be the same for all languages, so no per-tag cache variable.
5758 AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol],
5759 [lt_cv_irix_exported_symbol],
5760 [save_LDFLAGS=$LDFLAGS
5761 LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null"
5762 AC_LINK_IFELSE(
5763 [AC_LANG_SOURCE(
5764 [AC_LANG_CASE([C], [[int foo (void) { return 0; }]],
5765 [C++], [[int foo (void) { return 0; }]],
5766 [Fortran 77], [[
5767 subroutine foo
5768 end]],
5769 [Fortran], [[
5770 subroutine foo
5771 end]])])],
5772 [lt_cv_irix_exported_symbol=yes],
5773 [lt_cv_irix_exported_symbol=no])
5774 LDFLAGS=$save_LDFLAGS])
5775 if test yes = "$lt_cv_irix_exported_symbol"; then
5776 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib'
5777 fi
5778 else
5779 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
5780 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib'
5781 fi
5782 _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
5783 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
5784 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5785 _LT_TAGVAR(inherit_rpath, $1)=yes
5786 _LT_TAGVAR(link_all_deplibs, $1)=yes
5787 ;;
5788
5789 linux*)
5790 case $cc_basename in
5791 tcc*)
5792 # Fabrice Bellard et al's Tiny C Compiler
5793 _LT_TAGVAR(ld_shlibs, $1)=yes
5794 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
5795 ;;
5796 esac
5797 ;;
5798
5799 netbsd*)
5800 if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
5801 _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
5802 else
5803 _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
5804 fi
5805 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
5806 _LT_TAGVAR(hardcode_direct, $1)=yes
5807 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5808 ;;
5809
5810 newsos6)
5811 _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5812 _LT_TAGVAR(hardcode_direct, $1)=yes
5813 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
5814 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5815 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5816 ;;
5817
5818 *nto* | *qnx*)
5819 ;;
5820
5821 openbsd* | bitrig*)
5822 if test -f /usr/libexec/ld.so; then
5823 _LT_TAGVAR(hardcode_direct, $1)=yes
5824 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5825 _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
5826 if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
5827 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
5828 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols'
5829 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
5830 _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
5831 else
5832 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
5833 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
5834 fi
5835 else
5836 _LT_TAGVAR(ld_shlibs, $1)=no
5837 fi
5838 ;;
5839
5840 os2*)
5841 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5842 _LT_TAGVAR(hardcode_minus_L, $1)=yes
5843 _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5844 shrext_cmds=.dll
5845 _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
5846 $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
5847 $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
5848 $ECHO EXPORTS >> $output_objdir/$libname.def~
5849 emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
5850 $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
5851 emximp -o $lib $output_objdir/$libname.def'
5852 _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
5853 $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
5854 $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
5855 $ECHO EXPORTS >> $output_objdir/$libname.def~
5856 prefix_cmds="$SED"~
5857 if test EXPORTS = "`$SED 1q $export_symbols`"; then
5858 prefix_cmds="$prefix_cmds -e 1d";
5859 fi~
5860 prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
5861 cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
5862 $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
5863 emximp -o $lib $output_objdir/$libname.def'
5864 _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
5865 _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
5866 ;;
5867
5868 osf3*)
5869 if test yes = "$GCC"; then
5870 _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
5871 _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
5872 else
5873 _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
5874 _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
5875 fi
5876 _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
5877 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
5878 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5879 ;;
5880
5881 osf4* | osf5*) # as osf3* with the addition of -msym flag
5882 if test yes = "$GCC"; then
5883 _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
5884 _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
5885 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
5886 else
5887 _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
5888 _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
5889 _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
5890 $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp'
5891
5892 # Both c and cxx compiler support -rpath directly
5893 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
5894 fi
5895 _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
5896 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5897 ;;
5898
5899 solaris*)
5900 _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
5901 if test yes = "$GCC"; then
5902 wlarc='$wl'
5903 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
5904 _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
5905 $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
5906 else
5907 case `$CC -V 2>&1` in
5908 *"Compilers 5.0"*)
5909 wlarc=''
5910 _LT_TAGVAR(archive_cmds, $1)='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags'
5911 _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
5912 $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
5913 ;;
5914 *)
5915 wlarc='$wl'
5916 _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags'
5917 _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
5918 $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
5919 ;;
5920 esac
5921 fi
5922 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
5923 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5924 case $host_os in
5925 solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
5926 *)
5927 # The compiler driver will combine and reorder linker options,
5928 # but understands '-z linker_flag'. GCC discards it without '$wl',
5929 # but is careful enough not to reorder.
5930 # Supported since Solaris 2.6 (maybe 2.5.1?)
5931 if test yes = "$GCC"; then
5932 _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract'
5933 else
5934 _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
5935 fi
5936 ;;
5937 esac
5938 _LT_TAGVAR(link_all_deplibs, $1)=yes
5939 ;;
5940
5941 sunos4*)
5942 if test sequent = "$host_vendor"; then
5943 # Use $CC to link under sequent, because it throws in some extra .o
5944 # files that make .init and .fini sections work.
5945 _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags'
5946 else
5947 _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
5948 fi
5949 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5950 _LT_TAGVAR(hardcode_direct, $1)=yes
5951 _LT_TAGVAR(hardcode_minus_L, $1)=yes
5952 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5953 ;;
5954
5955 sysv4)
5956 case $host_vendor in
5957 sni)
5958 _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5959 _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
5960 ;;
5961 siemens)
5962 ## LD is ld it makes a PLAMLIB
5963 ## CC just makes a GrossModule.
5964 _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
5965 _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
5966 _LT_TAGVAR(hardcode_direct, $1)=no
5967 ;;
5968 motorola)
5969 _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5970 _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
5971 ;;
5972 esac
5973 runpath_var='LD_RUN_PATH'
5974 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5975 ;;
5976
5977 sysv4.3*)
5978 _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5979 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5980 _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
5981 ;;
5982
5983 sysv4*MP*)
5984 if test -d /usr/nec; then
5985 _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5986 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5987 runpath_var=LD_RUN_PATH
5988 hardcode_runpath_var=yes
5989 _LT_TAGVAR(ld_shlibs, $1)=yes
5990 fi
5991 ;;
5992
5993 sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
5994 _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
5995 _LT_TAGVAR(archive_cmds_need_lc, $1)=no
5996 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5997 runpath_var='LD_RUN_PATH'
5998
5999 if test yes = "$GCC"; then
6000 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6001 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6002 else
6003 _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6004 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6005 fi
6006 ;;
6007
6008 sysv5* | sco3.2v5* | sco5v6*)
6009 # Note: We CANNOT use -z defs as we might desire, because we do not
6010 # link with -lc, and that would cause any symbols used from libc to
6011 # always be unresolved, which means just about no library would
6012 # ever link correctly. If we're not using GNU ld we use -z text
6013 # though, which does catch some bad symbols but isn't as heavy-handed
6014 # as -z defs.
6015 _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
6016 _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs'
6017 _LT_TAGVAR(archive_cmds_need_lc, $1)=no
6018 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6019 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir'
6020 _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
6021 _LT_TAGVAR(link_all_deplibs, $1)=yes
6022 _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport'
6023 runpath_var='LD_RUN_PATH'
6024
6025 if test yes = "$GCC"; then
6026 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6027 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6028 else
6029 _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6030 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6031 fi
6032 ;;
6033
6034 uts4*)
6035 _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6036 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6037 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6038 ;;
6039
6040 *)
6041 _LT_TAGVAR(ld_shlibs, $1)=no
6042 ;;
6043 esac
6044
6045 if test sni = "$host_vendor"; then
6046 case $host in
6047 sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
6048 _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Blargedynsym'
6049 ;;
6050 esac
6051 fi
6052 fi
6053 ])
6054 AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
6055 test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no
6056
6057 _LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
6058
6059 _LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
6060 _LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
6061 _LT_DECL([], [extract_expsyms_cmds], [2],
6062 [The commands to extract the exported symbol list from a shared archive])
6063
6064 #
6065 # Do we need to explicitly link libc?
6066 #
6067 case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
6068 x|xyes)
6069 # Assume -lc should be added
6070 _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
6071
6072 if test yes,yes = "$GCC,$enable_shared"; then
6073 case $_LT_TAGVAR(archive_cmds, $1) in
6074 *'~'*)
6075 # FIXME: we may have to deal with multi-command sequences.
6076 ;;
6077 '$CC '*)
6078 # Test whether the compiler implicitly links with -lc since on some
6079 # systems, -lgcc has to come before -lc. If gcc already passes -lc
6080 # to ld, don't add -lc before -lgcc.
6081 AC_CACHE_CHECK([whether -lc should be explicitly linked in],
6082 [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1),
6083 [$RM conftest*
6084 echo "$lt_simple_compile_test_code" > conftest.$ac_ext
6085
6086 if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
6087 soname=conftest
6088 lib=conftest
6089 libobjs=conftest.$ac_objext
6090 deplibs=
6091 wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
6092 pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
6093 compiler_flags=-v
6094 linker_flags=-v
6095 verstring=
6096 output_objdir=.
6097 libname=conftest
6098 lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
6099 _LT_TAGVAR(allow_undefined_flag, $1)=
6100 if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
6101 then
6102 lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no
6103 else
6104 lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes
6105 fi
6106 _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
6107 else
6108 cat conftest.err 1>&5
6109 fi
6110 $RM conftest*
6111 ])
6112 _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)
6113 ;;
6114 esac
6115 fi
6116 ;;
6117 esac
6118
6119 _LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
6120 [Whether or not to add -lc for building shared libraries])
6121 _LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
6122 [enable_shared_with_static_runtimes], [0],
6123 [Whether or not to disallow shared libs when runtime libs are static])
6124 _LT_TAGDECL([], [export_dynamic_flag_spec], [1],
6125 [Compiler flag to allow reflexive dlopens])
6126 _LT_TAGDECL([], [whole_archive_flag_spec], [1],
6127 [Compiler flag to generate shared objects directly from archives])
6128 _LT_TAGDECL([], [compiler_needs_object], [1],
6129 [Whether the compiler copes with passing no objects directly])
6130 _LT_TAGDECL([], [old_archive_from_new_cmds], [2],
6131 [Create an old-style archive from a shared archive])
6132 _LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
6133 [Create a temporary old-style archive to link instead of a shared archive])
6134 _LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
6135 _LT_TAGDECL([], [archive_expsym_cmds], [2])
6136 _LT_TAGDECL([], [module_cmds], [2],
6137 [Commands used to build a loadable module if different from building
6138 a shared archive.])
6139 _LT_TAGDECL([], [module_expsym_cmds], [2])
6140 _LT_TAGDECL([], [with_gnu_ld], [1],
6141 [Whether we are building with GNU ld or not])
6142 _LT_TAGDECL([], [allow_undefined_flag], [1],
6143 [Flag that allows shared libraries with undefined symbols to be built])
6144 _LT_TAGDECL([], [no_undefined_flag], [1],
6145 [Flag that enforces no undefined symbols])
6146 _LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
6147 [Flag to hardcode $libdir into a binary during linking.
6148 This must work even if $libdir does not exist])
6149 _LT_TAGDECL([], [hardcode_libdir_separator], [1],
6150 [Whether we need a single "-rpath" flag with a separated argument])
6151 _LT_TAGDECL([], [hardcode_direct], [0],
6152 [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
6153 DIR into the resulting binary])
6154 _LT_TAGDECL([], [hardcode_direct_absolute], [0],
6155 [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
6156 DIR into the resulting binary and the resulting library dependency is
6157 "absolute", i.e impossible to change by setting $shlibpath_var if the
6158 library is relocated])
6159 _LT_TAGDECL([], [hardcode_minus_L], [0],
6160 [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
6161 into the resulting binary])
6162 _LT_TAGDECL([], [hardcode_shlibpath_var], [0],
6163 [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
6164 into the resulting binary])
6165 _LT_TAGDECL([], [hardcode_automatic], [0],
6166 [Set to "yes" if building a shared library automatically hardcodes DIR
6167 into the library and all subsequent libraries and executables linked
6168 against it])
6169 _LT_TAGDECL([], [inherit_rpath], [0],
6170 [Set to yes if linker adds runtime paths of dependent libraries
6171 to runtime path list])
6172 _LT_TAGDECL([], [link_all_deplibs], [0],
6173 [Whether libtool must link a program against all its dependency libraries])
6174 _LT_TAGDECL([], [always_export_symbols], [0],
6175 [Set to "yes" if exported symbols are required])
6176 _LT_TAGDECL([], [export_symbols_cmds], [2],
6177 [The commands to list exported symbols])
6178 _LT_TAGDECL([], [exclude_expsyms], [1],
6179 [Symbols that should not be listed in the preloaded symbols])
6180 _LT_TAGDECL([], [include_expsyms], [1],
6181 [Symbols that must always be exported])
6182 _LT_TAGDECL([], [prelink_cmds], [2],
6183 [Commands necessary for linking programs (against libraries) with templates])
6184 _LT_TAGDECL([], [postlink_cmds], [2],
6185 [Commands necessary for finishing linking programs])
6186 _LT_TAGDECL([], [file_list_spec], [1],
6187 [Specify filename containing input files])
6188 dnl FIXME: Not yet implemented
6189 dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
6190 dnl [Compiler flag to generate thread safe objects])
6191 ])# _LT_LINKER_SHLIBS
6192
6193
6194 # _LT_LANG_C_CONFIG([TAG])
6195 # ------------------------
6196 # Ensure that the configuration variables for a C compiler are suitably
6197 # defined. These variables are subsequently used by _LT_CONFIG to write
6198 # the compiler configuration to 'libtool'.
6199 m4_defun([_LT_LANG_C_CONFIG],
6200 [m4_require([_LT_DECL_EGREP])dnl
6201 lt_save_CC=$CC
6202 AC_LANG_PUSH(C)
6203
6204 # Source file extension for C test sources.
6205 ac_ext=c
6206
6207 # Object file extension for compiled C test sources.
6208 objext=o
6209 _LT_TAGVAR(objext, $1)=$objext
6210
6211 # Code to be used in simple compile tests
6212 lt_simple_compile_test_code="int some_variable = 0;"
6213
6214 # Code to be used in simple link tests
6215 lt_simple_link_test_code='int main(){return(0);}'
6216
6217 _LT_TAG_COMPILER
6218 # Save the default compiler, since it gets overwritten when the other
6219 # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
6220 compiler_DEFAULT=$CC
6221
6222 # save warnings/boilerplate of simple test code
6223 _LT_COMPILER_BOILERPLATE
6224 _LT_LINKER_BOILERPLATE
6225
6226 ## CAVEAT EMPTOR:
6227 ## There is no encapsulation within the following macros, do not change
6228 ## the running order or otherwise move them around unless you know exactly
6229 ## what you are doing...
6230 if test -n "$compiler"; then
6231 _LT_COMPILER_NO_RTTI($1)
6232 _LT_COMPILER_PIC($1)
6233 _LT_COMPILER_C_O($1)
6234 _LT_COMPILER_FILE_LOCKS($1)
6235 _LT_LINKER_SHLIBS($1)
6236 _LT_SYS_DYNAMIC_LINKER($1)
6237 _LT_LINKER_HARDCODE_LIBPATH($1)
6238 LT_SYS_DLOPEN_SELF
6239 _LT_CMD_STRIPLIB
6240
6241 # Report what library types will actually be built
6242 AC_MSG_CHECKING([if libtool supports shared libraries])
6243 AC_MSG_RESULT([$can_build_shared])
6244
6245 AC_MSG_CHECKING([whether to build shared libraries])
6246 test no = "$can_build_shared" && enable_shared=no
6247
6248 # On AIX, shared libraries and static libraries use the same namespace, and
6249 # are all built from PIC.
6250 case $host_os in
6251 aix3*)
6252 test yes = "$enable_shared" && enable_static=no
6253 if test -n "$RANLIB"; then
6254 archive_cmds="$archive_cmds~\$RANLIB \$lib"
6255 postinstall_cmds='$RANLIB $lib'
6256 fi
6257 ;;
6258
6259 aix[[4-9]]*)
6260 if test ia64 != "$host_cpu"; then
6261 case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
6262 yes,aix,yes) ;; # shared object as lib.so file only
6263 yes,svr4,*) ;; # shared object as lib.so archive member only
6264 yes,*) enable_static=no ;; # shared object in lib.a archive as well
6265 esac
6266 fi
6267 ;;
6268 esac
6269 AC_MSG_RESULT([$enable_shared])
6270
6271 AC_MSG_CHECKING([whether to build static libraries])
6272 # Make sure either enable_shared or enable_static is yes.
6273 test yes = "$enable_shared" || enable_static=yes
6274 AC_MSG_RESULT([$enable_static])
6275
6276 _LT_CONFIG($1)
6277 fi
6278 AC_LANG_POP
6279 CC=$lt_save_CC
6280 ])# _LT_LANG_C_CONFIG
6281
6282
6283 # _LT_LANG_CXX_CONFIG([TAG])
6284 # --------------------------
6285 # Ensure that the configuration variables for a C++ compiler are suitably
6286 # defined. These variables are subsequently used by _LT_CONFIG to write
6287 # the compiler configuration to 'libtool'.
6288 m4_defun([_LT_LANG_CXX_CONFIG],
6289 [m4_require([_LT_FILEUTILS_DEFAULTS])dnl
6290 m4_require([_LT_DECL_EGREP])dnl
6291 m4_require([_LT_PATH_MANIFEST_TOOL])dnl
6292 if test -n "$CXX" && ( test no != "$CXX" &&
6293 ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) ||
6294 (test g++ != "$CXX"))); then
6295 AC_PROG_CXXCPP
6296 else
6297 _lt_caught_CXX_error=yes
6298 fi
6299
6300 AC_LANG_PUSH(C++)
6301 _LT_TAGVAR(archive_cmds_need_lc, $1)=no
6302 _LT_TAGVAR(allow_undefined_flag, $1)=
6303 _LT_TAGVAR(always_export_symbols, $1)=no
6304 _LT_TAGVAR(archive_expsym_cmds, $1)=
6305 _LT_TAGVAR(compiler_needs_object, $1)=no
6306 _LT_TAGVAR(export_dynamic_flag_spec, $1)=
6307 _LT_TAGVAR(hardcode_direct, $1)=no
6308 _LT_TAGVAR(hardcode_direct_absolute, $1)=no
6309 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
6310 _LT_TAGVAR(hardcode_libdir_separator, $1)=
6311 _LT_TAGVAR(hardcode_minus_L, $1)=no
6312 _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
6313 _LT_TAGVAR(hardcode_automatic, $1)=no
6314 _LT_TAGVAR(inherit_rpath, $1)=no
6315 _LT_TAGVAR(module_cmds, $1)=
6316 _LT_TAGVAR(module_expsym_cmds, $1)=
6317 _LT_TAGVAR(link_all_deplibs, $1)=unknown
6318 _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
6319 _LT_TAGVAR(reload_flag, $1)=$reload_flag
6320 _LT_TAGVAR(reload_cmds, $1)=$reload_cmds
6321 _LT_TAGVAR(no_undefined_flag, $1)=
6322 _LT_TAGVAR(whole_archive_flag_spec, $1)=
6323 _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
6324
6325 # Source file extension for C++ test sources.
6326 ac_ext=cpp
6327
6328 # Object file extension for compiled C++ test sources.
6329 objext=o
6330 _LT_TAGVAR(objext, $1)=$objext
6331
6332 # No sense in running all these tests if we already determined that
6333 # the CXX compiler isn't working. Some variables (like enable_shared)
6334 # are currently assumed to apply to all compilers on this platform,
6335 # and will be corrupted by setting them based on a non-working compiler.
6336 if test yes != "$_lt_caught_CXX_error"; then
6337 # Code to be used in simple compile tests
6338 lt_simple_compile_test_code="int some_variable = 0;"
6339
6340 # Code to be used in simple link tests
6341 lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
6342
6343 # ltmain only uses $CC for tagged configurations so make sure $CC is set.
6344 _LT_TAG_COMPILER
6345
6346 # save warnings/boilerplate of simple test code
6347 _LT_COMPILER_BOILERPLATE
6348 _LT_LINKER_BOILERPLATE
6349
6350 # Allow CC to be a program name with arguments.
6351 lt_save_CC=$CC
6352 lt_save_CFLAGS=$CFLAGS
6353 lt_save_LD=$LD
6354 lt_save_GCC=$GCC
6355 GCC=$GXX
6356 lt_save_with_gnu_ld=$with_gnu_ld
6357 lt_save_path_LD=$lt_cv_path_LD
6358 if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
6359 lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
6360 else
6361 $as_unset lt_cv_prog_gnu_ld
6362 fi
6363 if test -n "${lt_cv_path_LDCXX+set}"; then
6364 lt_cv_path_LD=$lt_cv_path_LDCXX
6365 else
6366 $as_unset lt_cv_path_LD
6367 fi
6368 test -z "${LDCXX+set}" || LD=$LDCXX
6369 CC=${CXX-"c++"}
6370 CFLAGS=$CXXFLAGS
6371 compiler=$CC
6372 _LT_TAGVAR(compiler, $1)=$CC
6373 _LT_CC_BASENAME([$compiler])
6374
6375 if test -n "$compiler"; then
6376 # We don't want -fno-exception when compiling C++ code, so set the
6377 # no_builtin_flag separately
6378 if test yes = "$GXX"; then
6379 _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
6380 else
6381 _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
6382 fi
6383
6384 if test yes = "$GXX"; then
6385 # Set up default GNU C++ configuration
6386
6387 LT_PATH_LD
6388
6389 # Check if GNU C++ uses GNU ld as the underlying linker, since the
6390 # archiving commands below assume that GNU ld is being used.
6391 if test yes = "$with_gnu_ld"; then
6392 _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
6393 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
6394
6395 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
6396 _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
6397
6398 # If archive_cmds runs LD, not CC, wlarc should be empty
6399 # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
6400 # investigate it a little bit more. (MM)
6401 wlarc='$wl'
6402
6403 # ancient GNU ld didn't support --whole-archive et. al.
6404 if eval "`$CC -print-prog-name=ld` --help 2>&1" |
6405 $GREP 'no-whole-archive' > /dev/null; then
6406 _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
6407 else
6408 _LT_TAGVAR(whole_archive_flag_spec, $1)=
6409 fi
6410 else
6411 with_gnu_ld=no
6412 wlarc=
6413
6414 # A generic and very simple default shared library creation
6415 # command for GNU C++ for the case where it uses the native
6416 # linker, instead of GNU ld. If possible, this setting should
6417 # overridden to take advantage of the native linker features on
6418 # the platform it is being used on.
6419 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
6420 fi
6421
6422 # Commands to make compiler produce verbose output that lists
6423 # what "hidden" libraries, object files and flags are used when
6424 # linking a shared library.
6425 output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
6426
6427 else
6428 GXX=no
6429 with_gnu_ld=no
6430 wlarc=
6431 fi
6432
6433 # PORTME: fill in a description of your system's C++ link characteristics
6434 AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
6435 _LT_TAGVAR(ld_shlibs, $1)=yes
6436 case $host_os in
6437 aix3*)
6438 # FIXME: insert proper C++ library support
6439 _LT_TAGVAR(ld_shlibs, $1)=no
6440 ;;
6441 aix[[4-9]]*)
6442 if test ia64 = "$host_cpu"; then
6443 # On IA64, the linker does run time linking by default, so we don't
6444 # have to do anything special.
6445 aix_use_runtimelinking=no
6446 exp_sym_flag='-Bexport'
6447 no_entry_flag=
6448 else
6449 aix_use_runtimelinking=no
6450
6451 # Test if we are trying to use run time linking or normal
6452 # AIX style linking. If -brtl is somewhere in LDFLAGS, we
6453 # have runtime linking enabled, and use it for executables.
6454 # For shared libraries, we enable/disable runtime linking
6455 # depending on the kind of the shared library created -
6456 # when "with_aix_soname,aix_use_runtimelinking" is:
6457 # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables
6458 # "aix,yes" lib.so shared, rtl:yes, for executables
6459 # lib.a static archive
6460 # "both,no" lib.so.V(shr.o) shared, rtl:yes
6461 # lib.a(lib.so.V) shared, rtl:no, for executables
6462 # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables
6463 # lib.a(lib.so.V) shared, rtl:no
6464 # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables
6465 # lib.a static archive
6466 case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
6467 for ld_flag in $LDFLAGS; do
6468 case $ld_flag in
6469 *-brtl*)
6470 aix_use_runtimelinking=yes
6471 break
6472 ;;
6473 esac
6474 done
6475 if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then
6476 # With aix-soname=svr4, we create the lib.so.V shared archives only,
6477 # so we don't have lib.a shared libs to link our executables.
6478 # We have to force runtime linking in this case.
6479 aix_use_runtimelinking=yes
6480 LDFLAGS="$LDFLAGS -Wl,-brtl"
6481 fi
6482 ;;
6483 esac
6484
6485 exp_sym_flag='-bexport'
6486 no_entry_flag='-bnoentry'
6487 fi
6488
6489 # When large executables or shared objects are built, AIX ld can
6490 # have problems creating the table of contents. If linking a library
6491 # or program results in "error TOC overflow" add -mminimal-toc to
6492 # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
6493 # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
6494
6495 _LT_TAGVAR(archive_cmds, $1)=''
6496 _LT_TAGVAR(hardcode_direct, $1)=yes
6497 _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
6498 _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
6499 _LT_TAGVAR(link_all_deplibs, $1)=yes
6500 _LT_TAGVAR(file_list_spec, $1)='$wl-f,'
6501 case $with_aix_soname,$aix_use_runtimelinking in
6502 aix,*) ;; # no import file
6503 svr4,* | *,yes) # use import file
6504 # The Import File defines what to hardcode.
6505 _LT_TAGVAR(hardcode_direct, $1)=no
6506 _LT_TAGVAR(hardcode_direct_absolute, $1)=no
6507 ;;
6508 esac
6509
6510 if test yes = "$GXX"; then
6511 case $host_os in aix4.[[012]]|aix4.[[012]].*)
6512 # We only want to do this on AIX 4.2 and lower, the check
6513 # below for broken collect2 doesn't work under 4.3+
6514 collect2name=`$CC -print-prog-name=collect2`
6515 if test -f "$collect2name" &&
6516 strings "$collect2name" | $GREP resolve_lib_name >/dev/null
6517 then
6518 # We have reworked collect2
6519 :
6520 else
6521 # We have old collect2
6522 _LT_TAGVAR(hardcode_direct, $1)=unsupported
6523 # It fails to find uninstalled libraries when the uninstalled
6524 # path is not listed in the libpath. Setting hardcode_minus_L
6525 # to unsupported forces relinking
6526 _LT_TAGVAR(hardcode_minus_L, $1)=yes
6527 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6528 _LT_TAGVAR(hardcode_libdir_separator, $1)=
6529 fi
6530 esac
6531 shared_flag='-shared'
6532 if test yes = "$aix_use_runtimelinking"; then
6533 shared_flag=$shared_flag' $wl-G'
6534 fi
6535 # Need to ensure runtime linking is disabled for the traditional
6536 # shared library, or the linker may eventually find shared libraries
6537 # /with/ Import File - we do not want to mix them.
6538 shared_flag_aix='-shared'
6539 shared_flag_svr4='-shared $wl-G'
6540 else
6541 # not using gcc
6542 if test ia64 = "$host_cpu"; then
6543 # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
6544 # chokes on -Wl,-G. The following line is correct:
6545 shared_flag='-G'
6546 else
6547 if test yes = "$aix_use_runtimelinking"; then
6548 shared_flag='$wl-G'
6549 else
6550 shared_flag='$wl-bM:SRE'
6551 fi
6552 shared_flag_aix='$wl-bM:SRE'
6553 shared_flag_svr4='$wl-G'
6554 fi
6555 fi
6556
6557 _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall'
6558 # It seems that -bexpall does not export symbols beginning with
6559 # underscore (_), so it is better to generate a list of symbols to
6560 # export.
6561 _LT_TAGVAR(always_export_symbols, $1)=yes
6562 if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then
6563 # Warning - without using the other runtime loading flags (-brtl),
6564 # -berok will link without error, but may produce a broken library.
6565 # The "-G" linker flag allows undefined symbols.
6566 _LT_TAGVAR(no_undefined_flag, $1)='-bernotok'
6567 # Determine the default libpath from the value encoded in an empty
6568 # executable.
6569 _LT_SYS_MODULE_PATH_AIX([$1])
6570 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
6571
6572 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag
6573 else
6574 if test ia64 = "$host_cpu"; then
6575 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib'
6576 _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
6577 _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols"
6578 else
6579 # Determine the default libpath from the value encoded in an
6580 # empty executable.
6581 _LT_SYS_MODULE_PATH_AIX([$1])
6582 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
6583 # Warning - without using the other run time loading flags,
6584 # -berok will link without error, but may produce a broken library.
6585 _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok'
6586 _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok'
6587 if test yes = "$with_gnu_ld"; then
6588 # We only use this code for GNU lds that support --whole-archive.
6589 _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
6590 else
6591 # Exported symbols can be pulled into shared objects from archives
6592 _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
6593 fi
6594 _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
6595 _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d'
6596 # -brtl affects multiple linker settings, -berok does not and is overridden later
6597 compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`'
6598 if test svr4 != "$with_aix_soname"; then
6599 # This is similar to how AIX traditionally builds its shared
6600 # libraries. Need -bnortl late, we may have -brtl in LDFLAGS.
6601 _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname'
6602 fi
6603 if test aix != "$with_aix_soname"; then
6604 _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp'
6605 else
6606 # used by -dlpreopen to get the symbols
6607 _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV $output_objdir/$realname.d/$soname $output_objdir'
6608 fi
6609 _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d'
6610 fi
6611 fi
6612 ;;
6613
6614 beos*)
6615 if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
6616 _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
6617 # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
6618 # support --undefined. This deserves some investigation. FIXME
6619 _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
6620 else
6621 _LT_TAGVAR(ld_shlibs, $1)=no
6622 fi
6623 ;;
6624
6625 chorus*)
6626 case $cc_basename in
6627 *)
6628 # FIXME: insert proper C++ library support
6629 _LT_TAGVAR(ld_shlibs, $1)=no
6630 ;;
6631 esac
6632 ;;
6633
6634 cygwin* | mingw* | pw32* | cegcc*)
6635 case $GXX,$cc_basename in
6636 ,cl* | no,cl*)
6637 # Native MSVC
6638 # hardcode_libdir_flag_spec is actually meaningless, as there is
6639 # no search path for DLLs.
6640 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
6641 _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
6642 _LT_TAGVAR(always_export_symbols, $1)=yes
6643 _LT_TAGVAR(file_list_spec, $1)='@'
6644 # Tell ltmain to make .lib files, not .a files.
6645 libext=lib
6646 # Tell ltmain to make .dll files, not .so files.
6647 shrext_cmds=.dll
6648 # FIXME: Setting linknames here is a bad hack.
6649 _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames='
6650 _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
6651 cp "$export_symbols" "$output_objdir/$soname.def";
6652 echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp";
6653 else
6654 $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp;
6655 fi~
6656 $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
6657 linknames='
6658 # The linker will not automatically build a static lib if we build a DLL.
6659 # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
6660 _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
6661 # Don't use ranlib
6662 _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
6663 _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
6664 lt_tool_outputfile="@TOOL_OUTPUT@"~
6665 case $lt_outputfile in
6666 *.exe|*.EXE) ;;
6667 *)
6668 lt_outputfile=$lt_outputfile.exe
6669 lt_tool_outputfile=$lt_tool_outputfile.exe
6670 ;;
6671 esac~
6672 func_to_tool_file "$lt_outputfile"~
6673 if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then
6674 $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
6675 $RM "$lt_outputfile.manifest";
6676 fi'
6677 ;;
6678 *)
6679 # g++
6680 # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
6681 # as there is no search path for DLLs.
6682 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6683 _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols'
6684 _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
6685 _LT_TAGVAR(always_export_symbols, $1)=no
6686 _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
6687
6688 if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
6689 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
6690 # If the export-symbols file already is a .def file, use it as
6691 # is; otherwise, prepend EXPORTS...
6692 _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
6693 cp $export_symbols $output_objdir/$soname.def;
6694 else
6695 echo EXPORTS > $output_objdir/$soname.def;
6696 cat $export_symbols >> $output_objdir/$soname.def;
6697 fi~
6698 $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
6699 else
6700 _LT_TAGVAR(ld_shlibs, $1)=no
6701 fi
6702 ;;
6703 esac
6704 ;;
6705 darwin* | rhapsody*)
6706 _LT_DARWIN_LINKER_FEATURES($1)
6707 ;;
6708
6709 os2*)
6710 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6711 _LT_TAGVAR(hardcode_minus_L, $1)=yes
6712 _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
6713 shrext_cmds=.dll
6714 _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
6715 $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
6716 $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
6717 $ECHO EXPORTS >> $output_objdir/$libname.def~
6718 emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
6719 $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
6720 emximp -o $lib $output_objdir/$libname.def'
6721 _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
6722 $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
6723 $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
6724 $ECHO EXPORTS >> $output_objdir/$libname.def~
6725 prefix_cmds="$SED"~
6726 if test EXPORTS = "`$SED 1q $export_symbols`"; then
6727 prefix_cmds="$prefix_cmds -e 1d";
6728 fi~
6729 prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
6730 cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
6731 $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
6732 emximp -o $lib $output_objdir/$libname.def'
6733 _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
6734 _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
6735 ;;
6736
6737 dgux*)
6738 case $cc_basename in
6739 ec++*)
6740 # FIXME: insert proper C++ library support
6741 _LT_TAGVAR(ld_shlibs, $1)=no
6742 ;;
6743 ghcx*)
6744 # Green Hills C++ Compiler
6745 # FIXME: insert proper C++ library support
6746 _LT_TAGVAR(ld_shlibs, $1)=no
6747 ;;
6748 *)
6749 # FIXME: insert proper C++ library support
6750 _LT_TAGVAR(ld_shlibs, $1)=no
6751 ;;
6752 esac
6753 ;;
6754
6755 freebsd2.*)
6756 # C++ shared libraries reported to be fairly broken before
6757 # switch to ELF
6758 _LT_TAGVAR(ld_shlibs, $1)=no
6759 ;;
6760
6761 freebsd-elf*)
6762 _LT_TAGVAR(archive_cmds_need_lc, $1)=no
6763 ;;
6764
6765 freebsd* | dragonfly*)
6766 # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
6767 # conventions
6768 _LT_TAGVAR(ld_shlibs, $1)=yes
6769 ;;
6770
6771 haiku*)
6772 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
6773 _LT_TAGVAR(link_all_deplibs, $1)=yes
6774 ;;
6775
6776 hpux9*)
6777 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
6778 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6779 _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
6780 _LT_TAGVAR(hardcode_direct, $1)=yes
6781 _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
6782 # but as the default
6783 # location of the library.
6784
6785 case $cc_basename in
6786 CC*)
6787 # FIXME: insert proper C++ library support
6788 _LT_TAGVAR(ld_shlibs, $1)=no
6789 ;;
6790 aCC*)
6791 _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
6792 # Commands to make compiler produce verbose output that lists
6793 # what "hidden" libraries, object files and flags are used when
6794 # linking a shared library.
6795 #
6796 # There doesn't appear to be a way to prevent this compiler from
6797 # explicitly linking system object files so we need to strip them
6798 # from the output so that they don't get included in the library
6799 # dependencies.
6800 output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
6801 ;;
6802 *)
6803 if test yes = "$GXX"; then
6804 _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
6805 else
6806 # FIXME: insert proper C++ library support
6807 _LT_TAGVAR(ld_shlibs, $1)=no
6808 fi
6809 ;;
6810 esac
6811 ;;
6812
6813 hpux10*|hpux11*)
6814 if test no = "$with_gnu_ld"; then
6815 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
6816 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6817
6818 case $host_cpu in
6819 hppa*64*|ia64*)
6820 ;;
6821 *)
6822 _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
6823 ;;
6824 esac
6825 fi
6826 case $host_cpu in
6827 hppa*64*|ia64*)
6828 _LT_TAGVAR(hardcode_direct, $1)=no
6829 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6830 ;;
6831 *)
6832 _LT_TAGVAR(hardcode_direct, $1)=yes
6833 _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
6834 _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
6835 # but as the default
6836 # location of the library.
6837 ;;
6838 esac
6839
6840 case $cc_basename in
6841 CC*)
6842 # FIXME: insert proper C++ library support
6843 _LT_TAGVAR(ld_shlibs, $1)=no
6844 ;;
6845 aCC*)
6846 case $host_cpu in
6847 hppa*64*)
6848 _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6849 ;;
6850 ia64*)
6851 _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6852 ;;
6853 *)
6854 _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6855 ;;
6856 esac
6857 # Commands to make compiler produce verbose output that lists
6858 # what "hidden" libraries, object files and flags are used when
6859 # linking a shared library.
6860 #
6861 # There doesn't appear to be a way to prevent this compiler from
6862 # explicitly linking system object files so we need to strip them
6863 # from the output so that they don't get included in the library
6864 # dependencies.
6865 output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
6866 ;;
6867 *)
6868 if test yes = "$GXX"; then
6869 if test no = "$with_gnu_ld"; then
6870 case $host_cpu in
6871 hppa*64*)
6872 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6873 ;;
6874 ia64*)
6875 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6876 ;;
6877 *)
6878 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6879 ;;
6880 esac
6881 fi
6882 else
6883 # FIXME: insert proper C++ library support
6884 _LT_TAGVAR(ld_shlibs, $1)=no
6885 fi
6886 ;;
6887 esac
6888 ;;
6889
6890 interix[[3-9]]*)
6891 _LT_TAGVAR(hardcode_direct, $1)=no
6892 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6893 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
6894 _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
6895 # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
6896 # Instead, shared libraries are loaded at an image base (0x10000000 by
6897 # default) and relocated if they conflict, which is a slow very memory
6898 # consuming and fragmenting process. To avoid this, we pick a random,
6899 # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
6900 # time. Moving up from 0x10000000 also allows more sbrk(2) space.
6901 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
6902 _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
6903 ;;
6904 irix5* | irix6*)
6905 case $cc_basename in
6906 CC*)
6907 # SGI C++
6908 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
6909
6910 # Archives containing C++ object files must be created using
6911 # "CC -ar", where "CC" is the IRIX C++ compiler. This is
6912 # necessary to make sure instantiated templates are included
6913 # in the archive.
6914 _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
6915 ;;
6916 *)
6917 if test yes = "$GXX"; then
6918 if test no = "$with_gnu_ld"; then
6919 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
6920 else
6921 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` -o $lib'
6922 fi
6923 fi
6924 _LT_TAGVAR(link_all_deplibs, $1)=yes
6925 ;;
6926 esac
6927 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
6928 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6929 _LT_TAGVAR(inherit_rpath, $1)=yes
6930 ;;
6931
6932 linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
6933 case $cc_basename in
6934 KCC*)
6935 # Kuck and Associates, Inc. (KAI) C++ Compiler
6936
6937 # KCC will only create a shared library if the output file
6938 # ends with ".so" (or ".sl" for HP-UX), so rename the library
6939 # to its proper name (with version) after linking.
6940 _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
6941 _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib $wl-retain-symbols-file,$export_symbols; mv \$templib $lib'
6942 # Commands to make compiler produce verbose output that lists
6943 # what "hidden" libraries, object files and flags are used when
6944 # linking a shared library.
6945 #
6946 # There doesn't appear to be a way to prevent this compiler from
6947 # explicitly linking system object files so we need to strip them
6948 # from the output so that they don't get included in the library
6949 # dependencies.
6950 output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
6951
6952 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
6953 _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
6954
6955 # Archives containing C++ object files must be created using
6956 # "CC -Bstatic", where "CC" is the KAI C++ compiler.
6957 _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
6958 ;;
6959 icpc* | ecpc* )
6960 # Intel C++
6961 with_gnu_ld=yes
6962 # version 8.0 and above of icpc choke on multiply defined symbols
6963 # if we add $predep_objects and $postdep_objects, however 7.1 and
6964 # earlier do not add the objects themselves.
6965 case `$CC -V 2>&1` in
6966 *"Version 7."*)
6967 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
6968 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
6969 ;;
6970 *) # Version 8.0 or newer
6971 tmp_idyn=
6972 case $host_cpu in
6973 ia64*) tmp_idyn=' -i_dynamic';;
6974 esac
6975 _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
6976 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
6977 ;;
6978 esac
6979 _LT_TAGVAR(archive_cmds_need_lc, $1)=no
6980 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
6981 _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
6982 _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
6983 ;;
6984 pgCC* | pgcpp*)
6985 # Portland Group C++ compiler
6986 case `$CC -V` in
6987 *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*)
6988 _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
6989 rm -rf $tpldir~
6990 $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
6991 compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
6992 _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
6993 rm -rf $tpldir~
6994 $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
6995 $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
6996 $RANLIB $oldlib'
6997 _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
6998 rm -rf $tpldir~
6999 $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
7000 $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
7001 _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
7002 rm -rf $tpldir~
7003 $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
7004 $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
7005 ;;
7006 *) # Version 6 and above use weak symbols
7007 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
7008 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
7009 ;;
7010 esac
7011
7012 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl--rpath $wl$libdir'
7013 _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
7014 _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
7015 ;;
7016 cxx*)
7017 # Compaq C++
7018 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
7019 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib $wl-retain-symbols-file $wl$export_symbols'
7020
7021 runpath_var=LD_RUN_PATH
7022 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
7023 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7024
7025 # Commands to make compiler produce verbose output that lists
7026 # what "hidden" libraries, object files and flags are used when
7027 # linking a shared library.
7028 #
7029 # There doesn't appear to be a way to prevent this compiler from
7030 # explicitly linking system object files so we need to strip them
7031 # from the output so that they don't get included in the library
7032 # dependencies.
7033 output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed'
7034 ;;
7035 xl* | mpixl* | bgxl*)
7036 # IBM XL 8.0 on PPC, with GNU ld
7037 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
7038 _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
7039 _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
7040 if test yes = "$supports_anon_versioning"; then
7041 _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
7042 cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
7043 echo "local: *; };" >> $output_objdir/$libname.ver~
7044 $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
7045 fi
7046 ;;
7047 *)
7048 case `$CC -V 2>&1 | sed 5q` in
7049 *Sun\ C*)
7050 # Sun C++ 5.9
7051 _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
7052 _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
7053 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file $wl$export_symbols'
7054 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
7055 _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
7056 _LT_TAGVAR(compiler_needs_object, $1)=yes
7057
7058 # Not sure whether something based on
7059 # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
7060 # would be better.
7061 output_verbose_link_cmd='func_echo_all'
7062
7063 # Archives containing C++ object files must be created using
7064 # "CC -xar", where "CC" is the Sun C++ compiler. This is
7065 # necessary to make sure instantiated templates are included
7066 # in the archive.
7067 _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
7068 ;;
7069 esac
7070 ;;
7071 esac
7072 ;;
7073
7074 lynxos*)
7075 # FIXME: insert proper C++ library support
7076 _LT_TAGVAR(ld_shlibs, $1)=no
7077 ;;
7078
7079 m88k*)
7080 # FIXME: insert proper C++ library support
7081 _LT_TAGVAR(ld_shlibs, $1)=no
7082 ;;
7083
7084 mvs*)
7085 case $cc_basename in
7086 cxx*)
7087 # FIXME: insert proper C++ library support
7088 _LT_TAGVAR(ld_shlibs, $1)=no
7089 ;;
7090 *)
7091 # FIXME: insert proper C++ library support
7092 _LT_TAGVAR(ld_shlibs, $1)=no
7093 ;;
7094 esac
7095 ;;
7096
7097 netbsd*)
7098 if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
7099 _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
7100 wlarc=
7101 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
7102 _LT_TAGVAR(hardcode_direct, $1)=yes
7103 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7104 fi
7105 # Workaround some broken pre-1.5 toolchains
7106 output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
7107 ;;
7108
7109 *nto* | *qnx*)
7110 _LT_TAGVAR(ld_shlibs, $1)=yes
7111 ;;
7112
7113 openbsd* | bitrig*)
7114 if test -f /usr/libexec/ld.so; then
7115 _LT_TAGVAR(hardcode_direct, $1)=yes
7116 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7117 _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
7118 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
7119 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
7120 if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`"; then
7121 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file,$export_symbols -o $lib'
7122 _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
7123 _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
7124 fi
7125 output_verbose_link_cmd=func_echo_all
7126 else
7127 _LT_TAGVAR(ld_shlibs, $1)=no
7128 fi
7129 ;;
7130
7131 osf3* | osf4* | osf5*)
7132 case $cc_basename in
7133 KCC*)
7134 # Kuck and Associates, Inc. (KAI) C++ Compiler
7135
7136 # KCC will only create a shared library if the output file
7137 # ends with ".so" (or ".sl" for HP-UX), so rename the library
7138 # to its proper name (with version) after linking.
7139 _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
7140
7141 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
7142 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7143
7144 # Archives containing C++ object files must be created using
7145 # the KAI C++ compiler.
7146 case $host in
7147 osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
7148 *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
7149 esac
7150 ;;
7151 RCC*)
7152 # Rational C++ 2.4.1
7153 # FIXME: insert proper C++ library support
7154 _LT_TAGVAR(ld_shlibs, $1)=no
7155 ;;
7156 cxx*)
7157 case $host in
7158 osf3*)
7159 _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
7160 _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $soname `test -n "$verstring" && func_echo_all "$wl-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
7161 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
7162 ;;
7163 *)
7164 _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
7165 _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
7166 _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
7167 echo "-hidden">> $lib.exp~
7168 $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname $wl-input $wl$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~
7169 $RM $lib.exp'
7170 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
7171 ;;
7172 esac
7173
7174 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7175
7176 # Commands to make compiler produce verbose output that lists
7177 # what "hidden" libraries, object files and flags are used when
7178 # linking a shared library.
7179 #
7180 # There doesn't appear to be a way to prevent this compiler from
7181 # explicitly linking system object files so we need to strip them
7182 # from the output so that they don't get included in the library
7183 # dependencies.
7184 output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
7185 ;;
7186 *)
7187 if test yes,no = "$GXX,$with_gnu_ld"; then
7188 _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
7189 case $host in
7190 osf3*)
7191 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
7192 ;;
7193 *)
7194 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
7195 ;;
7196 esac
7197
7198 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
7199 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7200
7201 # Commands to make compiler produce verbose output that lists
7202 # what "hidden" libraries, object files and flags are used when
7203 # linking a shared library.
7204 output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
7205
7206 else
7207 # FIXME: insert proper C++ library support
7208 _LT_TAGVAR(ld_shlibs, $1)=no
7209 fi
7210 ;;
7211 esac
7212 ;;
7213
7214 psos*)
7215 # FIXME: insert proper C++ library support
7216 _LT_TAGVAR(ld_shlibs, $1)=no
7217 ;;
7218
7219 sunos4*)
7220 case $cc_basename in
7221 CC*)
7222 # Sun C++ 4.x
7223 # FIXME: insert proper C++ library support
7224 _LT_TAGVAR(ld_shlibs, $1)=no
7225 ;;
7226 lcc*)
7227 # Lucid
7228 # FIXME: insert proper C++ library support
7229 _LT_TAGVAR(ld_shlibs, $1)=no
7230 ;;
7231 *)
7232 # FIXME: insert proper C++ library support
7233 _LT_TAGVAR(ld_shlibs, $1)=no
7234 ;;
7235 esac
7236 ;;
7237
7238 solaris*)
7239 case $cc_basename in
7240 CC* | sunCC*)
7241 # Sun C++ 4.2, 5.x and Centerline C++
7242 _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
7243 _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
7244 _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
7245 _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
7246 $CC -G$allow_undefined_flag $wl-M $wl$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
7247
7248 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
7249 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7250 case $host_os in
7251 solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
7252 *)
7253 # The compiler driver will combine and reorder linker options,
7254 # but understands '-z linker_flag'.
7255 # Supported since Solaris 2.6 (maybe 2.5.1?)
7256 _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
7257 ;;
7258 esac
7259 _LT_TAGVAR(link_all_deplibs, $1)=yes
7260
7261 output_verbose_link_cmd='func_echo_all'
7262
7263 # Archives containing C++ object files must be created using
7264 # "CC -xar", where "CC" is the Sun C++ compiler. This is
7265 # necessary to make sure instantiated templates are included
7266 # in the archive.
7267 _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
7268 ;;
7269 gcx*)
7270 # Green Hills C++ Compiler
7271 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
7272
7273 # The C++ compiler must be used to create the archive.
7274 _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
7275 ;;
7276 *)
7277 # GNU C++ compiler with Solaris linker
7278 if test yes,no = "$GXX,$with_gnu_ld"; then
7279 _LT_TAGVAR(no_undefined_flag, $1)=' $wl-z ${wl}defs'
7280 if $CC --version | $GREP -v '^2\.7' > /dev/null; then
7281 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
7282 _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
7283 $CC -shared $pic_flag -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
7284
7285 # Commands to make compiler produce verbose output that lists
7286 # what "hidden" libraries, object files and flags are used when
7287 # linking a shared library.
7288 output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
7289 else
7290 # g++ 2.7 appears to require '-G' NOT '-shared' on this
7291 # platform.
7292 _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
7293 _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
7294 $CC -G -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
7295
7296 # Commands to make compiler produce verbose output that lists
7297 # what "hidden" libraries, object files and flags are used when
7298 # linking a shared library.
7299 output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
7300 fi
7301
7302 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $wl$libdir'
7303 case $host_os in
7304 solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
7305 *)
7306 _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract'
7307 ;;
7308 esac
7309 fi
7310 ;;
7311 esac
7312 ;;
7313
7314 sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
7315 _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
7316 _LT_TAGVAR(archive_cmds_need_lc, $1)=no
7317 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7318 runpath_var='LD_RUN_PATH'
7319
7320 case $cc_basename in
7321 CC*)
7322 _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7323 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7324 ;;
7325 *)
7326 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7327 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7328 ;;
7329 esac
7330 ;;
7331
7332 sysv5* | sco3.2v5* | sco5v6*)
7333 # Note: We CANNOT use -z defs as we might desire, because we do not
7334 # link with -lc, and that would cause any symbols used from libc to
7335 # always be unresolved, which means just about no library would
7336 # ever link correctly. If we're not using GNU ld we use -z text
7337 # though, which does catch some bad symbols but isn't as heavy-handed
7338 # as -z defs.
7339 _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
7340 _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs'
7341 _LT_TAGVAR(archive_cmds_need_lc, $1)=no
7342 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7343 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir'
7344 _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
7345 _LT_TAGVAR(link_all_deplibs, $1)=yes
7346 _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport'
7347 runpath_var='LD_RUN_PATH'
7348
7349 case $cc_basename in
7350 CC*)
7351 _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7352 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7353 _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~
7354 '"$_LT_TAGVAR(old_archive_cmds, $1)"
7355 _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~
7356 '"$_LT_TAGVAR(reload_cmds, $1)"
7357 ;;
7358 *)
7359 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7360 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7361 ;;
7362 esac
7363 ;;
7364
7365 tandem*)
7366 case $cc_basename in
7367 NCC*)
7368 # NonStop-UX NCC 3.20
7369 # FIXME: insert proper C++ library support
7370 _LT_TAGVAR(ld_shlibs, $1)=no
7371 ;;
7372 *)
7373 # FIXME: insert proper C++ library support
7374 _LT_TAGVAR(ld_shlibs, $1)=no
7375 ;;
7376 esac
7377 ;;
7378
7379 vxworks*)
7380 # FIXME: insert proper C++ library support
7381 _LT_TAGVAR(ld_shlibs, $1)=no
7382 ;;
7383
7384 *)
7385 # FIXME: insert proper C++ library support
7386 _LT_TAGVAR(ld_shlibs, $1)=no
7387 ;;
7388 esac
7389
7390 AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
7391 test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no
7392
7393 _LT_TAGVAR(GCC, $1)=$GXX
7394 _LT_TAGVAR(LD, $1)=$LD
7395
7396 ## CAVEAT EMPTOR:
7397 ## There is no encapsulation within the following macros, do not change
7398 ## the running order or otherwise move them around unless you know exactly
7399 ## what you are doing...
7400 _LT_SYS_HIDDEN_LIBDEPS($1)
7401 _LT_COMPILER_PIC($1)
7402 _LT_COMPILER_C_O($1)
7403 _LT_COMPILER_FILE_LOCKS($1)
7404 _LT_LINKER_SHLIBS($1)
7405 _LT_SYS_DYNAMIC_LINKER($1)
7406 _LT_LINKER_HARDCODE_LIBPATH($1)
7407
7408 _LT_CONFIG($1)
7409 fi # test -n "$compiler"
7410
7411 CC=$lt_save_CC
7412 CFLAGS=$lt_save_CFLAGS
7413 LDCXX=$LD
7414 LD=$lt_save_LD
7415 GCC=$lt_save_GCC
7416 with_gnu_ld=$lt_save_with_gnu_ld
7417 lt_cv_path_LDCXX=$lt_cv_path_LD
7418 lt_cv_path_LD=$lt_save_path_LD
7419 lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
7420 lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
7421 fi # test yes != "$_lt_caught_CXX_error"
7422
7423 AC_LANG_POP
7424 ])# _LT_LANG_CXX_CONFIG
7425
7426
7427 # _LT_FUNC_STRIPNAME_CNF
7428 # ----------------------
7429 # func_stripname_cnf prefix suffix name
7430 # strip PREFIX and SUFFIX off of NAME.
7431 # PREFIX and SUFFIX must not contain globbing or regex special
7432 # characters, hashes, percent signs, but SUFFIX may contain a leading
7433 # dot (in which case that matches only a dot).
7434 #
7435 # This function is identical to the (non-XSI) version of func_stripname,
7436 # except this one can be used by m4 code that may be executed by configure,
7437 # rather than the libtool script.
7438 m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl
7439 AC_REQUIRE([_LT_DECL_SED])
7440 AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])
7441 func_stripname_cnf ()
7442 {
7443 case @S|@2 in
7444 .*) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%\\\\@S|@2\$%%"`;;
7445 *) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%@S|@2\$%%"`;;
7446 esac
7447 } # func_stripname_cnf
7448 ])# _LT_FUNC_STRIPNAME_CNF
7449
7450
7451 # _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
7452 # ---------------------------------
7453 # Figure out "hidden" library dependencies from verbose
7454 # compiler output when linking a shared library.
7455 # Parse the compiler output and extract the necessary
7456 # objects, libraries and library flags.
7457 m4_defun([_LT_SYS_HIDDEN_LIBDEPS],
7458 [m4_require([_LT_FILEUTILS_DEFAULTS])dnl
7459 AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl
7460 # Dependencies to place before and after the object being linked:
7461 _LT_TAGVAR(predep_objects, $1)=
7462 _LT_TAGVAR(postdep_objects, $1)=
7463 _LT_TAGVAR(predeps, $1)=
7464 _LT_TAGVAR(postdeps, $1)=
7465 _LT_TAGVAR(compiler_lib_search_path, $1)=
7466
7467 dnl we can't use the lt_simple_compile_test_code here,
7468 dnl because it contains code intended for an executable,
7469 dnl not a library. It's possible we should let each
7470 dnl tag define a new lt_????_link_test_code variable,
7471 dnl but it's only used here...
7472 m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
7473 int a;
7474 void foo (void) { a = 0; }
7475 _LT_EOF
7476 ], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
7477 class Foo
7478 {
7479 public:
7480 Foo (void) { a = 0; }
7481 private:
7482 int a;
7483 };
7484 _LT_EOF
7485 ], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
7486 subroutine foo
7487 implicit none
7488 integer*4 a
7489 a=0
7490 return
7491 end
7492 _LT_EOF
7493 ], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
7494 subroutine foo
7495 implicit none
7496 integer a
7497 a=0
7498 return
7499 end
7500 _LT_EOF
7501 ], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
7502 public class foo {
7503 private int a;
7504 public void bar (void) {
7505 a = 0;
7506 }
7507 };
7508 _LT_EOF
7509 ], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF
7510 package foo
7511 func foo() {
7512 }
7513 _LT_EOF
7514 ])
7515
7516 _lt_libdeps_save_CFLAGS=$CFLAGS
7517 case "$CC $CFLAGS " in #(
7518 *\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
7519 *\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
7520 *\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;;
7521 esac
7522
7523 dnl Parse the compiler output and extract the necessary
7524 dnl objects, libraries and library flags.
7525 if AC_TRY_EVAL(ac_compile); then
7526 # Parse the compiler output and extract the necessary
7527 # objects, libraries and library flags.
7528
7529 # Sentinel used to keep track of whether or not we are before
7530 # the conftest object file.
7531 pre_test_object_deps_done=no
7532
7533 for p in `eval "$output_verbose_link_cmd"`; do
7534 case $prev$p in
7535
7536 -L* | -R* | -l*)
7537 # Some compilers place space between "-{L,R}" and the path.
7538 # Remove the space.
7539 if test x-L = "$p" ||
7540 test x-R = "$p"; then
7541 prev=$p
7542 continue
7543 fi
7544
7545 # Expand the sysroot to ease extracting the directories later.
7546 if test -z "$prev"; then
7547 case $p in
7548 -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
7549 -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
7550 -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
7551 esac
7552 fi
7553 case $p in
7554 =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
7555 esac
7556 if test no = "$pre_test_object_deps_done"; then
7557 case $prev in
7558 -L | -R)
7559 # Internal compiler library paths should come after those
7560 # provided the user. The postdeps already come after the
7561 # user supplied libs so there is no need to process them.
7562 if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
7563 _LT_TAGVAR(compiler_lib_search_path, $1)=$prev$p
7564 else
7565 _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} $prev$p"
7566 fi
7567 ;;
7568 # The "-l" case would never come before the object being
7569 # linked, so don't bother handling this case.
7570 esac
7571 else
7572 if test -z "$_LT_TAGVAR(postdeps, $1)"; then
7573 _LT_TAGVAR(postdeps, $1)=$prev$p
7574 else
7575 _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} $prev$p"
7576 fi
7577 fi
7578 prev=
7579 ;;
7580
7581 *.lto.$objext) ;; # Ignore GCC LTO objects
7582 *.$objext)
7583 # This assumes that the test object file only shows up
7584 # once in the compiler output.
7585 if test "$p" = "conftest.$objext"; then
7586 pre_test_object_deps_done=yes
7587 continue
7588 fi
7589
7590 if test no = "$pre_test_object_deps_done"; then
7591 if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
7592 _LT_TAGVAR(predep_objects, $1)=$p
7593 else
7594 _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
7595 fi
7596 else
7597 if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
7598 _LT_TAGVAR(postdep_objects, $1)=$p
7599 else
7600 _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
7601 fi
7602 fi
7603 ;;
7604
7605 *) ;; # Ignore the rest.
7606
7607 esac
7608 done
7609
7610 # Clean up.
7611 rm -f a.out a.exe
7612 else
7613 echo "libtool.m4: error: problem compiling $1 test program"
7614 fi
7615
7616 $RM -f confest.$objext
7617 CFLAGS=$_lt_libdeps_save_CFLAGS
7618
7619 # PORTME: override above test on systems where it is broken
7620 m4_if([$1], [CXX],
7621 [case $host_os in
7622 interix[[3-9]]*)
7623 # Interix 3.5 installs completely hosed .la files for C++, so rather than
7624 # hack all around it, let's just trust "g++" to DTRT.
7625 _LT_TAGVAR(predep_objects,$1)=
7626 _LT_TAGVAR(postdep_objects,$1)=
7627 _LT_TAGVAR(postdeps,$1)=
7628 ;;
7629 esac
7630 ])
7631
7632 case " $_LT_TAGVAR(postdeps, $1) " in
7633 *" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
7634 esac
7635 _LT_TAGVAR(compiler_lib_search_dirs, $1)=
7636 if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
7637 _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | $SED -e 's! -L! !g' -e 's!^ !!'`
7638 fi
7639 _LT_TAGDECL([], [compiler_lib_search_dirs], [1],
7640 [The directories searched by this compiler when creating a shared library])
7641 _LT_TAGDECL([], [predep_objects], [1],
7642 [Dependencies to place before and after the objects being linked to
7643 create a shared library])
7644 _LT_TAGDECL([], [postdep_objects], [1])
7645 _LT_TAGDECL([], [predeps], [1])
7646 _LT_TAGDECL([], [postdeps], [1])
7647 _LT_TAGDECL([], [compiler_lib_search_path], [1],
7648 [The library search path used internally by the compiler when linking
7649 a shared library])
7650 ])# _LT_SYS_HIDDEN_LIBDEPS
7651
7652
7653 # _LT_LANG_F77_CONFIG([TAG])
7654 # --------------------------
7655 # Ensure that the configuration variables for a Fortran 77 compiler are
7656 # suitably defined. These variables are subsequently used by _LT_CONFIG
7657 # to write the compiler configuration to 'libtool'.
7658 m4_defun([_LT_LANG_F77_CONFIG],
7659 [AC_LANG_PUSH(Fortran 77)
7660 if test -z "$F77" || test no = "$F77"; then
7661 _lt_disable_F77=yes
7662 fi
7663
7664 _LT_TAGVAR(archive_cmds_need_lc, $1)=no
7665 _LT_TAGVAR(allow_undefined_flag, $1)=
7666 _LT_TAGVAR(always_export_symbols, $1)=no
7667 _LT_TAGVAR(archive_expsym_cmds, $1)=
7668 _LT_TAGVAR(export_dynamic_flag_spec, $1)=
7669 _LT_TAGVAR(hardcode_direct, $1)=no
7670 _LT_TAGVAR(hardcode_direct_absolute, $1)=no
7671 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
7672 _LT_TAGVAR(hardcode_libdir_separator, $1)=
7673 _LT_TAGVAR(hardcode_minus_L, $1)=no
7674 _LT_TAGVAR(hardcode_automatic, $1)=no
7675 _LT_TAGVAR(inherit_rpath, $1)=no
7676 _LT_TAGVAR(module_cmds, $1)=
7677 _LT_TAGVAR(module_expsym_cmds, $1)=
7678 _LT_TAGVAR(link_all_deplibs, $1)=unknown
7679 _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
7680 _LT_TAGVAR(reload_flag, $1)=$reload_flag
7681 _LT_TAGVAR(reload_cmds, $1)=$reload_cmds
7682 _LT_TAGVAR(no_undefined_flag, $1)=
7683 _LT_TAGVAR(whole_archive_flag_spec, $1)=
7684 _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
7685
7686 # Source file extension for f77 test sources.
7687 ac_ext=f
7688
7689 # Object file extension for compiled f77 test sources.
7690 objext=o
7691 _LT_TAGVAR(objext, $1)=$objext
7692
7693 # No sense in running all these tests if we already determined that
7694 # the F77 compiler isn't working. Some variables (like enable_shared)
7695 # are currently assumed to apply to all compilers on this platform,
7696 # and will be corrupted by setting them based on a non-working compiler.
7697 if test yes != "$_lt_disable_F77"; then
7698 # Code to be used in simple compile tests
7699 lt_simple_compile_test_code="\
7700 subroutine t
7701 return
7702 end
7703 "
7704
7705 # Code to be used in simple link tests
7706 lt_simple_link_test_code="\
7707 program t
7708 end
7709 "
7710
7711 # ltmain only uses $CC for tagged configurations so make sure $CC is set.
7712 _LT_TAG_COMPILER
7713
7714 # save warnings/boilerplate of simple test code
7715 _LT_COMPILER_BOILERPLATE
7716 _LT_LINKER_BOILERPLATE
7717
7718 # Allow CC to be a program name with arguments.
7719 lt_save_CC=$CC
7720 lt_save_GCC=$GCC
7721 lt_save_CFLAGS=$CFLAGS
7722 CC=${F77-"f77"}
7723 CFLAGS=$FFLAGS
7724 compiler=$CC
7725 _LT_TAGVAR(compiler, $1)=$CC
7726 _LT_CC_BASENAME([$compiler])
7727 GCC=$G77
7728 if test -n "$compiler"; then
7729 AC_MSG_CHECKING([if libtool supports shared libraries])
7730 AC_MSG_RESULT([$can_build_shared])
7731
7732 AC_MSG_CHECKING([whether to build shared libraries])
7733 test no = "$can_build_shared" && enable_shared=no
7734
7735 # On AIX, shared libraries and static libraries use the same namespace, and
7736 # are all built from PIC.
7737 case $host_os in
7738 aix3*)
7739 test yes = "$enable_shared" && enable_static=no
7740 if test -n "$RANLIB"; then
7741 archive_cmds="$archive_cmds~\$RANLIB \$lib"
7742 postinstall_cmds='$RANLIB $lib'
7743 fi
7744 ;;
7745 aix[[4-9]]*)
7746 if test ia64 != "$host_cpu"; then
7747 case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
7748 yes,aix,yes) ;; # shared object as lib.so file only
7749 yes,svr4,*) ;; # shared object as lib.so archive member only
7750 yes,*) enable_static=no ;; # shared object in lib.a archive as well
7751 esac
7752 fi
7753 ;;
7754 esac
7755 AC_MSG_RESULT([$enable_shared])
7756
7757 AC_MSG_CHECKING([whether to build static libraries])
7758 # Make sure either enable_shared or enable_static is yes.
7759 test yes = "$enable_shared" || enable_static=yes
7760 AC_MSG_RESULT([$enable_static])
7761
7762 _LT_TAGVAR(GCC, $1)=$G77
7763 _LT_TAGVAR(LD, $1)=$LD
7764
7765 ## CAVEAT EMPTOR:
7766 ## There is no encapsulation within the following macros, do not change
7767 ## the running order or otherwise move them around unless you know exactly
7768 ## what you are doing...
7769 _LT_COMPILER_PIC($1)
7770 _LT_COMPILER_C_O($1)
7771 _LT_COMPILER_FILE_LOCKS($1)
7772 _LT_LINKER_SHLIBS($1)
7773 _LT_SYS_DYNAMIC_LINKER($1)
7774 _LT_LINKER_HARDCODE_LIBPATH($1)
7775
7776 _LT_CONFIG($1)
7777 fi # test -n "$compiler"
7778
7779 GCC=$lt_save_GCC
7780 CC=$lt_save_CC
7781 CFLAGS=$lt_save_CFLAGS
7782 fi # test yes != "$_lt_disable_F77"
7783
7784 AC_LANG_POP
7785 ])# _LT_LANG_F77_CONFIG
7786
7787
7788 # _LT_LANG_FC_CONFIG([TAG])
7789 # -------------------------
7790 # Ensure that the configuration variables for a Fortran compiler are
7791 # suitably defined. These variables are subsequently used by _LT_CONFIG
7792 # to write the compiler configuration to 'libtool'.
7793 m4_defun([_LT_LANG_FC_CONFIG],
7794 [AC_LANG_PUSH(Fortran)
7795
7796 if test -z "$FC" || test no = "$FC"; then
7797 _lt_disable_FC=yes
7798 fi
7799
7800 _LT_TAGVAR(archive_cmds_need_lc, $1)=no
7801 _LT_TAGVAR(allow_undefined_flag, $1)=
7802 _LT_TAGVAR(always_export_symbols, $1)=no
7803 _LT_TAGVAR(archive_expsym_cmds, $1)=
7804 _LT_TAGVAR(export_dynamic_flag_spec, $1)=
7805 _LT_TAGVAR(hardcode_direct, $1)=no
7806 _LT_TAGVAR(hardcode_direct_absolute, $1)=no
7807 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
7808 _LT_TAGVAR(hardcode_libdir_separator, $1)=
7809 _LT_TAGVAR(hardcode_minus_L, $1)=no
7810 _LT_TAGVAR(hardcode_automatic, $1)=no
7811 _LT_TAGVAR(inherit_rpath, $1)=no
7812 _LT_TAGVAR(module_cmds, $1)=
7813 _LT_TAGVAR(module_expsym_cmds, $1)=
7814 _LT_TAGVAR(link_all_deplibs, $1)=unknown
7815 _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
7816 _LT_TAGVAR(reload_flag, $1)=$reload_flag
7817 _LT_TAGVAR(reload_cmds, $1)=$reload_cmds
7818 _LT_TAGVAR(no_undefined_flag, $1)=
7819 _LT_TAGVAR(whole_archive_flag_spec, $1)=
7820 _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
7821
7822 # Source file extension for fc test sources.
7823 ac_ext=${ac_fc_srcext-f}
7824
7825 # Object file extension for compiled fc test sources.
7826 objext=o
7827 _LT_TAGVAR(objext, $1)=$objext
7828
7829 # No sense in running all these tests if we already determined that
7830 # the FC compiler isn't working. Some variables (like enable_shared)
7831 # are currently assumed to apply to all compilers on this platform,
7832 # and will be corrupted by setting them based on a non-working compiler.
7833 if test yes != "$_lt_disable_FC"; then
7834 # Code to be used in simple compile tests
7835 lt_simple_compile_test_code="\
7836 subroutine t
7837 return
7838 end
7839 "
7840
7841 # Code to be used in simple link tests
7842 lt_simple_link_test_code="\
7843 program t
7844 end
7845 "
7846
7847 # ltmain only uses $CC for tagged configurations so make sure $CC is set.
7848 _LT_TAG_COMPILER
7849
7850 # save warnings/boilerplate of simple test code
7851 _LT_COMPILER_BOILERPLATE
7852 _LT_LINKER_BOILERPLATE
7853
7854 # Allow CC to be a program name with arguments.
7855 lt_save_CC=$CC
7856 lt_save_GCC=$GCC
7857 lt_save_CFLAGS=$CFLAGS
7858 CC=${FC-"f95"}
7859 CFLAGS=$FCFLAGS
7860 compiler=$CC
7861 GCC=$ac_cv_fc_compiler_gnu
7862
7863 _LT_TAGVAR(compiler, $1)=$CC
7864 _LT_CC_BASENAME([$compiler])
7865
7866 if test -n "$compiler"; then
7867 AC_MSG_CHECKING([if libtool supports shared libraries])
7868 AC_MSG_RESULT([$can_build_shared])
7869
7870 AC_MSG_CHECKING([whether to build shared libraries])
7871 test no = "$can_build_shared" && enable_shared=no
7872
7873 # On AIX, shared libraries and static libraries use the same namespace, and
7874 # are all built from PIC.
7875 case $host_os in
7876 aix3*)
7877 test yes = "$enable_shared" && enable_static=no
7878 if test -n "$RANLIB"; then
7879 archive_cmds="$archive_cmds~\$RANLIB \$lib"
7880 postinstall_cmds='$RANLIB $lib'
7881 fi
7882 ;;
7883 aix[[4-9]]*)
7884 if test ia64 != "$host_cpu"; then
7885 case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
7886 yes,aix,yes) ;; # shared object as lib.so file only
7887 yes,svr4,*) ;; # shared object as lib.so archive member only
7888 yes,*) enable_static=no ;; # shared object in lib.a archive as well
7889 esac
7890 fi
7891 ;;
7892 esac
7893 AC_MSG_RESULT([$enable_shared])
7894
7895 AC_MSG_CHECKING([whether to build static libraries])
7896 # Make sure either enable_shared or enable_static is yes.
7897 test yes = "$enable_shared" || enable_static=yes
7898 AC_MSG_RESULT([$enable_static])
7899
7900 _LT_TAGVAR(GCC, $1)=$ac_cv_fc_compiler_gnu
7901 _LT_TAGVAR(LD, $1)=$LD
7902
7903 ## CAVEAT EMPTOR:
7904 ## There is no encapsulation within the following macros, do not change
7905 ## the running order or otherwise move them around unless you know exactly
7906 ## what you are doing...
7907 _LT_SYS_HIDDEN_LIBDEPS($1)
7908 _LT_COMPILER_PIC($1)
7909 _LT_COMPILER_C_O($1)
7910 _LT_COMPILER_FILE_LOCKS($1)
7911 _LT_LINKER_SHLIBS($1)
7912 _LT_SYS_DYNAMIC_LINKER($1)
7913 _LT_LINKER_HARDCODE_LIBPATH($1)
7914
7915 _LT_CONFIG($1)
7916 fi # test -n "$compiler"
7917
7918 GCC=$lt_save_GCC
7919 CC=$lt_save_CC
7920 CFLAGS=$lt_save_CFLAGS
7921 fi # test yes != "$_lt_disable_FC"
7922
7923 AC_LANG_POP
7924 ])# _LT_LANG_FC_CONFIG
7925
7926
7927 # _LT_LANG_GCJ_CONFIG([TAG])
7928 # --------------------------
7929 # Ensure that the configuration variables for the GNU Java Compiler compiler
7930 # are suitably defined. These variables are subsequently used by _LT_CONFIG
7931 # to write the compiler configuration to 'libtool'.
7932 m4_defun([_LT_LANG_GCJ_CONFIG],
7933 [AC_REQUIRE([LT_PROG_GCJ])dnl
7934 AC_LANG_SAVE
7935
7936 # Source file extension for Java test sources.
7937 ac_ext=java
7938
7939 # Object file extension for compiled Java test sources.
7940 objext=o
7941 _LT_TAGVAR(objext, $1)=$objext
7942
7943 # Code to be used in simple compile tests
7944 lt_simple_compile_test_code="class foo {}"
7945
7946 # Code to be used in simple link tests
7947 lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
7948
7949 # ltmain only uses $CC for tagged configurations so make sure $CC is set.
7950 _LT_TAG_COMPILER
7951
7952 # save warnings/boilerplate of simple test code
7953 _LT_COMPILER_BOILERPLATE
7954 _LT_LINKER_BOILERPLATE
7955
7956 # Allow CC to be a program name with arguments.
7957 lt_save_CC=$CC
7958 lt_save_CFLAGS=$CFLAGS
7959 lt_save_GCC=$GCC
7960 GCC=yes
7961 CC=${GCJ-"gcj"}
7962 CFLAGS=$GCJFLAGS
7963 compiler=$CC
7964 _LT_TAGVAR(compiler, $1)=$CC
7965 _LT_TAGVAR(LD, $1)=$LD
7966 _LT_CC_BASENAME([$compiler])
7967
7968 # GCJ did not exist at the time GCC didn't implicitly link libc in.
7969 _LT_TAGVAR(archive_cmds_need_lc, $1)=no
7970
7971 _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
7972 _LT_TAGVAR(reload_flag, $1)=$reload_flag
7973 _LT_TAGVAR(reload_cmds, $1)=$reload_cmds
7974
7975 ## CAVEAT EMPTOR:
7976 ## There is no encapsulation within the following macros, do not change
7977 ## the running order or otherwise move them around unless you know exactly
7978 ## what you are doing...
7979 if test -n "$compiler"; then
7980 _LT_COMPILER_NO_RTTI($1)
7981 _LT_COMPILER_PIC($1)
7982 _LT_COMPILER_C_O($1)
7983 _LT_COMPILER_FILE_LOCKS($1)
7984 _LT_LINKER_SHLIBS($1)
7985 _LT_LINKER_HARDCODE_LIBPATH($1)
7986
7987 _LT_CONFIG($1)
7988 fi
7989
7990 AC_LANG_RESTORE
7991
7992 GCC=$lt_save_GCC
7993 CC=$lt_save_CC
7994 CFLAGS=$lt_save_CFLAGS
7995 ])# _LT_LANG_GCJ_CONFIG
7996
7997
7998 # _LT_LANG_GO_CONFIG([TAG])
7999 # --------------------------
8000 # Ensure that the configuration variables for the GNU Go compiler
8001 # are suitably defined. These variables are subsequently used by _LT_CONFIG
8002 # to write the compiler configuration to 'libtool'.
8003 m4_defun([_LT_LANG_GO_CONFIG],
8004 [AC_REQUIRE([LT_PROG_GO])dnl
8005 AC_LANG_SAVE
8006
8007 # Source file extension for Go test sources.
8008 ac_ext=go
8009
8010 # Object file extension for compiled Go test sources.
8011 objext=o
8012 _LT_TAGVAR(objext, $1)=$objext
8013
8014 # Code to be used in simple compile tests
8015 lt_simple_compile_test_code="package main; func main() { }"
8016
8017 # Code to be used in simple link tests
8018 lt_simple_link_test_code='package main; func main() { }'
8019
8020 # ltmain only uses $CC for tagged configurations so make sure $CC is set.
8021 _LT_TAG_COMPILER
8022
8023 # save warnings/boilerplate of simple test code
8024 _LT_COMPILER_BOILERPLATE
8025 _LT_LINKER_BOILERPLATE
8026
8027 # Allow CC to be a program name with arguments.
8028 lt_save_CC=$CC
8029 lt_save_CFLAGS=$CFLAGS
8030 lt_save_GCC=$GCC
8031 GCC=yes
8032 CC=${GOC-"gccgo"}
8033 CFLAGS=$GOFLAGS
8034 compiler=$CC
8035 _LT_TAGVAR(compiler, $1)=$CC
8036 _LT_TAGVAR(LD, $1)=$LD
8037 _LT_CC_BASENAME([$compiler])
8038
8039 # Go did not exist at the time GCC didn't implicitly link libc in.
8040 _LT_TAGVAR(archive_cmds_need_lc, $1)=no
8041
8042 _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
8043 _LT_TAGVAR(reload_flag, $1)=$reload_flag
8044 _LT_TAGVAR(reload_cmds, $1)=$reload_cmds
8045
8046 ## CAVEAT EMPTOR:
8047 ## There is no encapsulation within the following macros, do not change
8048 ## the running order or otherwise move them around unless you know exactly
8049 ## what you are doing...
8050 if test -n "$compiler"; then
8051 _LT_COMPILER_NO_RTTI($1)
8052 _LT_COMPILER_PIC($1)
8053 _LT_COMPILER_C_O($1)
8054 _LT_COMPILER_FILE_LOCKS($1)
8055 _LT_LINKER_SHLIBS($1)
8056 _LT_LINKER_HARDCODE_LIBPATH($1)
8057
8058 _LT_CONFIG($1)
8059 fi
8060
8061 AC_LANG_RESTORE
8062
8063 GCC=$lt_save_GCC
8064 CC=$lt_save_CC
8065 CFLAGS=$lt_save_CFLAGS
8066 ])# _LT_LANG_GO_CONFIG
8067
8068
8069 # _LT_LANG_RC_CONFIG([TAG])
8070 # -------------------------
8071 # Ensure that the configuration variables for the Windows resource compiler
8072 # are suitably defined. These variables are subsequently used by _LT_CONFIG
8073 # to write the compiler configuration to 'libtool'.
8074 m4_defun([_LT_LANG_RC_CONFIG],
8075 [AC_REQUIRE([LT_PROG_RC])dnl
8076 AC_LANG_SAVE
8077
8078 # Source file extension for RC test sources.
8079 ac_ext=rc
8080
8081 # Object file extension for compiled RC test sources.
8082 objext=o
8083 _LT_TAGVAR(objext, $1)=$objext
8084
8085 # Code to be used in simple compile tests
8086 lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
8087
8088 # Code to be used in simple link tests
8089 lt_simple_link_test_code=$lt_simple_compile_test_code
8090
8091 # ltmain only uses $CC for tagged configurations so make sure $CC is set.
8092 _LT_TAG_COMPILER
8093
8094 # save warnings/boilerplate of simple test code
8095 _LT_COMPILER_BOILERPLATE
8096 _LT_LINKER_BOILERPLATE
8097
8098 # Allow CC to be a program name with arguments.
8099 lt_save_CC=$CC
8100 lt_save_CFLAGS=$CFLAGS
8101 lt_save_GCC=$GCC
8102 GCC=
8103 CC=${RC-"windres"}
8104 CFLAGS=
8105 compiler=$CC
8106 _LT_TAGVAR(compiler, $1)=$CC
8107 _LT_CC_BASENAME([$compiler])
8108 _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
8109
8110 if test -n "$compiler"; then
8111 :
8112 _LT_CONFIG($1)
8113 fi
8114
8115 GCC=$lt_save_GCC
8116 AC_LANG_RESTORE
8117 CC=$lt_save_CC
8118 CFLAGS=$lt_save_CFLAGS
8119 ])# _LT_LANG_RC_CONFIG
8120
8121
8122 # LT_PROG_GCJ
8123 # -----------
8124 AC_DEFUN([LT_PROG_GCJ],
8125 [m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
8126 [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
8127 [AC_CHECK_TOOL(GCJ, gcj,)
8128 test set = "${GCJFLAGS+set}" || GCJFLAGS="-g -O2"
8129 AC_SUBST(GCJFLAGS)])])[]dnl
8130 ])
8131
8132 # Old name:
8133 AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
8134 dnl aclocal-1.4 backwards compatibility:
8135 dnl AC_DEFUN([LT_AC_PROG_GCJ], [])
8136
8137
8138 # LT_PROG_GO
8139 # ----------
8140 AC_DEFUN([LT_PROG_GO],
8141 [AC_CHECK_TOOL(GOC, gccgo,)
8142 ])
8143
8144
8145 # LT_PROG_RC
8146 # ----------
8147 AC_DEFUN([LT_PROG_RC],
8148 [AC_CHECK_TOOL(RC, windres,)
8149 ])
8150
8151 # Old name:
8152 AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
8153 dnl aclocal-1.4 backwards compatibility:
8154 dnl AC_DEFUN([LT_AC_PROG_RC], [])
8155
8156
8157 # _LT_DECL_EGREP
8158 # --------------
8159 # If we don't have a new enough Autoconf to choose the best grep
8160 # available, choose the one first in the user's PATH.
8161 m4_defun([_LT_DECL_EGREP],
8162 [AC_REQUIRE([AC_PROG_EGREP])dnl
8163 AC_REQUIRE([AC_PROG_FGREP])dnl
8164 test -z "$GREP" && GREP=grep
8165 _LT_DECL([], [GREP], [1], [A grep program that handles long lines])
8166 _LT_DECL([], [EGREP], [1], [An ERE matcher])
8167 _LT_DECL([], [FGREP], [1], [A literal string matcher])
8168 dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
8169 AC_SUBST([GREP])
8170 ])
8171
8172
8173 # _LT_DECL_OBJDUMP
8174 # --------------
8175 # If we don't have a new enough Autoconf to choose the best objdump
8176 # available, choose the one first in the user's PATH.
8177 m4_defun([_LT_DECL_OBJDUMP],
8178 [AC_CHECK_TOOL(OBJDUMP, objdump, false)
8179 test -z "$OBJDUMP" && OBJDUMP=objdump
8180 _LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
8181 AC_SUBST([OBJDUMP])
8182 ])
8183
8184 # _LT_DECL_DLLTOOL
8185 # ----------------
8186 # Ensure DLLTOOL variable is set.
8187 m4_defun([_LT_DECL_DLLTOOL],
8188 [AC_CHECK_TOOL(DLLTOOL, dlltool, false)
8189 test -z "$DLLTOOL" && DLLTOOL=dlltool
8190 _LT_DECL([], [DLLTOOL], [1], [DLL creation program])
8191 AC_SUBST([DLLTOOL])
8192 ])
8193
8194 # _LT_DECL_SED
8195 # ------------
8196 # Check for a fully-functional sed program, that truncates
8197 # as few characters as possible. Prefer GNU sed if found.
8198 m4_defun([_LT_DECL_SED],
8199 [AC_PROG_SED
8200 test -z "$SED" && SED=sed
8201 Xsed="$SED -e 1s/^X//"
8202 _LT_DECL([], [SED], [1], [A sed program that does not truncate output])
8203 _LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
8204 [Sed that helps us avoid accidentally triggering echo(1) options like -n])
8205 ])# _LT_DECL_SED
8206
8207 m4_ifndef([AC_PROG_SED], [
8208 ############################################################
8209 # NOTE: This macro has been submitted for inclusion into #
8210 # GNU Autoconf as AC_PROG_SED. When it is available in #
8211 # a released version of Autoconf we should remove this #
8212 # macro and use it instead. #
8213 ############################################################
8214
8215 m4_defun([AC_PROG_SED],
8216 [AC_MSG_CHECKING([for a sed that does not truncate output])
8217 AC_CACHE_VAL(lt_cv_path_SED,
8218 [# Loop through the user's path and test for sed and gsed.
8219 # Then use that list of sed's as ones to test for truncation.
8220 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
8221 for as_dir in $PATH
8222 do
8223 IFS=$as_save_IFS
8224 test -z "$as_dir" && as_dir=.
8225 for lt_ac_prog in sed gsed; do
8226 for ac_exec_ext in '' $ac_executable_extensions; do
8227 if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
8228 lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
8229 fi
8230 done
8231 done
8232 done
8233 IFS=$as_save_IFS
8234 lt_ac_max=0
8235 lt_ac_count=0
8236 # Add /usr/xpg4/bin/sed as it is typically found on Solaris
8237 # along with /bin/sed that truncates output.
8238 for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
8239 test ! -f "$lt_ac_sed" && continue
8240 cat /dev/null > conftest.in
8241 lt_ac_count=0
8242 echo $ECHO_N "0123456789$ECHO_C" >conftest.in
8243 # Check for GNU sed and select it if it is found.
8244 if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
8245 lt_cv_path_SED=$lt_ac_sed
8246 break
8247 fi
8248 while true; do
8249 cat conftest.in conftest.in >conftest.tmp
8250 mv conftest.tmp conftest.in
8251 cp conftest.in conftest.nl
8252 echo >>conftest.nl
8253 $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
8254 cmp -s conftest.out conftest.nl || break
8255 # 10000 chars as input seems more than enough
8256 test 10 -lt "$lt_ac_count" && break
8257 lt_ac_count=`expr $lt_ac_count + 1`
8258 if test "$lt_ac_count" -gt "$lt_ac_max"; then
8259 lt_ac_max=$lt_ac_count
8260 lt_cv_path_SED=$lt_ac_sed
8261 fi
8262 done
8263 done
8264 ])
8265 SED=$lt_cv_path_SED
8266 AC_SUBST([SED])
8267 AC_MSG_RESULT([$SED])
8268 ])#AC_PROG_SED
8269 ])#m4_ifndef
8270
8271 # Old name:
8272 AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
8273 dnl aclocal-1.4 backwards compatibility:
8274 dnl AC_DEFUN([LT_AC_PROG_SED], [])
8275
8276
8277 # _LT_CHECK_SHELL_FEATURES
8278 # ------------------------
8279 # Find out whether the shell is Bourne or XSI compatible,
8280 # or has some other useful features.
8281 m4_defun([_LT_CHECK_SHELL_FEATURES],
8282 [if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
8283 lt_unset=unset
8284 else
8285 lt_unset=false
8286 fi
8287 _LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
8288
8289 # test EBCDIC or ASCII
8290 case `echo X|tr X '\101'` in
8291 A) # ASCII based system
8292 # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
8293 lt_SP2NL='tr \040 \012'
8294 lt_NL2SP='tr \015\012 \040\040'
8295 ;;
8296 *) # EBCDIC based system
8297 lt_SP2NL='tr \100 \n'
8298 lt_NL2SP='tr \r\n \100\100'
8299 ;;
8300 esac
8301 _LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
8302 _LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
8303 ])# _LT_CHECK_SHELL_FEATURES
8304
8305
8306 # _LT_PATH_CONVERSION_FUNCTIONS
8307 # -----------------------------
8308 # Determine what file name conversion functions should be used by
8309 # func_to_host_file (and, implicitly, by func_to_host_path). These are needed
8310 # for certain cross-compile configurations and native mingw.
8311 m4_defun([_LT_PATH_CONVERSION_FUNCTIONS],
8312 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
8313 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
8314 AC_MSG_CHECKING([how to convert $build file names to $host format])
8315 AC_CACHE_VAL(lt_cv_to_host_file_cmd,
8316 [case $host in
8317 *-*-mingw* )
8318 case $build in
8319 *-*-mingw* ) # actually msys
8320 lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
8321 ;;
8322 *-*-cygwin* )
8323 lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
8324 ;;
8325 * ) # otherwise, assume *nix
8326 lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
8327 ;;
8328 esac
8329 ;;
8330 *-*-cygwin* )
8331 case $build in
8332 *-*-mingw* ) # actually msys
8333 lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
8334 ;;
8335 *-*-cygwin* )
8336 lt_cv_to_host_file_cmd=func_convert_file_noop
8337 ;;
8338 * ) # otherwise, assume *nix
8339 lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
8340 ;;
8341 esac
8342 ;;
8343 * ) # unhandled hosts (and "normal" native builds)
8344 lt_cv_to_host_file_cmd=func_convert_file_noop
8345 ;;
8346 esac
8347 ])
8348 to_host_file_cmd=$lt_cv_to_host_file_cmd
8349 AC_MSG_RESULT([$lt_cv_to_host_file_cmd])
8350 _LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd],
8351 [0], [convert $build file names to $host format])dnl
8352
8353 AC_MSG_CHECKING([how to convert $build file names to toolchain format])
8354 AC_CACHE_VAL(lt_cv_to_tool_file_cmd,
8355 [#assume ordinary cross tools, or native build.
8356 lt_cv_to_tool_file_cmd=func_convert_file_noop
8357 case $host in
8358 *-*-mingw* )
8359 case $build in
8360 *-*-mingw* ) # actually msys
8361 lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
8362 ;;
8363 esac
8364 ;;
8365 esac
8366 ])
8367 to_tool_file_cmd=$lt_cv_to_tool_file_cmd
8368 AC_MSG_RESULT([$lt_cv_to_tool_file_cmd])
8369 _LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd],
8370 [0], [convert $build files to toolchain format])dnl
8371 ])# _LT_PATH_CONVERSION_FUNCTIONS
0 # Helper functions for option handling. -*- Autoconf -*-
1 #
2 # Copyright (C) 2004-2005, 2007-2009, 2011-2015 Free Software
3 # Foundation, Inc.
4 # Written by Gary V. Vaughan, 2004
5 #
6 # This file is free software; the Free Software Foundation gives
7 # unlimited permission to copy and/or distribute it, with or without
8 # modifications, as long as this notice is preserved.
9
10 # serial 8 ltoptions.m4
11
12 # This is to help aclocal find these macros, as it can't see m4_define.
13 AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
14
15
16 # _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
17 # ------------------------------------------
18 m4_define([_LT_MANGLE_OPTION],
19 [[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
20
21
22 # _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
23 # ---------------------------------------
24 # Set option OPTION-NAME for macro MACRO-NAME, and if there is a
25 # matching handler defined, dispatch to it. Other OPTION-NAMEs are
26 # saved as a flag.
27 m4_define([_LT_SET_OPTION],
28 [m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
29 m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
30 _LT_MANGLE_DEFUN([$1], [$2]),
31 [m4_warning([Unknown $1 option '$2'])])[]dnl
32 ])
33
34
35 # _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
36 # ------------------------------------------------------------
37 # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
38 m4_define([_LT_IF_OPTION],
39 [m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
40
41
42 # _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
43 # -------------------------------------------------------
44 # Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
45 # are set.
46 m4_define([_LT_UNLESS_OPTIONS],
47 [m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
48 [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
49 [m4_define([$0_found])])])[]dnl
50 m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
51 ])[]dnl
52 ])
53
54
55 # _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
56 # ----------------------------------------
57 # OPTION-LIST is a space-separated list of Libtool options associated
58 # with MACRO-NAME. If any OPTION has a matching handler declared with
59 # LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
60 # the unknown option and exit.
61 m4_defun([_LT_SET_OPTIONS],
62 [# Set options
63 m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
64 [_LT_SET_OPTION([$1], _LT_Option)])
65
66 m4_if([$1],[LT_INIT],[
67 dnl
68 dnl Simply set some default values (i.e off) if boolean options were not
69 dnl specified:
70 _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
71 ])
72 _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
73 ])
74 dnl
75 dnl If no reference was made to various pairs of opposing options, then
76 dnl we run the default mode handler for the pair. For example, if neither
77 dnl 'shared' nor 'disable-shared' was passed, we enable building of shared
78 dnl archives by default:
79 _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
80 _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
81 _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
82 _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
83 [_LT_ENABLE_FAST_INSTALL])
84 _LT_UNLESS_OPTIONS([LT_INIT], [aix-soname=aix aix-soname=both aix-soname=svr4],
85 [_LT_WITH_AIX_SONAME([aix])])
86 ])
87 ])# _LT_SET_OPTIONS
88
89
90 ## --------------------------------- ##
91 ## Macros to handle LT_INIT options. ##
92 ## --------------------------------- ##
93
94 # _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
95 # -----------------------------------------
96 m4_define([_LT_MANGLE_DEFUN],
97 [[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
98
99
100 # LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
101 # -----------------------------------------------
102 m4_define([LT_OPTION_DEFINE],
103 [m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
104 ])# LT_OPTION_DEFINE
105
106
107 # dlopen
108 # ------
109 LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
110 ])
111
112 AU_DEFUN([AC_LIBTOOL_DLOPEN],
113 [_LT_SET_OPTION([LT_INIT], [dlopen])
114 AC_DIAGNOSE([obsolete],
115 [$0: Remove this warning and the call to _LT_SET_OPTION when you
116 put the 'dlopen' option into LT_INIT's first parameter.])
117 ])
118
119 dnl aclocal-1.4 backwards compatibility:
120 dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
121
122
123 # win32-dll
124 # ---------
125 # Declare package support for building win32 dll's.
126 LT_OPTION_DEFINE([LT_INIT], [win32-dll],
127 [enable_win32_dll=yes
128
129 case $host in
130 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
131 AC_CHECK_TOOL(AS, as, false)
132 AC_CHECK_TOOL(DLLTOOL, dlltool, false)
133 AC_CHECK_TOOL(OBJDUMP, objdump, false)
134 ;;
135 esac
136
137 test -z "$AS" && AS=as
138 _LT_DECL([], [AS], [1], [Assembler program])dnl
139
140 test -z "$DLLTOOL" && DLLTOOL=dlltool
141 _LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl
142
143 test -z "$OBJDUMP" && OBJDUMP=objdump
144 _LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl
145 ])# win32-dll
146
147 AU_DEFUN([AC_LIBTOOL_WIN32_DLL],
148 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
149 _LT_SET_OPTION([LT_INIT], [win32-dll])
150 AC_DIAGNOSE([obsolete],
151 [$0: Remove this warning and the call to _LT_SET_OPTION when you
152 put the 'win32-dll' option into LT_INIT's first parameter.])
153 ])
154
155 dnl aclocal-1.4 backwards compatibility:
156 dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
157
158
159 # _LT_ENABLE_SHARED([DEFAULT])
160 # ----------------------------
161 # implement the --enable-shared flag, and supports the 'shared' and
162 # 'disable-shared' LT_INIT options.
163 # DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'.
164 m4_define([_LT_ENABLE_SHARED],
165 [m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
166 AC_ARG_ENABLE([shared],
167 [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
168 [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
169 [p=${PACKAGE-default}
170 case $enableval in
171 yes) enable_shared=yes ;;
172 no) enable_shared=no ;;
173 *)
174 enable_shared=no
175 # Look at the argument we got. We use all the common list separators.
176 lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
177 for pkg in $enableval; do
178 IFS=$lt_save_ifs
179 if test "X$pkg" = "X$p"; then
180 enable_shared=yes
181 fi
182 done
183 IFS=$lt_save_ifs
184 ;;
185 esac],
186 [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
187
188 _LT_DECL([build_libtool_libs], [enable_shared], [0],
189 [Whether or not to build shared libraries])
190 ])# _LT_ENABLE_SHARED
191
192 LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
193 LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
194
195 # Old names:
196 AC_DEFUN([AC_ENABLE_SHARED],
197 [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
198 ])
199
200 AC_DEFUN([AC_DISABLE_SHARED],
201 [_LT_SET_OPTION([LT_INIT], [disable-shared])
202 ])
203
204 AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
205 AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
206
207 dnl aclocal-1.4 backwards compatibility:
208 dnl AC_DEFUN([AM_ENABLE_SHARED], [])
209 dnl AC_DEFUN([AM_DISABLE_SHARED], [])
210
211
212
213 # _LT_ENABLE_STATIC([DEFAULT])
214 # ----------------------------
215 # implement the --enable-static flag, and support the 'static' and
216 # 'disable-static' LT_INIT options.
217 # DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'.
218 m4_define([_LT_ENABLE_STATIC],
219 [m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
220 AC_ARG_ENABLE([static],
221 [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
222 [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
223 [p=${PACKAGE-default}
224 case $enableval in
225 yes) enable_static=yes ;;
226 no) enable_static=no ;;
227 *)
228 enable_static=no
229 # Look at the argument we got. We use all the common list separators.
230 lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
231 for pkg in $enableval; do
232 IFS=$lt_save_ifs
233 if test "X$pkg" = "X$p"; then
234 enable_static=yes
235 fi
236 done
237 IFS=$lt_save_ifs
238 ;;
239 esac],
240 [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
241
242 _LT_DECL([build_old_libs], [enable_static], [0],
243 [Whether or not to build static libraries])
244 ])# _LT_ENABLE_STATIC
245
246 LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
247 LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
248
249 # Old names:
250 AC_DEFUN([AC_ENABLE_STATIC],
251 [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
252 ])
253
254 AC_DEFUN([AC_DISABLE_STATIC],
255 [_LT_SET_OPTION([LT_INIT], [disable-static])
256 ])
257
258 AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
259 AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
260
261 dnl aclocal-1.4 backwards compatibility:
262 dnl AC_DEFUN([AM_ENABLE_STATIC], [])
263 dnl AC_DEFUN([AM_DISABLE_STATIC], [])
264
265
266
267 # _LT_ENABLE_FAST_INSTALL([DEFAULT])
268 # ----------------------------------
269 # implement the --enable-fast-install flag, and support the 'fast-install'
270 # and 'disable-fast-install' LT_INIT options.
271 # DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'.
272 m4_define([_LT_ENABLE_FAST_INSTALL],
273 [m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
274 AC_ARG_ENABLE([fast-install],
275 [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
276 [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
277 [p=${PACKAGE-default}
278 case $enableval in
279 yes) enable_fast_install=yes ;;
280 no) enable_fast_install=no ;;
281 *)
282 enable_fast_install=no
283 # Look at the argument we got. We use all the common list separators.
284 lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
285 for pkg in $enableval; do
286 IFS=$lt_save_ifs
287 if test "X$pkg" = "X$p"; then
288 enable_fast_install=yes
289 fi
290 done
291 IFS=$lt_save_ifs
292 ;;
293 esac],
294 [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
295
296 _LT_DECL([fast_install], [enable_fast_install], [0],
297 [Whether or not to optimize for fast installation])dnl
298 ])# _LT_ENABLE_FAST_INSTALL
299
300 LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
301 LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
302
303 # Old names:
304 AU_DEFUN([AC_ENABLE_FAST_INSTALL],
305 [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
306 AC_DIAGNOSE([obsolete],
307 [$0: Remove this warning and the call to _LT_SET_OPTION when you put
308 the 'fast-install' option into LT_INIT's first parameter.])
309 ])
310
311 AU_DEFUN([AC_DISABLE_FAST_INSTALL],
312 [_LT_SET_OPTION([LT_INIT], [disable-fast-install])
313 AC_DIAGNOSE([obsolete],
314 [$0: Remove this warning and the call to _LT_SET_OPTION when you put
315 the 'disable-fast-install' option into LT_INIT's first parameter.])
316 ])
317
318 dnl aclocal-1.4 backwards compatibility:
319 dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
320 dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
321
322
323 # _LT_WITH_AIX_SONAME([DEFAULT])
324 # ----------------------------------
325 # implement the --with-aix-soname flag, and support the `aix-soname=aix'
326 # and `aix-soname=both' and `aix-soname=svr4' LT_INIT options. DEFAULT
327 # is either `aix', `both' or `svr4'. If omitted, it defaults to `aix'.
328 m4_define([_LT_WITH_AIX_SONAME],
329 [m4_define([_LT_WITH_AIX_SONAME_DEFAULT], [m4_if($1, svr4, svr4, m4_if($1, both, both, aix))])dnl
330 shared_archive_member_spec=
331 case $host,$enable_shared in
332 power*-*-aix[[5-9]]*,yes)
333 AC_MSG_CHECKING([which variant of shared library versioning to provide])
334 AC_ARG_WITH([aix-soname],
335 [AS_HELP_STRING([--with-aix-soname=aix|svr4|both],
336 [shared library versioning (aka "SONAME") variant to provide on AIX, @<:@default=]_LT_WITH_AIX_SONAME_DEFAULT[@:>@.])],
337 [case $withval in
338 aix|svr4|both)
339 ;;
340 *)
341 AC_MSG_ERROR([Unknown argument to --with-aix-soname])
342 ;;
343 esac
344 lt_cv_with_aix_soname=$with_aix_soname],
345 [AC_CACHE_VAL([lt_cv_with_aix_soname],
346 [lt_cv_with_aix_soname=]_LT_WITH_AIX_SONAME_DEFAULT)
347 with_aix_soname=$lt_cv_with_aix_soname])
348 AC_MSG_RESULT([$with_aix_soname])
349 if test aix != "$with_aix_soname"; then
350 # For the AIX way of multilib, we name the shared archive member
351 # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o',
352 # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File.
353 # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag,
354 # the AIX toolchain works better with OBJECT_MODE set (default 32).
355 if test 64 = "${OBJECT_MODE-32}"; then
356 shared_archive_member_spec=shr_64
357 else
358 shared_archive_member_spec=shr
359 fi
360 fi
361 ;;
362 *)
363 with_aix_soname=aix
364 ;;
365 esac
366
367 _LT_DECL([], [shared_archive_member_spec], [0],
368 [Shared archive member basename, for filename based shared library versioning on AIX])dnl
369 ])# _LT_WITH_AIX_SONAME
370
371 LT_OPTION_DEFINE([LT_INIT], [aix-soname=aix], [_LT_WITH_AIX_SONAME([aix])])
372 LT_OPTION_DEFINE([LT_INIT], [aix-soname=both], [_LT_WITH_AIX_SONAME([both])])
373 LT_OPTION_DEFINE([LT_INIT], [aix-soname=svr4], [_LT_WITH_AIX_SONAME([svr4])])
374
375
376 # _LT_WITH_PIC([MODE])
377 # --------------------
378 # implement the --with-pic flag, and support the 'pic-only' and 'no-pic'
379 # LT_INIT options.
380 # MODE is either 'yes' or 'no'. If omitted, it defaults to 'both'.
381 m4_define([_LT_WITH_PIC],
382 [AC_ARG_WITH([pic],
383 [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@],
384 [try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
385 [lt_p=${PACKAGE-default}
386 case $withval in
387 yes|no) pic_mode=$withval ;;
388 *)
389 pic_mode=default
390 # Look at the argument we got. We use all the common list separators.
391 lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
392 for lt_pkg in $withval; do
393 IFS=$lt_save_ifs
394 if test "X$lt_pkg" = "X$lt_p"; then
395 pic_mode=yes
396 fi
397 done
398 IFS=$lt_save_ifs
399 ;;
400 esac],
401 [pic_mode=m4_default([$1], [default])])
402
403 _LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
404 ])# _LT_WITH_PIC
405
406 LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
407 LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
408
409 # Old name:
410 AU_DEFUN([AC_LIBTOOL_PICMODE],
411 [_LT_SET_OPTION([LT_INIT], [pic-only])
412 AC_DIAGNOSE([obsolete],
413 [$0: Remove this warning and the call to _LT_SET_OPTION when you
414 put the 'pic-only' option into LT_INIT's first parameter.])
415 ])
416
417 dnl aclocal-1.4 backwards compatibility:
418 dnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
419
420 ## ----------------- ##
421 ## LTDL_INIT Options ##
422 ## ----------------- ##
423
424 m4_define([_LTDL_MODE], [])
425 LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
426 [m4_define([_LTDL_MODE], [nonrecursive])])
427 LT_OPTION_DEFINE([LTDL_INIT], [recursive],
428 [m4_define([_LTDL_MODE], [recursive])])
429 LT_OPTION_DEFINE([LTDL_INIT], [subproject],
430 [m4_define([_LTDL_MODE], [subproject])])
431
432 m4_define([_LTDL_TYPE], [])
433 LT_OPTION_DEFINE([LTDL_INIT], [installable],
434 [m4_define([_LTDL_TYPE], [installable])])
435 LT_OPTION_DEFINE([LTDL_INIT], [convenience],
436 [m4_define([_LTDL_TYPE], [convenience])])
0 # ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*-
1 #
2 # Copyright (C) 2004-2005, 2007-2008, 2011-2015 Free Software
3 # Foundation, Inc.
4 # Written by Gary V. Vaughan, 2004
5 #
6 # This file is free software; the Free Software Foundation gives
7 # unlimited permission to copy and/or distribute it, with or without
8 # modifications, as long as this notice is preserved.
9
10 # serial 6 ltsugar.m4
11
12 # This is to help aclocal find these macros, as it can't see m4_define.
13 AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
14
15
16 # lt_join(SEP, ARG1, [ARG2...])
17 # -----------------------------
18 # Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
19 # associated separator.
20 # Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
21 # versions in m4sugar had bugs.
22 m4_define([lt_join],
23 [m4_if([$#], [1], [],
24 [$#], [2], [[$2]],
25 [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
26 m4_define([_lt_join],
27 [m4_if([$#$2], [2], [],
28 [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
29
30
31 # lt_car(LIST)
32 # lt_cdr(LIST)
33 # ------------
34 # Manipulate m4 lists.
35 # These macros are necessary as long as will still need to support
36 # Autoconf-2.59, which quotes differently.
37 m4_define([lt_car], [[$1]])
38 m4_define([lt_cdr],
39 [m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
40 [$#], 1, [],
41 [m4_dquote(m4_shift($@))])])
42 m4_define([lt_unquote], $1)
43
44
45 # lt_append(MACRO-NAME, STRING, [SEPARATOR])
46 # ------------------------------------------
47 # Redefine MACRO-NAME to hold its former content plus 'SEPARATOR''STRING'.
48 # Note that neither SEPARATOR nor STRING are expanded; they are appended
49 # to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
50 # No SEPARATOR is output if MACRO-NAME was previously undefined (different
51 # than defined and empty).
52 #
53 # This macro is needed until we can rely on Autoconf 2.62, since earlier
54 # versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
55 m4_define([lt_append],
56 [m4_define([$1],
57 m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
58
59
60
61 # lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
62 # ----------------------------------------------------------
63 # Produce a SEP delimited list of all paired combinations of elements of
64 # PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list
65 # has the form PREFIXmINFIXSUFFIXn.
66 # Needed until we can rely on m4_combine added in Autoconf 2.62.
67 m4_define([lt_combine],
68 [m4_if(m4_eval([$# > 3]), [1],
69 [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
70 [[m4_foreach([_Lt_prefix], [$2],
71 [m4_foreach([_Lt_suffix],
72 ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
73 [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
74
75
76 # lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
77 # -----------------------------------------------------------------------
78 # Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
79 # by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
80 m4_define([lt_if_append_uniq],
81 [m4_ifdef([$1],
82 [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
83 [lt_append([$1], [$2], [$3])$4],
84 [$5])],
85 [lt_append([$1], [$2], [$3])$4])])
86
87
88 # lt_dict_add(DICT, KEY, VALUE)
89 # -----------------------------
90 m4_define([lt_dict_add],
91 [m4_define([$1($2)], [$3])])
92
93
94 # lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
95 # --------------------------------------------
96 m4_define([lt_dict_add_subkey],
97 [m4_define([$1($2:$3)], [$4])])
98
99
100 # lt_dict_fetch(DICT, KEY, [SUBKEY])
101 # ----------------------------------
102 m4_define([lt_dict_fetch],
103 [m4_ifval([$3],
104 m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
105 m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
106
107
108 # lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
109 # -----------------------------------------------------------------
110 m4_define([lt_if_dict_fetch],
111 [m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
112 [$5],
113 [$6])])
114
115
116 # lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
117 # --------------------------------------------------------------
118 m4_define([lt_dict_filter],
119 [m4_if([$5], [], [],
120 [lt_join(m4_quote(m4_default([$4], [[, ]])),
121 lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
122 [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
123 ])
0 # ltversion.m4 -- version numbers -*- Autoconf -*-
1 #
2 # Copyright (C) 2004, 2011-2015 Free Software Foundation, Inc.
3 # Written by Scott James Remnant, 2004
4 #
5 # This file is free software; the Free Software Foundation gives
6 # unlimited permission to copy and/or distribute it, with or without
7 # modifications, as long as this notice is preserved.
8
9 # @configure_input@
10
11 # serial 4179 ltversion.m4
12 # This file is part of GNU Libtool
13
14 m4_define([LT_PACKAGE_VERSION], [2.4.6])
15 m4_define([LT_PACKAGE_REVISION], [2.4.6])
16
17 AC_DEFUN([LTVERSION_VERSION],
18 [macro_version='2.4.6'
19 macro_revision='2.4.6'
20 _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
21 _LT_DECL(, macro_revision, 0)
22 ])
0 # lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*-
1 #
2 # Copyright (C) 2004-2005, 2007, 2009, 2011-2015 Free Software
3 # Foundation, Inc.
4 # Written by Scott James Remnant, 2004.
5 #
6 # This file is free software; the Free Software Foundation gives
7 # unlimited permission to copy and/or distribute it, with or without
8 # modifications, as long as this notice is preserved.
9
10 # serial 5 lt~obsolete.m4
11
12 # These exist entirely to fool aclocal when bootstrapping libtool.
13 #
14 # In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN),
15 # which have later been changed to m4_define as they aren't part of the
16 # exported API, or moved to Autoconf or Automake where they belong.
17 #
18 # The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN
19 # in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
20 # using a macro with the same name in our local m4/libtool.m4 it'll
21 # pull the old libtool.m4 in (it doesn't see our shiny new m4_define
22 # and doesn't know about Autoconf macros at all.)
23 #
24 # So we provide this file, which has a silly filename so it's always
25 # included after everything else. This provides aclocal with the
26 # AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
27 # because those macros already exist, or will be overwritten later.
28 # We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6.
29 #
30 # Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
31 # Yes, that means every name once taken will need to remain here until
32 # we give up compatibility with versions before 1.7, at which point
33 # we need to keep only those names which we still refer to.
34
35 # This is to help aclocal find these macros, as it can't see m4_define.
36 AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
37
38 m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
39 m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])])
40 m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
41 m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])])
42 m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
43 m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])])
44 m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])])
45 m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
46 m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])])
47 m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])])
48 m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])])
49 m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
50 m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
51 m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
52 m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
53 m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])])
54 m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])])
55 m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
56 m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
57 m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])])
58 m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])])
59 m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
60 m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
61 m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
62 m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
63 m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
64 m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
65 m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
66 m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])])
67 m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])])
68 m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])])
69 m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
70 m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])])
71 m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])])
72 m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])])
73 m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])])
74 m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
75 m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])])
76 m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
77 m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])])
78 m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])])
79 m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])])
80 m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
81 m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
82 m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
83 m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
84 m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
85 m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
86 m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
87 m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
88 m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
89 m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
90 m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])])
91 m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
92 m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])])
93 m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])])
94 m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])])
95 m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])])
96 m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])])
97 m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])])
98 m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])])
2020 #include <algorithm>
2121 #include <utility>
2222 #include "Bezier.hpp"
23 #include "Matrix.hpp"
2324
2425 using namespace std;
2526
229230
230231
231232 /** Returns a tight bounding box parallel to the x- and y-axis. */
232 void Bezier::getBBox (BoundingBox &bbox) const {
233 bbox.invalidate();
233 BoundingBox Bezier::getBBox () const {
234 BoundingBox bbox;
234235 // coefficients of the derivative
235236 DPair pa = _points[3] - _points[2]*3.0 + _points[1]*3.0 - _points[0];
236237 DPair pb = (_points[2]-_points[1]*2.0+_points[0])*2.0;
252253 }
253254 bbox.embed(_points[0]);
254255 bbox.embed(_points[3]);
255 }
256 return bbox;
257 }
258
259
260 Bezier& Bezier::transform (const Matrix &matrix) {
261 for (int i=0; i < 4; i++)
262 _points[i] = matrix*_points[i];
263 return *this;
264 }
2424 #include "BoundingBox.hpp"
2525 #include "Pair.hpp"
2626
27 class Bezier
28 {
27 class Matrix;
28
29 class Bezier {
2930 public:
3031 Bezier ();
3132 Bezier (const DPair &p0, const DPair &p1, const DPair &p2);
3637 DPair valueAt (double t) const;
3738 DPair blossomValue (double u, double v, double w) const;
3839 void subdivide (double t, Bezier *bezier1, Bezier *bezier2) const;
40 Bezier& transform (const Matrix &matrix);
3941 int approximate (double delta, std::vector<DPair> &p, std::vector<double> *t=nullptr) const;
4042 const DPair& point (int i) const {return _points[i];}
4143 int reduceDegree (double delta, std::vector<DPair> &p) const;
42 void getBBox (BoundingBox &bbox) const;
44 BoundingBox getBBox () const;
4345
4446 protected:
4547 int approximate (double delta, double t0, double t1, std::vector<DPair> &p, std::vector<double> *t) const;
2424
2525 using namespace std;
2626
27 Bitmap::Bitmap () : _rows(0), _cols(0), _xshift(0), _yshift(0), _bpr(0), _bytes(0)
28 {
29 }
30
3127
3228 /** Constructs a Bitmap */
3329 Bitmap::Bitmap (int minx, int maxx, int miny , int maxy) {
4743 _yshift = miny;
4844 _bpr = _cols/8 + (_cols % 8 ? 1 : 0); // bytes per row
4945 _bytes.resize(_rows*_bpr);
50 for (uint8_t &byte : _bytes)
51 byte = 0;
46 std::fill(_bytes.begin(), _bytes.end(), 0);
5247 }
5348
5449
6863 int m = min(n, b+1); // number of bits to be set in current byte
6964 int bitseq = (1 << m)-1; // sequence of n set bits (bits 0..n-1 are set)
7065 bitseq <<= b-m+1; // move bit sequence so that bit b is the leftmost set bit
71 *byte |= uint8_t(bitseq); // apply bit sequence to current byte
66 *byte |= uint8_t(bitseq); // apply bit sequence to current byte
7267 byte++;
7368 n -= m;
7469 col += m;
8984 }
9085
9186
92 class BBoxCallback : public Bitmap::Callback
93 {
87 class BBoxCallback : public Bitmap::Callback {
9488 public:
95 BBoxCallback () : _changed(false), _minx(numeric_limits<int>::max()), _miny(_minx), _maxx(0), _maxy(0) {}
9689 int minx () const {return _minx;}
9790 int miny () const {return _miny;}
9891 int maxx () const {return _maxx;}
115108 }
116109
117110 private:
118 bool _changed;
119 int _minx, _miny, _maxx, _maxy;
111 bool _changed = false;
112 int _minx = numeric_limits<int>::max(), _miny=_minx;
113 int _maxx = 0, _maxy = 0;
120114 };
121115
122116
2424 #include <vector>
2525
2626
27 class Bitmap
28 {
27 class Bitmap {
2928 public:
3029 struct Callback {
3130 virtual ~Callback() =default;
3534 };
3635
3736 public:
38 Bitmap ();
37 Bitmap () =default;
3938 Bitmap (int minx, int maxx, int miny , int maxy);
4039 void resize (int minx, int maxx, int miny , int maxy);
4140 void setBits(int row, int col, int n);
5958 // std::ostream& write (std::ostream &os) const;
6059
6160 private:
62 int _rows, _cols; ///< number of rows, columns
63 int _xshift, _yshift; ///< horizontal/vertical shift
64 int _bpr; ///< number of bytes per row
61 int _rows=0, _cols=0; ///< number of rows, columns
62 int _xshift=0, _yshift=0; ///< horizontal/vertical shift
63 int _bpr=0; ///< number of bytes per row
6564 std::vector<uint8_t> _bytes;
6665 };
6766
8079 int targetrow = vflip ? _rows-r-1 : r;
8180 for (int b=0; b < _bpr; b++) {
8281 T &t = target[targetrow*tpr + b/s];
83 T chunk = (T)_bytes[r*_bpr+b] << (8*(s-1-b%s));
82 T chunk = static_cast<T>(_bytes[r*_bpr+b]) << (8*(s-1-b%s));
8483 if (b % s == 0)
8584 t = chunk;
8685 else
106105 }
107106 }*/
108107
109
110108 #endif
8888 const char *name;
8989 void (CMapReader::*handler)(InputReader&);
9090 };
91 constexpr array<Operator, 6> operators {{
91 constexpr array<Operator, 7> operators {{
9292 {"beginbfchar", &CMapReader::op_beginbfchar},
9393 {"beginbfrange", &CMapReader::op_beginbfrange},
94 {"begincidchar", &CMapReader::op_begincidchar},
9495 {"begincidrange", &CMapReader::op_begincidrange},
9596 {"def", &CMapReader::op_def},
9697 {"endcmap", &CMapReader::op_endcmap},
153154 }
154155
155156
157 void CMapReader::op_begincidchar (InputReader &ir) {
158 if (!_tokens.empty() && _tokens.back().type() == Token::Type::NUMBER) {
159 ir.skipSpace();
160 int num_entries = static_cast<int>(popToken().numvalue());
161 while (num_entries > 0 && ir.peek() == '<') {
162 uint32_t first = parse_hexentry(ir);
163 uint32_t cid;
164 ir.skipSpace();
165 if (!ir.parseUInt(cid))
166 throw CMapReaderException("invalid char entry (decimal value expected)");
167 _cmap->addCIDRange(first, first, cid);
168 ir.skipSpace();
169 }
170 }
171 }
172
156173 void CMapReader::op_begincidrange (InputReader &ir) {
157174 if (!_tokens.empty() && _tokens.back().type() == Token::Type::NUMBER) {
158175 ir.skipSpace();
5858 void executeOperator (const std::string &op, InputReader &ir);
5959 void op_beginbfchar (InputReader &ir);
6060 void op_beginbfrange (InputReader &ir);
61 void op_begincidchar (InputReader &ir);
6162 void op_begincidrange (InputReader &ir);
6263 void op_def (InputReader &ir);
6364 void op_endcmap (InputReader &ir);
+0
-112
src/CRC32.cpp less more
0 /*************************************************************************
1 ** CRC32.cpp **
2 ** **
3 ** This file is part of dvisvgm -- a fast DVI to SVG converter **
4 ** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
5 ** **
6 ** This program is free software; you can redistribute it and/or **
7 ** modify it under the terms of the GNU General Public License as **
8 ** published by the Free Software Foundation; either version 3 of **
9 ** the License, or (at your option) any later version. **
10 ** **
11 ** This program is distributed in the hope that it will be useful, but **
12 ** WITHOUT ANY WARRANTY; without even the implied warranty of **
13 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the **
14 ** GNU General Public License for more details. **
15 ** **
16 ** You should have received a copy of the GNU General Public License **
17 ** along with this program; if not, see <http://www.gnu.org/licenses/>. **
18 *************************************************************************/
19
20 #include <cstring>
21 #include "CRC32.hpp"
22
23 using namespace std;
24
25
26 CRC32::CRC32 () : _crc32(0xFFFFFFFF)
27 {
28 const uint32_t poly = 0xEDB88320;
29 for (int i = 0; i < 256; i++) {
30 uint32_t crc=i;
31 for (int j=8; j > 0; j--) {
32 if (crc & 1)
33 crc = (crc >> 1) ^ poly;
34 else
35 crc >>= 1;
36 }
37 _tab[i] = crc;
38 }
39 }
40
41
42 /** Resets CRC32 sum to 0. */
43 void CRC32::reset () {
44 _crc32 = 0xFFFFFFFF;
45 }
46
47
48 /** Appends string bytes to the previous data and computes the resulting checksum.
49 * @param[in] data string to update the checksum with */
50 void CRC32::update (const char *data) {
51 update((const uint8_t*)data, strlen(data));
52 }
53
54
55 /** Appends a single value to the previous data and computes the resulting checksum.
56 * @param[in] n value to update the checksum with
57 * @param[in] bytes number of bytes to consider (0-4) */
58 void CRC32::update (uint32_t n, int bytes) {
59 for (int i=bytes-1; i >= 0; --i) {
60 uint8_t byte = uint8_t((n >> (8*i)) & 0xff);
61 update(&byte, 1);
62 }
63 }
64
65
66 /** Appends a sequence of bytes to the previous data and computes the resulting checksum.
67 * @param[in] bytes pointer to array of bytes
68 * @param[in] len number of bytes in array */
69 void CRC32::update (const uint8_t *bytes, size_t len) {
70 for (size_t i=0; i < len; ++i)
71 _crc32 = ((_crc32 >> 8) & 0x00FFFFFF) ^ _tab[(_crc32 ^ *bytes++) & 0xFF];
72 }
73
74
75 void CRC32::update (istream &is) {
76 char buf [4096];
77 while (is) {
78 is.read(buf, 4096);
79 update((uint8_t*)buf, is.gcount());
80 }
81 }
82
83
84 /** Returns the checksum computed from values added with the update functions. */
85 uint32_t CRC32::get () const {
86 return _crc32 ^ 0xFFFFFFFF;
87 }
88
89
90 /** Computes the CRC32 checksum of a sequence of bytes.
91 * @param[in] bytes pointer to array of bytes
92 * @param[in] len number of bytes in array
93 * @return CRC32 checksum */
94 uint32_t CRC32::compute (const uint8_t *bytes, size_t len) {
95 CRC32 crc32;
96 crc32.update(bytes, len);
97 return crc32.get();
98 }
99
100
101 /** Computes the CRC32 checksum of a string. */
102 uint32_t CRC32::compute (const char *str) {
103 return compute((const uint8_t*)str, strlen(str));
104 }
105
106
107 uint32_t CRC32::compute (istream &is) {
108 CRC32 crc32;
109 crc32.update(is);
110 return crc32.get();
111 }
+0
-47
src/CRC32.hpp less more
0 /*************************************************************************
1 ** CRC32.hpp **
2 ** **
3 ** This file is part of dvisvgm -- a fast DVI to SVG converter **
4 ** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
5 ** **
6 ** This program is free software; you can redistribute it and/or **
7 ** modify it under the terms of the GNU General Public License as **
8 ** published by the Free Software Foundation; either version 3 of **
9 ** the License, or (at your option) any later version. **
10 ** **
11 ** This program is distributed in the hope that it will be useful, but **
12 ** WITHOUT ANY WARRANTY; without even the implied warranty of **
13 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the **
14 ** GNU General Public License for more details. **
15 ** **
16 ** You should have received a copy of the GNU General Public License **
17 ** along with this program; if not, see <http://www.gnu.org/licenses/>. **
18 *************************************************************************/
19
20 #ifndef CRC32_HPP
21 #define CRC32_HPP
22
23 #include <cstdlib>
24 #include <istream>
25
26 class CRC32 {
27 public:
28 CRC32 ();
29 CRC32 (const CRC32 &crc32) =delete;
30 void update (const uint8_t *bytes, size_t len);
31 void update (uint32_t n, int bytes=4);
32 void update (const char *str);
33 void update (std::istream &is);
34 uint32_t get () const;
35 void reset ();
36 static uint32_t compute (const uint8_t *bytes, size_t len);
37 static uint32_t compute (const char *str);
38 static uint32_t compute (std::istream &is);
39
40 private:
41 uint32_t _crc32;
42 uint32_t _tab[256];
43 };
44
45
46 #endif
3939
4040 static inline uint8_t double_to_byte (double v) {
4141 v = max(0.0, min(1.0, v));
42 return uint8_t(floor(255*v+0.5));
42 return uint8_t(round(255.0*v));
4343 }
4444
4545
631631 c.getLab(l2, a2, b2);
632632 const double deltaL = l2-l1;
633633 const double lBar = (l1+l2)/2;
634 const double c1 = sqrt(a1*a1 + b1*b1);
635 const double c2 = sqrt(a2*a2 + b2*b2);
634 const double c1 = hypot(a1, b1);
635 const double c2 = hypot(a2, b2);
636636 const double cBar = (c1+c2)/2.0;
637637 const double g = (1.0-sqrt(pow(cBar, 7.0)/(pow(cBar, 7.0)+6103515625.0)))/2.0;
638638 const double aa1 = a1*(1.0+g);
639639 const double aa2 = a2*(1.0+g);
640 const double cc1 = sqrt(aa1*aa1 + b1*b1);
641 const double cc2 = sqrt(aa2*aa2 + b2*b2);
640 const double cc1 = hypot(aa1, b1);
641 const double cc2 = hypot(aa2, b2);
642642 const double ccBar = (cc1+cc2)/2.0;
643643 const double deltaCC = cc2-cc1;
644644 double hh1 = atan2(b1, aa1);
110110 combinedHash = hashFunc->digestString();
111111 }
112112 const SVGOutput::HashTriple hashTriple(dviHash, shortenedOptHash, combinedHash);
113 string fname = _out.filename(i, numberOfPages(), hashTriple);
114 if (!dviHash.empty() && !PAGE_HASH_SETTINGS.isSet(HashSettings::P_REPLACE) && FileSystem::exists(fname)) {
113 FilePath path = _out.filepath(i, numberOfPages(), hashTriple);
114 if (!dviHash.empty() && !PAGE_HASH_SETTINGS.isSet(HashSettings::P_REPLACE) && path.exists()) {
115115 Message::mstream(false, Message::MC_PAGE_NUMBER) << "skipping page " << i;
116116 Message::mstream().indent(1);
117 Message::mstream(false, Message::MC_PAGE_WRITTEN) << "\nfile " << fname << " exists\n";
117 Message::mstream(false, Message::MC_PAGE_WRITTEN) << "\nfile " << path.shorterAbsoluteOrRelative() << " exists\n";
118118 Message::mstream().indent(0);
119119 }
120120 else {
122122 SVGOptimizer(_svg).execute();
123123 embedFonts(_svg.rootNode());
124124 bool success = _svg.write(_out.getPageStream(currentPageNumber(), numberOfPages(), hashTriple));
125 string fname = path.shorterAbsoluteOrRelative();
125126 if (fname.empty())
126127 fname = "<stdout>";
127128 if (success)
424425 }
425426
426427
427 string DVIToSVG::getSVGFilename (unsigned pageno) const {
428 return _out.filename(pageno, numberOfPages());
428 FilePath DVIToSVG::getSVGFilePath (unsigned pageno) const {
429 return _out.filepath(pageno, numberOfPages());
429430 }
430431
431432
571572 _params.insert(it->second);
572573 else if (_algo.empty() && HashFunction::isSupportedAlgorithm(name))
573574 _algo = name;
575 else if (!name.empty()) {
576 string msg = "invalid hash parameter '"+name+"' (supported algorithms: ";
577 for (string str : HashFunction::supportedAlgorithms())
578 msg += str + ", ";
579 msg.pop_back();
580 msg.pop_back();
581 msg += ')';
582 throw MessageException(msg);
583 }
574584 }
575585 // set default hash algorithm if none is given
576586 if (_algo.empty())
2424 #include <string>
2525 #include <utility>
2626 #include "DVIReader.hpp"
27 #include "FilePath.hpp"
2728 #include "SVGTree.hpp"
2829
2930 struct DVIActions;
6162 void finishLine () override {_prevYPos = std::numeric_limits<double>::min();}
6263 void listHashes (const std::string &rangestr, std::ostream &os);
6364
64 std::string getSVGFilename (unsigned pageno) const;
65 FilePath getSVGFilePath (unsigned pageno) const;
6566 std::string getUserBBoxString () const {return _bboxFormatString;}
6667 static void setProcessSpecials (const char *ignorelist=nullptr, bool pswarning=false);
6768
6868 }
6969
7070
71 string DVIToSVGActions::getSVGFilename (unsigned pageno) const {
71 FilePath DVIToSVGActions::getSVGFilePath (unsigned pageno) const {
72 FilePath path;
7273 if (auto dvi2svg = dynamic_cast<DVIToSVG*>(_dvireader))
73 return dvi2svg->getSVGFilename(pageno);
74 return "";
74 path = dvi2svg->getSVGFilePath(pageno);
75 return path;
7576 }
7677
7778
7879 string DVIToSVGActions::getBBoxFormatString () const {
80 string boxstr;
7981 if (auto dvi2svg = dynamic_cast<DVIToSVG*>(_dvireader))
80 return dvi2svg->getUserBBoxString();
81 return "";
82 boxstr = dvi2svg->getUserBBoxString();
83 return boxstr;
8284 }
8385
8486
7272 BoundingBox& bbox (const std::string &name, bool reset=false) override;
7373 void embed (const BoundingBox &bbox) override;
7474 void embed (const DPair &p, double r=0) override;
75 std::string getSVGFilename (unsigned pageno) const override;
75 FilePath getSVGFilePath (unsigned pageno) const override;
7676 std::string getBBoxFormatString () const override;
7777 CharMap& getUsedChars () const {return _usedChars;}
7878 const FontSet& getUsedFonts () const {return _usedFonts;}
0 /*************************************************************************
1 ** EllipticalArc.cpp **
2 ** **
3 ** This file is part of dvisvgm -- a fast DVI to SVG converter **
4 ** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
5 ** **
6 ** This program is free software; you can redistribute it and/or **
7 ** modify it under the terms of the GNU General Public License as **
8 ** published by the Free Software Foundation; either version 3 of **
9 ** the License, or (at your option) any later version. **
10 ** **
11 ** This program is distributed in the hope that it will be useful, but **
12 ** WITHOUT ANY WARRANTY; without even the implied warranty of **
13 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the **
14 ** GNU General Public License for more details. **
15 ** **
16 ** You should have received a copy of the GNU General Public License **
17 ** along with this program; if not, see <http://www.gnu.org/licenses/>. **
18 *************************************************************************/
19
20 #include <cmath>
21 #include "EllipticalArc.hpp"
22 #include "utility.hpp"
23
24 using namespace std;
25
26
27 /** Constructs an elliptical arc from end point parameterization.
28 * @param[in] start start point of arc
29 * @param[in] rx length of semi-major axis
30 * @param[in] ry length of semi-minor axis
31 * @param[in] angle rotation of ellipse around its center (in radians)
32 * @param[in] laf if true, choose the larger arc between start and end point
33 * @param[in] sweep if true, arc is drawn in the direction of increasing angles
34 * @param[in] end end point of the arc */
35 EllipticalArc::EllipticalArc (const DPair &start, double rx, double ry, double angle, bool laf, bool sweep, const DPair &end)
36 : _rx(abs(rx)), _ry(abs(ry)), _rotationAngle(math::normalize_angle(angle, math::PI)),
37 _largeArc(laf), _sweepPositive(sweep), _startPoint(start), _endPoint(end)
38 {
39 if (!isStraightLine()) {
40 // fix out-of-range radii according to section F.6.6.3 in
41 // https://www.w3.org/TR/SVG/implnote.html#ArcCorrectionOutOfRangeRadii
42 double c = cos(_rotationAngle);
43 double s = sin(_rotationAngle);
44 DPair p = (_startPoint-_endPoint)/2.0;
45 p = DPair(c*p.x()+s*p.y(), c*p.y()-s*p.x());
46 double lambda = (p.x()*p.x())/(_rx*_rx) + (p.y()*p.y())/(_ry*_ry);
47 if (lambda > 1) {
48 lambda = sqrt(lambda);
49 _rx *= lambda;
50 _ry *= lambda;
51 }
52 }
53 }
54
55
56 /** Constructs an elliptical arc from center parameterization
57 * @param[in] center absolute coordinates of the center of the ellipse
58 * @param[in] rx length of semi-major axis
59 * @param[in] ry length of semi-minor axis
60 * @param[in] rot rotation of ellipse around its center (in radians)
61 * @param[in] startAngle angle between major axis and vector from center to start point
62 * @param[in] deltaAngle angle between the vectors from center to start and end point, respectively */
63 EllipticalArc::EllipticalArc (const DPair &center, double rx, double ry, double rot, double startAngle, double deltaAngle)
64 : _rx(rx), _ry(ry), _rotationAngle(math::normalize_angle(rot, math::TWO_PI)),
65 _largeArc(abs(deltaAngle) > math::PI), _sweepPositive(deltaAngle > 0)
66 {
67 // https://www.w3.org/TR/SVG/implnote.html#ArcConversionCenterToEndpoint
68 double c = cos(_rotationAngle);
69 double s = sin(_rotationAngle);
70 double c1 = cos(startAngle);
71 double s1 = sin(startAngle);
72 double c2 = cos(startAngle+deltaAngle);
73 double s2 = sin(startAngle+deltaAngle);
74 _startPoint = DPair(c*rx*c1*c - s*ry*s1, s*rx*c1 + c*ry*s1) + center;
75 _endPoint = DPair(c*rx*c2*c - s*ry*s2, s*rx*c2 + c*ry*s2) + center;
76 }
77
78
79 /** Returns the angle between (1, 0) and a given vector.
80 * The angle is normalized to the range [0, 2pi). */
81 static inline double angle (const DPair &p) {
82 return math::normalize_0_2pi(atan2(p.y(), p.x()));
83 }
84
85
86 /** Computes the center parameterization of the arc. */
87 EllipticalArc::CenterParams EllipticalArc::getCenterParams () const {
88 EllipticalArc::CenterParams params;
89 if (isStraightLine()) {
90 params.center = (_endPoint-_startPoint)/2.0;
91 params.startAngle = params.deltaAngle = 0;
92 }
93 else {
94 // https://www.w3.org/TR/SVG/implnote.html#ArcConversionEndpointToCenter
95 double c = cos(_rotationAngle);
96 double s = sin(_rotationAngle);
97 DPair p = (_startPoint-_endPoint)/2.0;
98 p = DPair(c*p.x()+s*p.y(), c*p.y()-s*p.x());
99 double rx2 = _rx*_rx, ry2 = _ry*_ry;
100 double px2 = p.x()*p.x(), py2 = p.y()*p.y();
101 double radicand = rx2*ry2 - rx2*py2 - ry2*px2;
102 if (radicand < 0) // should not happen if out-of-range radii were fixed correctly
103 radicand = 0;
104 else
105 radicand /= rx2*py2 + ry2*px2;
106 double root = sqrt(radicand) * (_largeArc == _sweepPositive ? -1 : 1);
107 DPair cp(root*p.y()*_rx/_ry, -root*p.x()*_ry/_rx);
108 DPair mid = (_startPoint+_endPoint)/2.0;
109 params.center = DPair(c*cp.x() - s*cp.y() + mid.x(), s*cp.x() + c*cp.y() + mid.y());
110 DPair q1((p.x() - cp.x())/_rx, (p.y() - cp.y())/_ry);
111 DPair q2(-(p.x() + cp.x())/_rx, -(p.y() + cp.y())/_ry);
112 params.startAngle = angle(q1);
113 params.deltaAngle = angle(q2) - params.startAngle;
114 if (_sweepPositive && params.deltaAngle < 0)
115 params.deltaAngle += math::TWO_PI;
116 else if (!_sweepPositive && params.deltaAngle > 0)
117 params.deltaAngle -= math::TWO_PI;
118 }
119 return params;
120 }
121
122
123 /** Applies the affine transformation described by a given matrix to the arc. */
124 void EllipticalArc::transform (const Matrix &matrix) {
125 double c = cos(_rotationAngle);
126 double s = sin(_rotationAngle);
127 Matrix ellipse({_rx*c, -_ry*s, 0, _rx*s, _ry*c}); // E := rotate(xrot)*scale(rx, ry)
128 ellipse.lmultiply(matrix); // E':= M*E
129 // Compute the singular value decomposition of the transformed ellipse shape:
130 // E' = rotate(phi)*scale(sx, sy)*rotate(theta)
131 // The initial, right-hand rotation can be ignored because it rotates the unit circle
132 // around the origin, i.e. rotate(theta) maps the circle to itself.
133 // The signs of sx and sy don't matter either. They just flip the yet unrotated
134 // ellipse on the x- and/or y-axis. Thus, |sx| and |sy| are the new radii,
135 // and phi the new rotation angle.
136 auto vec = math::svd({{ellipse.get(0,0), ellipse.get(0,1)}, {ellipse.get(1,0), ellipse.get(1,1)}});
137 if (std::abs(vec[1]-vec[2]) < 1e-7) { // circle?
138 _rx = _ry = vec[1]; // always >= 0
139 _rotationAngle = 0;
140 }
141 else {
142 _rx = vec[1]; // always >= 0
143 _ry = abs(vec[2]); // ensure >= 0
144 _rotationAngle = math::normalize_angle(vec[0], math::HALF_PI);
145 }
146 // change drawing direction (clockwise vs. counter-clockwise) if 'matrix'
147 // flipped the ellipse horizontally or vertically but not both
148 if ((matrix.get(0, 0) < 0) != (matrix.get(1, 1) < 0))
149 _sweepPositive = !_sweepPositive;
150 _startPoint = matrix * _startPoint;
151 _endPoint = matrix * _endPoint;
152 }
153
154
155 /** Approximates an arc of the unit circle by a single cubic Bézier curve.
156 * @param[in] phi start angle of the arc in radians
157 * @param[in] delta length of the arc */
158 static Bezier approx_unit_arc (double phi, double delta) {
159 double c = 0.551915024494; // see http://spencermortensen.com/articles/bezier-circle
160 if (abs(delta + math::HALF_PI) < 1e-7)
161 c = -c;
162 else
163 c = 4.0/3*tan(delta/4);
164 DPair p1(cos(phi), sin(phi));
165 DPair p4(cos(phi+delta), sin(phi+delta));
166 DPair p2(p1.x()-c*p1.y(), p1.y()+c*p1.x());
167 DPair p3(p4.x()+c*p4.y(), p4.y()-c*p4.x());
168 return Bezier(p1, p2, p3, p4);
169 }
170
171
172 /** Approximates the arc by a sequence of cubic Bézier curves. */
173 vector<Bezier> EllipticalArc::approximate () const {
174 vector<Bezier> beziers;
175 if (_startPoint != _endPoint) {
176 if (isStraightLine()) {
177 DPair dir = (_endPoint - _startPoint);
178 dir /= dir.length()/3.0;
179 beziers.emplace_back(Bezier(_startPoint, _startPoint+dir, _endPoint-dir, _endPoint));
180 }
181 else {
182 CenterParams cparams = getCenterParams();
183 int numCurves = ceil(cparams.deltaAngle/math::HALF_PI);
184 double remainder = abs(fmod(cparams.deltaAngle, math::HALF_PI));
185 if (remainder < 1e-7)
186 numCurves--;
187 else if (math::HALF_PI-remainder < 1e-7)
188 numCurves++;
189 if (numCurves > 0) {
190 double c = cos(_rotationAngle);
191 double s = sin(_rotationAngle);
192 Matrix ellipse = {_rx*c, -_ry*s, cparams.center.x(), _rx*s, _ry*c, cparams.center.y()};
193 double angle = cparams.startAngle;
194 double diff = cparams.deltaAngle/numCurves;
195 while (numCurves-- > 0) {
196 beziers.emplace_back(approx_unit_arc(angle, diff).transform(ellipse));
197 angle += diff;
198 }
199 }
200 }
201 }
202 return beziers;
203 }
204
205
206 static inline bool is_angle_between (double t, double angle1, double angle2) {
207 if (angle1 < angle2)
208 return angle1 < t && t < angle2;
209 return angle2 > t || t > angle1;
210 }
211
212
213 /** Returns the tight bounding box of the arc. */
214 BoundingBox EllipticalArc::getBBox () const {
215 BoundingBox bbox;
216 bbox.embed(_startPoint);
217 bbox.embed(_endPoint);
218 if (!isStraightLine()) {
219 // compute extremes of ellipse centered at the origin
220 double c = cos(_rotationAngle);
221 double s = sin(_rotationAngle);
222 double tx1 = math::normalize_0_2pi(-atan2(_ry*s, _rx*c)); // position of vertical tangent, d/dt E(tx1)=(0, y)
223 double tx2 = math::normalize_0_2pi(math::PI+tx1); // position of second vertical tangent
224 double ct = cos(tx1);
225 double st = sin(tx1);
226 DPair pv1(_rx*c*ct - _ry*s*st, _rx*s*ct + _ry*c*st); // E(tx1), 1st point on ellipse with vertical tangent
227 DPair pv2 = -pv1; // E(tx2), 2nd point on ellipse with vertical tangent
228
229 double ty1 = math::normalize_0_2pi(atan2(_ry*c, _rx*s)); // position of horizontal tangent, d/dt E(ty1)=(x, 0)
230 double ty2 = math::normalize_0_2pi(math::PI+ty1); // position of second horizontal tangent
231 ct = cos(ty1);
232 st = sin(ty1);
233 DPair ph1(_rx*c*ct - _ry*s*st, _rx*s*ct + _ry*c*st); // E(ty1), 1st point on ellipse with horizontal tangent
234 DPair ph2 = -ph1; // E(ty2), 2nd point on ellipse with horizontal tangent
235
236 // translate extreme points to actual coordinates
237 CenterParams cparams = getCenterParams();
238 pv1 += cparams.center;
239 pv2 += cparams.center;
240 ph1 += cparams.center;
241 ph2 += cparams.center;
242
243 double angle1 = cparams.startAngle;
244 double angle2 = math::normalize_0_2pi(angle1+cparams.deltaAngle);
245 if (!_sweepPositive)
246 swap(angle1, angle2);
247
248 // only consider extreme points located on the arc
249 if (is_angle_between(tx1, angle1, angle2))
250 bbox.embed(pv1);
251 if (is_angle_between(tx2, angle1, angle2))
252 bbox.embed(pv2);
253 if (is_angle_between(ty1, angle1, angle2))
254 bbox.embed(ph1);
255 if (is_angle_between(ty2, angle1, angle2))
256 bbox.embed(ph2);
257 }
258 return bbox;
259 }
0 /*************************************************************************
1 ** EllipticalArc.hpp **
2 ** **
3 ** This file is part of dvisvgm -- a fast DVI to SVG converter **
4 ** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
5 ** **
6 ** This program is free software; you can redistribute it and/or **
7 ** modify it under the terms of the GNU General Public License as **
8 ** published by the Free Software Foundation; either version 3 of **
9 ** the License, or (at your option) any later version. **
10 ** **
11 ** This program is distributed in the hope that it will be useful, but **
12 ** WITHOUT ANY WARRANTY; without even the implied warranty of **
13 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the **
14 ** GNU General Public License for more details. **
15 ** **
16 ** You should have received a copy of the GNU General Public License **
17 ** along with this program; if not, see <http://www.gnu.org/licenses/>. **
18 *************************************************************************/
19
20 #pragma once
21
22 #include "Bezier.hpp"
23 #include "BoundingBox.hpp"
24 #include "Matrix.hpp"
25 #include "Pair.hpp"
26
27 class EllipticalArc {
28 public:
29 struct CenterParams {
30 DPair center; ///< absolute coordinates of the center point
31 double startAngle; ///< angle of start point relative to semi-major axis (in radians)
32 double deltaAngle; ///< difference between angles of the start and end point (>0 if sweep flag is set)
33 };
34
35 public:
36 EllipticalArc (const DPair &start, double rx, double ry, double angle, bool laf, bool sweep, const DPair &end);
37 EllipticalArc (const DPair &center, double rx, double ry, double rot, double startAngle, double deltaAngle);
38 CenterParams getCenterParams () const;
39 double rx () const {return _rx;}
40 double ry () const {return _ry;}
41 bool largeArc () const {return _largeArc;}
42 bool sweepPositive () const {return _sweepPositive;}
43 double rotationAngle () const {return _rotationAngle;}
44 DPair startPoint () const {return _startPoint;}
45 DPair endPoint () const {return _endPoint;}
46 bool isStraightLine () const {return _rx < 1e-7 || _ry < 1e-7;}
47 BoundingBox getBBox () const;
48 void transform (const Matrix &matrix);
49 std::vector<Bezier> approximate () const;
50
51 private:
52 double _rx, _ry; ///< length of semi-major and semi-minor axes
53 double _rotationAngle; ///< rotation angle around center (in radians)
54 bool _largeArc; ///< if true, the longer arc from start to end point is chosen, else the shorter one
55 bool _sweepPositive; ///< if true, arc is drawn in direction of positive angles, else the opposite direction
56 DPair _startPoint, _endPoint; ///< absolute coordinates of start and end point
57 };
58
8686 }
8787
8888
89 /** Assigns a new path of a file or directory that already exists.
90 * Relative paths are relative to the current working directory.
91 * @param[in] path absolute or relative path to a file or directory */
92 void FilePath::set (const string &path) {
93 set(path, !FileSystem::isDirectory(path));
94 }
95
96
8997 /** Assigns a new path. Relative paths are relative to the current working directory.
90 * @param[in] path absolute or relative path to a file or directory */
91 void FilePath::set(const string &path) {
92 init(path, !FileSystem::isDirectory(path), FileSystem::getcwd());
98 * @param[in] path absolute or relative path to a file or directory
99 * @param[in] isfile true if 'path' references a file, false if a directory is referenced */
100 void FilePath::set (const string &path, bool isfile) {
101 init(path, isfile, FileSystem::getcwd());
102 }
103
104
105 /** Assigns a new path. Relative paths are relative to the current working directory.
106 * @param[in] path absolute or relative path to a file or directory
107 * @param[in] isfile true if 'path' references a file, false if a directory is referenced
108 * @param[in] current_dir if 'path' is a relative path expression it will be related to 'current_dir' */
109 void FilePath::set (const string &path, bool isfile, const string &current_dir) {
110 init(path, isfile, current_dir);
93111 }
94112
95113
256274 path = ".";
257275 return single_slashes(path);
258276 }
277
278
279 /** Return the absolute or relative path whichever is shorter.
280 * @param[in] reldir absolute path to a directory
281 * @param[in] with_filename if false, the filename is omitted */
282 string FilePath::shorterAbsoluteOrRelative (string reldir, bool with_filename) const {
283 string abs = absolute(with_filename);
284 string rel = relative(reldir, with_filename);
285 return abs.length() < rel.length() ? abs : rel;
286 }
287
288
289 bool FilePath::exists () const {
290 return empty() ? false : FileSystem::exists(absolute());
291 }
3838 };
3939
4040 public:
41 FilePath () =default;
4142 explicit FilePath (const std::string &path) {set(path);}
4243 FilePath (const std::string &path, bool isfile) : FilePath(path, isfile, "") {}
4344 FilePath (const std::string &path, bool isfile, const std::string &current_dir);
4445 void set (const std::string &path);
46 void set (const std::string &path, bool isfile);
47 void set (const std::string &path, bool isfile, const std::string &current_dir);
4548 std::string absolute (bool with_filename=true) const;
4649 std::string relative (std::string reldir="", bool with_filename=true) const;
50 std::string shorterAbsoluteOrRelative (std::string reldir="", bool with_filename=true) const;
4751 std::string basename () const;
4852 std::string suffix () const;
4953 void suffix (const std::string &s);
5256 bool empty () const {return _dirs.empty() && _fname.empty();}
5357 const std::string& filename () const {return _fname;}
5458 void filename (const std::string &fname) {_fname = fname;}
59 bool exists () const;
5560
5661 protected:
5762 void init (std::string path, bool isfile, std::string current_dir);
6166 std::vector<Directory> _dirs;
6267 std::string _fname;
6368 #ifdef _WIN32
64 char _drive;
69 char _drive=0;
6570 #endif
6671 };
6772
2222 #include <fstream>
2323 #include <iomanip>
2424 #include <sstream>
25 #include "CRC32.hpp"
2625 #include "FileSystem.hpp"
2726 #include "FontCache.hpp"
28 #include "Glyph.hpp"
2927 #include "Pair.hpp"
3028 #include "StreamReader.hpp"
3129 #include "StreamWriter.hpp"
30 #include "XXHashFunction.hpp"
3231
3332 using namespace std;
3433
7776 return true;
7877
7978 if (!fontname.empty()) {
80 string dirstr = dir.empty() ? FileSystem::getcwd() : dir;
81 ostringstream oss;
82 oss << dirstr << '/' << fontname << ".fgd";
83 ofstream ofs(oss.str(), ios::binary);
79 string pathstr = dir.empty() ? FileSystem::getcwd() : dir;
80 pathstr += "/" + fontname + ".fgd";
81 ofstream ofs(pathstr, ios::binary);
8482 return write(fontname, ofs);
8583 }
8684 return false;
9391
9492
9593 /** Returns the minimal number of bytes needed to store the given value. */
96 static int max_int_size (int32_t value) {
94 static int max_number_of_bytes (int32_t value) {
9795 int32_t limit = 0x7f;
9896 for (int i=1; i <= 4; i++) {
9997 if ((value < 0 && -value <= limit+1) || (value >= 0 && value <= limit))
103101 return 4;
104102 }
105103
106
107 /** Returns the minimal number of bytes needed to store the biggest
108 * pair component of the given vector. */
109 static int max_int_size (const Pair<int32_t> *pairs, size_t n) {
110 int ret=0;
111 for (size_t i=0; i < n; i++) {
112 ret = max(ret, max_int_size(pairs[i].x()));
113 ret = max(ret, max_int_size(pairs[i].y()));
114 }
115 return ret;
116 }
104 static int max_int_size () {
105 return 0;
106 }
107
108 template <typename ...Args>
109 static int max_int_size (const Glyph::Point &p1, const Args& ...args) {
110 int max1 = max(max_number_of_bytes(p1.x()), max_number_of_bytes(p1.y()));
111 return max(max1, max_int_size(args...));
112 }
113
114
115 struct WriteActions : Glyph::IterationActions {
116 WriteActions (StreamWriter &sw, HashFunction &hashfunc) : _sw(sw), _hashfunc(hashfunc) {}
117
118 using Point = Glyph::Point;
119 void moveto (const Point &p) override {write('M', p);}
120 void lineto (const Point &p) override {write('L', p);}
121 void quadto (const Point &p1, const Point &p2) override {write('Q', p1, p2);}
122 void cubicto (const Point &p1, const Point &p2, const Point &p3) override {write('C', p1, p2, p3); }
123 void closepath () override {write('Z');}
124
125 template <typename ...Args>
126 void write (char cmd, Args ...args) {
127 int bytesPerValue = max_int_size(args...);
128 int cmdchar = (bytesPerValue << 5) | (cmd - 'A');
129 _sw.writeUnsigned(cmdchar, 1, _hashfunc);
130 writeParams(bytesPerValue, args...);
131 }
132
133 static void writeParams (int bytesPerValue) {}
134
135 template <typename ...Args>
136 void writeParams (int bytesPerValue, const Point &p, const Args& ...args) {
137 _sw.writeSigned(p.x(), bytesPerValue, _hashfunc);
138 _sw.writeSigned(p.y(), bytesPerValue, _hashfunc);
139 writeParams(bytesPerValue, args...);
140 }
141
142 StreamWriter &_sw;
143 HashFunction &_hashfunc;
144 };
117145
118146
119147 /** Writes the current cache data to a stream (only if anything changed after
128156 return false;
129157
130158 StreamWriter sw(os);
131 CRC32 crc32;
132
133 struct WriteActions : Glyph::Actions {
134 WriteActions (StreamWriter &sw, CRC32 &crc32) : _sw(sw), _crc32(crc32) {}
135
136 void draw (char cmd, const Glyph::Point *points, int n) override {
137 int bytes = max_int_size(points, n);
138 int cmdchar = (bytes << 5) | (cmd - 'A');
139 _sw.writeUnsigned(cmdchar, 1, _crc32);
140 for (int i=0; i < n; i++) {
141 _sw.writeSigned(points[i].x(), bytes, _crc32);
142 _sw.writeSigned(points[i].y(), bytes, _crc32);
143 }
144 }
145 StreamWriter &_sw;
146 CRC32 &_crc32;
147 } actions(sw, crc32);
148
149 sw.writeUnsigned(FORMAT_VERSION, 1, crc32);
150 sw.writeUnsigned(0, 4); // space for checksum
151 sw.writeString(fontname, crc32, true);
152 sw.writeUnsigned(_glyphs.size(), 4, crc32);
159 XXH32HashFunction hashfunc;
160
161 sw.writeUnsigned(FORMAT_VERSION, 1, hashfunc);
162 sw.writeBytes(hashfunc.digestValue()); // space for checksum
163 sw.writeString(fontname, hashfunc, true);
164 sw.writeUnsigned(_glyphs.size(), 4, hashfunc);
165 WriteActions actions(sw, hashfunc);
153166 for (const auto &charglyphpair : _glyphs) {
154167 const Glyph &glyph = charglyphpair.second;
155 sw.writeUnsigned(charglyphpair.first, 4, crc32);
156 sw.writeUnsigned(glyph.size(), 2, crc32);
168 sw.writeUnsigned(charglyphpair.first, 4, hashfunc);
169 sw.writeUnsigned(glyph.size(), 2, hashfunc);
157170 glyph.iterate(actions, false);
158171 }
159172 os.seekp(1);
160 sw.writeUnsigned(crc32.get(), 4); // insert CRC32 checksum
173 auto digest = hashfunc.digestValue();
174 sw.writeBytes(digest); // insert checksum
161175 os.seekp(0, ios::end);
162176 return true;
163177 }
194208 return false;
195209
196210 StreamReader sr(is);
197 CRC32 crc32;
198 if (sr.readUnsigned(1, crc32) != FORMAT_VERSION)
199 return false;
200
201 uint32_t crc32_cmp = sr.readUnsigned(4);
202 crc32.update(is);
203 if (crc32.get() != crc32_cmp)
211 XXH32HashFunction hashfunc;
212 if (sr.readUnsigned(1, hashfunc) != FORMAT_VERSION)
213 return false;
214
215 auto hashcmp = sr.readBytes(hashfunc.digestSize());
216 hashfunc.update(is);
217 if (hashfunc.digestValue() != hashcmp)
204218 return false;
205219
206220 is.clear();
207 is.seekg(5); // continue reading after checksum
221 is.seekg(hashfunc.digestSize()+1); // continue reading after checksum
208222
209223 string fname = sr.readString();
210224 if (fname != fontname)
236250 case 'Q': {
237251 Pair32 p1 = read_pair(bytes, sr);
238252 Pair32 p2 = read_pair(bytes, sr);
239 glyph.conicto(p1, p2);
253 glyph.quadto(p1, p2);
240254 break;
241255 }
242256 case 'Z':
288302 is.seekg(0);
289303 try {
290304 StreamReader sr(is);
291 CRC32 crc32;
292 if ((info.version = sr.readUnsigned(1, crc32)) != FORMAT_VERSION)
305 XXH32HashFunction hashfunc;
306 if ((info.version = sr.readUnsigned(1, hashfunc)) != FORMAT_VERSION)
293307 return false;
294308
295 info.checksum = sr.readUnsigned(4);
296 crc32.update(is);
297 if (crc32.get() != info.checksum)
309 info.checksum = sr.readBytes(hashfunc.digestSize());
310 hashfunc.update(is);
311 if (hashfunc.digestValue() != info.checksum)
298312 return false;
299313
300314 is.clear();
301 is.seekg(5); // continue reading after checksum
315 is.seekg(hashfunc.digestSize()+1); // continue reading after checksum
302316
303317 info.name = sr.readString();
304318 info.numchars = sr.readUnsigned(4);
360374 << setw(5) << right << strinfopair.second->numchars << " glyph" << (strinfopair.second->numchars == 1 ? ' ':'s')
361375 << setw(10) << right << strinfopair.second->numcmds << " cmd" << (strinfopair.second->numcmds == 1 ? ' ':'s')
362376 << setw(12) << right << strinfopair.second->numbytes << " byte" << (strinfopair.second->numbytes == 1 ? ' ':'s')
363 << setw(6) << "crc:" << setw(8) << hex << right << setfill('0') << strinfopair.second->checksum
364 << endl;
377 << " hash:" << hex;
378 for (int byte : strinfopair.second->checksum)
379 os << setw(2) << setfill('0') << byte;
380 os << '\n';
365381 }
366382 }
367383 if (purge) {
2929 class FontCache {
3030 public:
3131 struct FontInfo {
32 std::string name; // fontname
33 uint16_t version; // file format version
34 uint32_t checksum; // CRC32 checksum of file data
35 uint32_t numchars; // number of characters
36 uint32_t numbytes; // number of bytes
37 uint32_t numcmds; // number of path commands
32 std::string name; // fontname
33 uint16_t version; // file format version
34 std::vector<uint8_t> checksum; // checksum of file data
35 uint32_t numchars; // number of characters
36 uint32_t numbytes; // number of bytes
37 uint32_t numcmds; // number of path commands
3838 };
3939
4040 public:
350350 }
351351
352352
353 static int conicto (FTVectorPtr control, FTVectorPtr to, void *user) {
353 static int quadto (FTVectorPtr control, FTVectorPtr to, void *user) {
354354 auto glyph = static_cast<Glyph*>(user);
355 glyph->conicto(control->x, control->y, to->x, to->y);
355 glyph->quadto(control->x, control->y, to->x, to->y);
356356 return 0;
357357 }
358358
365365
366366
367367 /** Traces the outline of a glyph by calling the corresponding "drawing" functions.
368 * Each glyph is composed of straight lines, quadratic (conic) or cubic B�zier curves.
368 * Each glyph is composed of straight lines, quadratic or cubic Bézier curves.
369369 * This function creates a Glyph object representing these graphics segments.
370370 * @param[in] face FreeType object representing the font to scan
371371 * @param[in] font corresponding Font object providing additional data
391391 if (style->bold != 0)
392392 FT_Outline_Embolden(&outline, style->bold/font->scaledSize()*face->units_per_EM);
393393 }
394 const FT_Outline_Funcs funcs = {moveto, lineto, conicto, cubicto, 0, 0};
394 const FT_Outline_Funcs funcs = {moveto, lineto, quadto, cubicto, 0, 0};
395395 FT_Outline_Decompose(&outline, &funcs, &glyph);
396396 return true;
397397 }
401401
402402
403403 /** Traces the outline of a glyph by calling the corresponding "drawing" functions.
404 * Each glyph is composed of straight lines, quadratic (conic) or cubic B�zier curves.
404 * Each glyph is composed of straight lines, quadratic or cubic Bézier curves.
405405 * This function creates a Glyph object representing these graphics segments.
406406 * @param[in] c the glyph of this character will be traced
407407 * @param[out] glyph resulting Glyph object containing the graphics segments
9494 }
9595
9696
97 struct SFDActions : Glyph::Actions {
97 struct SFDActions : Glyph::IterationActions {
9898 explicit SFDActions (ostream &os) : _os(os) {}
99 void draw (char cmd, const Glyph::Point *points, int n) override {
100 if (cmd == 'Q') {
101 // convert quadratic Bézier curve to cubic one
102 DPair p0(_currentPoint.x(), _currentPoint.y());
103 DPair p1(points[0].x(), points[0].y());
104 DPair p2(points[1].x(), points[1].y());
105 Bezier bezier(p0, p1, p2);
106 for (int i=1; i < 4; i++)
107 _os << lround(bezier.point(i).x()) << ' ' << lround(bezier.point(i).y()) << ' ';
108 _os << 'c';
109 }
110 else {
111 for (int i=0; i < n; i++)
112 _os << points[i].x() << ' ' << points[i].y() << ' ';
113 switch (cmd) {
114 case 'M': _os << 'm'; _startPoint = points[0]; break;
115 case 'L': _os << 'l'; break;
116 case 'C': _os << 'c'; break;
117 case 'Z': _os << _startPoint.x() << ' ' << _startPoint.y() << " l"; _currentPoint = _startPoint; break;
118 }
119 }
120 if (n > 0)
121 _currentPoint = points[n-1];
122 _os << " 0\n";
123 }
99
100 using Point = Glyph::Point;
101 void moveto (const Point &p) override {write('m', p);}
102 void lineto (const Point &p) override {write('l', p);}
103 void cubicto (const Point &p1, const Point &p2, const Point &p3) override {write('c', p1, p2, p3); }
104 void closepath () override {write('m', startPoint());}
105
106 void quadto (const Point &p1, const Point &p2) override {
107 // convert quadratic Bézier curve to cubic one
108 DPair pt0(currentPoint().x(), currentPoint().y());
109 DPair pt1(p1.x(), p1.y());
110 DPair pt2(p2.x(), p2.y());
111 Bezier b(pt0, pt1, pt2);
112 write('c', round(b.point(0)), round(b.point(1)), round(b.point(2)), round(b.point(3)));
113 }
114
115 template <typename ...Args>
116 void write (char cmd, const Args& ...args) {
117 writeParams(args...);
118 _os << cmd << " 0\n";
119 }
120
121 static void writeParams () {}
122
123 template <typename Pt, typename ...Args>
124 void writeParams (const Pt &p, const Args& ...args) const {
125 _os << p.x() << ' ' << p.y() << ' ';
126 writeParams(args...);
127 }
128
124129 ostream &_os;
125130 Glyph::Point _startPoint, _currentPoint;
126131 };
1717 ** along with this program; if not, see <http://www.gnu.org/licenses/>. **
1818 *************************************************************************/
1919
20 #ifndef GRAPHICSPATH_HPP
21 #define GRAPHICSPATH_HPP
22
20 #pragma once
21
22 #include <array>
2323 #include <cctype>
2424 #include <deque>
2525 #include <ostream>
26 #include <type_traits>
27 #include <mpark/variant.hpp>
2628 #include "BoundingBox.hpp"
29 #include "EllipticalArc.hpp"
2730 #include "Matrix.hpp"
2831 #include "Pair.hpp"
32 #include "utility.hpp"
2933 #include "XMLString.hpp"
34
35 template <typename T>
36 class GraphicsPath;
37
38 namespace gp {
39
40 /// Base class for all path data commands, like moveto, lineto, curveto, etc.
41 struct CommandBase {};
42
43 /** Base class for all path data commands with NUM_POINTS point parameters
44 * @tparam NUM_POINTS number of parameter pairs representing points, e.g. 1 for moveto and lineto */
45 template <typename T, int NUM_POINTS>
46 class Command : public CommandBase {
47 friend class GraphicsPath<T>;
48 public:
49 int numPoints () const {return NUM_POINTS;}
50 Pair<T>& point (int n) {return points[n];}
51 const Pair<T>& point (int n) const {return points[n];}
52
53 /** Transforms the command by a given transformation matrix.
54 * @params[in] matrix describes the affine transformation to apply
55 * @params[in] currentPoint the untransformed end point of the preceding command */
56 void transform (const Matrix &matrix, const Pair<T> &currentPoint) {
57 for (Pair<T> &p : points)
58 p = matrix * p;
59 }
60
61 /** Returns true if all points are identical to those of another command. */
62 bool pointsEqual (const Command &cmd) const {
63 for (int i=0; i < NUM_POINTS; i++)
64 if (points[i] != cmd.points[i])
65 return false;
66 return true;
67 }
68
69 protected:
70 explicit Command () =default;
71 explicit Command (std::array<Pair<T>, NUM_POINTS> &&pts) : points(std::move(pts)) {}
72
73 protected:
74 std::array<Pair<T>, NUM_POINTS> points;
75 };
76
77 template <typename T>
78 struct MoveTo : public Command<T, 1> {
79 explicit MoveTo (const Pair<T> &p) : Command<T, 1>({p}) {}
80 };
81
82 template <typename T>
83 struct LineTo : public Command<T, 1> {
84 explicit LineTo (const Pair<T> &p) : Command<T, 1>({p}) {}
85 };
86
87 template <typename T>
88 struct CubicTo : public Command<T, 3> {
89 explicit CubicTo (const Pair<T> &p1, const Pair<T> &p2, const Pair<T> &p3) : Command<T, 3>({p1, p2, p3}) {}
90 };
91
92 template <typename T>
93 struct QuadTo : public Command<T, 2> {
94 explicit QuadTo (const Pair<T> &p1, const Pair<T> &p2) : Command<T, 2>({p1, p2}) {}
95 };
96
97 template <typename T>
98 struct ClosePath : public Command<T, 0> {
99 ClosePath () : Command<T, 0>() {}
100 };
101
102 template <typename T>
103 struct ArcTo : Command<T, 1> {
104 ArcTo (T rxx, T ryy, double xrot, bool laf, bool sf, const Pair<T> &pp)
105 : Command<T, 1>({pp}), rx(rxx < 0 ? -rxx : rxx), ry(ryy < 0 ? -ryy : ryy),
106 xrotation(xrot), largeArcFlag(laf), sweepFlag(sf) {}
107
108 bool operator == (const ArcTo &arc) const {
109 return rx == arc.rx
110 && ry == arc.ry
111 && xrotation == arc.xrotation
112 && largeArcFlag == arc.largeArcFlag
113 && sweepFlag == arc.sweepFlag
114 && this->points[0] == arc.points[0];
115 }
116
117 void transform (const Matrix &matrix, const Pair<T> &currentPoint);
118
119 bool operator != (const ArcTo &arc) const {return !(*this == arc);}
120
121 T rx, ry; ///< length of the semi-major and semi-minor axes
122 double xrotation; ///< rotation of the semi-major axis in degrees
123 bool largeArcFlag; ///< if true, the longer arc from start to end point is chosen, else the shorter one
124 bool sweepFlag; ///< if true, arc is drawn in direction of positive angles, else the opposite direction
125 };
126
127 /** Applies an affine transformation described by a given matrix to the arc segment.
128 * @params[in] matrix describes the affine transformation to apply
129 * @params[in] currentPoint the untransformed end point of the preceding command */
130 template <typename T>
131 void ArcTo<T>::transform (const Matrix &matrix, const Pair<T> &currentPoint) {
132 EllipticalArc arc(currentPoint, rx, ry, math::deg2rad(xrotation), largeArcFlag, sweepFlag, this->points[0]);
133 arc.transform(matrix);
134 rx = arc.rx();
135 ry = arc.ry();
136 xrotation = math::rad2deg(arc.rotationAngle());
137 largeArcFlag = arc.largeArc();
138 sweepFlag = arc.sweepPositive();
139 this->points[0] = Pair<T>(arc.endPoint());
140 }
141
142 /** Returns true if two path command objects are identical (same command and same parameters). */
143 template <typename Cmd1, typename Cmd2>
144 inline typename std::enable_if<std::is_base_of<CommandBase, Cmd1>::value, bool>::type
145 operator == (const Cmd1 &cmd1, const Cmd2 &cmd2) {
146 if (std::is_convertible<Cmd1, Cmd2>::value && std::is_convertible<Cmd2, Cmd1>::value)
147 return cmd1.pointsEqual(cmd2);
148 return false;
149 }
150
151 /** Returns true if two path command objects differ (different commands or different parameters). */
152 template <typename Cmd1, typename Cmd2>
153 inline typename std::enable_if<std::is_base_of<CommandBase, Cmd1>::value, bool>::type
154 operator != (const Cmd1 &cmd1, const Cmd2 &cmd2) {
155 if (std::is_convertible<Cmd1, Cmd2>::value && std::is_convertible<Cmd2, Cmd1>::value)
156 return !cmd1.pointsEqual(cmd2);
157 return true;
158 }
159
160 } // namespace gp
30161
31162
32163 template <typename T>
36167 enum class WindingRule {EVEN_ODD, NON_ZERO};
37168 using Point = Pair<T>;
38169
39 struct Command {
40 enum class Type {MOVETO, LINETO, CONICTO, CUBICTO, CLOSEPATH};
41
42 explicit Command (Type t) : type(t) {}
43
44 Command (Type t, const Point &p) : type(t) {
45 params[0] = p;
46 }
47
48 Command (Type t, const Point &p1, const Point &p2) : type(t) {
49 params[0] = p1;
50 params[1] = p2;
51 }
52
53 Command (Type t, const Point &p1, const Point &p2, const Point &p3) : type(t) {
54 params[0] = p1;
55 params[1] = p2;
56 params[2] = p3;
57 }
58
59 int numParams () const {
60 switch (type) {
61 case Type::CLOSEPATH : return 0;
62 case Type::MOVETO :
63 case Type::LINETO : return 1;
64 case Type::CONICTO : return 2;
65 case Type::CUBICTO : return 3;
66 }
67 return 0;
68 }
69
70 void transform (const Matrix &matrix) {
71 for (int i=0; i < numParams(); i++)
72 params[i] = matrix * params[i];
73 }
74
75 bool operator == (const Command &cmd) const {
76 bool ret = (type == cmd.type);
77 for (int i=0; ret && i < numParams(); i++)
78 ret &= (params[i] == cmd.params[i]);
79 return ret;
80 }
81
82 bool operator != (const Command &cmd) const {
83 bool ret = (type != cmd.type);
84 for (int i=0; !ret && i < numParams(); i++)
85 ret |= (params[i] != cmd.params[i]);
86 return ret;
87 }
88
89 Type type;
90 Point params[3];
170 protected:
171
172 static XMLString to_param_str (double v, double s, double d, bool leadingSpace) {
173 XMLString str(v*s + d);
174 if (leadingSpace && (str[0] != '-'))
175 str.insert(0, " ");
176 return str;
177 }
178
179 static XMLString to_param_str (double val, double prev, double s, double d, bool leadingSpace) {
180 XMLString str((val-prev)*s + d);
181 if (leadingSpace && (str[0] != '-'))
182 str.insert(0, " ");
183 return str;
184 }
185
186 static std::string to_param_str (const Point &p, double sx, double sy, double dx, double dy, bool leadingSpace) {
187 return to_param_str(p.x(), sx, dx, leadingSpace) + to_param_str(p.y(), sy, dy, true);
188 }
189
190 static std::string to_param_str (const Point &p, const Point &prev, double sx, double sy, double dx, double dy, bool leadingSpace) {
191 return to_param_str(p.x()-prev.x(), sx, dx, leadingSpace) + to_param_str(p.y()-prev.y(), sy, dy, true);
192 }
193
194 using MoveTo = gp::MoveTo<T>;
195 using LineTo = gp::LineTo<T>;
196 using CubicTo = gp::CubicTo<T>;
197 using QuadTo = gp::QuadTo<T>;
198 using ArcTo = gp::ArcTo<T>;
199 using ClosePath = gp::ClosePath<T>;
200
201 /// Variant representing a single path command
202 using CommandVariant = mpark::variant<MoveTo, LineTo, CubicTo, QuadTo, ArcTo, ClosePath>;
203
204 class IterationVisitor;
205
206 public:
207 /** Base class providing several template methods being called when executing
208 * GraphicsPath::iterate(). */
209 class IterationActions {
210 friend class IterationVisitor;
211 public:
212 virtual ~IterationActions () =default;
213 virtual void moveto (const Point &p) {}
214 virtual void lineto (const Point &p) {}
215 virtual void hlineto (const T &x) {}
216 virtual void vlineto (const T &y) {}
217 virtual void quadto (const Point &p) {}
218 virtual void quadto (const Point &p1, const Point &p2) {}
219 virtual void cubicto (const Point &p1, const Point &p2) {}
220 virtual void cubicto (const Point &p1, const Point &p2, const Point &p3) {}
221 virtual void arcto (T rx, T ry, double angle, bool largeArcFlag, bool sweepFlag, const Point &p) {}
222 virtual void closepath () {}
223 virtual bool quit () {return false;}
224 virtual void finished () {}
225 const Point& startPoint () const {return _startPoint;}
226 const Point& currentPoint () const {return _currentPoint;}
227
228 private:
229 Point _startPoint; ///< first point of the current sub-path
230 Point _currentPoint; ///< point reached by preceding path command, or (0,0) otherwise
91231 };
92232
93 struct Actions {
94 virtual ~Actions () =default;
95 virtual void moveto (const Point &p) {}
96 virtual void lineto (const Point &p) {}
97 virtual void hlineto (const T &y) {}
98 virtual void vlineto (const T &x) {}
99 virtual void conicto (const Point &p) {}
100 virtual void conicto (const Point &p1, const Point &p2) {}
101 virtual void cubicto (const Point &p1, const Point &p2) {}
102 virtual void cubicto (const Point &p1, const Point &p2, const Point &p3) {}
103 virtual void closepath () {}
104 virtual void draw (char cmd, const Point *points, int n) {}
105 virtual bool quit () {return false;}
106 virtual void finished () {}
233 protected:
234 class ModificationActions : public IterationActions {
235 friend class GraphicsPath;
236 public:
237 explicit ModificationActions (GraphicsPath &path) : _path(path) {}
238
239 protected:
240 GraphicsPath& path () {return _path;}
241 int commandPos () const {return _commandPos;}
242
243 private:
244 GraphicsPath &_path;
245 int _commandPos=0; ///< number of command in path being processed
246 };
247
248 class WriteActions : public IterationActions {
249 public:
250 WriteActions (std::ostream &os, bool rel, double sx, double sy, double dx, double dy)
251 : _os(os), _relative(rel), _sx(sx), _sy(sy), _dx(dx), _dy(dy) {}
252
253 void moveto (const Point &p) override {write('M', {p});}
254 void lineto (const Point &p) override {write('L', {p});}
255 void hlineto (const T &x) override {write('H', x, this->currentPoint().x(), _sx, _dx);}
256 void vlineto (const T &y) override {write('V', y, this->currentPoint().y(), _sy, _dy);}
257 void quadto (const Point &p) override {write('T', {p});}
258 void quadto (const Point &p1, const Point &p2) override {write('Q', {p1, p2});}
259 void cubicto (const Point &p1, const Point &p2) override {write('S', {p1, p2});}
260 void cubicto (const Point &p1, const Point &p2, const Point &p3) override {write('C', {p1, p2, p3});}
261 void closepath () override {_os << (_relative ? 'z' : 'Z');}
262
263 void arcto (T rx, T ry, double angle, bool largeArcFlag, bool sweepFlag, const Point &p) override {
264 Point diff = p-this->currentPoint();
265 if (std::abs(diff.x()) < 1e-7 && std::abs(diff.y()) < 1e-7)
266 return;
267 if (std::abs(rx) < 1e-7 && std::abs(ry) < 1e-7)
268 lineto(p);
269 else {
270 if (std::abs(std::abs(_sx) - std::abs(_sy)) < 1e-7) { // symmetric scaling?
271 angle *= math::sgn(_sx) * math::sgn(_sy);
272 rx *= std::abs(_sx);
273 ry *= std::abs(_sx);
274 }
275 else { // asymmetric scaling => compute new shape parameters
276 EllipticalArc arc(this->currentPoint(), double(rx), double(ry), math::deg2rad(angle), largeArcFlag, sweepFlag, p);
277 arc.transform(ScalingMatrix(_sx, _sy));
278 angle = math::rad2deg(arc.rotationAngle());
279 rx = arc.rx();
280 ry = arc.ry();
281 }
282 _os << (_relative ? 'a' : 'A')
283 << to_param_str(rx, 1.0, 0, false)
284 << to_param_str(ry, 1.0, 0, true)
285 << to_param_str(angle, 1.0, 0, true)
286 << ' ' << (largeArcFlag ? 1 : 0)
287 << ' ' << (sweepFlag ? 1 : 0);
288 if (_relative)
289 _os << to_param_str(p, this->currentPoint(), _sx, _sy, _dx, _dy, true);
290 else
291 _os << to_param_str(p, _sx, _sy, _dx, _dy, true);
292 }
293 }
294
295 protected:
296 void write (char cmdchar, std::initializer_list<Point> points) const {
297 int count=0;
298 if (_relative) {
299 _os << char(tolower(cmdchar));
300 for (const Point &p : points)
301 _os << to_param_str(p, this->currentPoint(), _sx, _sy, _dx, _dy, count++ > 0);
302 }
303 else {
304 _os << cmdchar;
305 for (const Point &p : points)
306 _os << to_param_str(p, _sx, _sy, _dx, _dy, count++ > 0);
307 }
308 }
309
310 void write (char cmdchar, T val, T relval, double s, double d) const {
311 if (_relative)
312 _os << char(tolower(cmdchar)) << to_param_str(val, relval, s, d, false);
313 else
314 _os << cmdchar << to_param_str(val, s, d, false);
315 }
316
317 private:
318 std::ostream &_os; ///< write output to this stream
319 bool _relative; ///< if true, use relative coordinates in path commands
320 double _sx, _sy; ///< horizontal and vertical scaling factors
321 double _dx, _dy; ///< horizontal and vertical translation values
322 };
323
324 ///////////////////////////////////////////////////////////////////////////////
325
326 /** Calls the corresponding template method of an Action object for the current path command.
327 * If parameter 'useShortCmds' is true, the visitor operators check whether a command
328 * can be shortened due to special cases, e.g. horizontal or vertical lines, smooth
329 * curve connections etc. Otherwise, the full command templates are triggered. */
330 class IterationVisitor {
331 public:
332 IterationVisitor (IterationActions &actions, bool useShortCmds, double eps=1e-7)
333 : _actions(actions), _shortCommandsActive(useShortCmds), _eps(eps) {}
334
335 void setPrevCommand (const CommandVariant &prevCommand) {
336 _prevCommand = &prevCommand;
337 }
338
339 void operator () (const MoveTo &cmd) {
340 _actions.moveto(cmd.points[0]);
341 _actions._startPoint = _actions._currentPoint = cmd.points[0];
342 }
343
344 void operator () (const LineTo &cmd) {
345 Point diff = abs(_actions._currentPoint-cmd.points[0]);
346 if (diff.x() >= _eps || diff.y() >= _eps) {
347 if (!_shortCommandsActive)
348 _actions.lineto(cmd.points[0]);
349 else {
350 if (diff.x() < _eps)
351 _actions.vlineto(cmd.points[0].y());
352 else if (diff.y() < _eps)
353 _actions.hlineto(cmd.points[0].x());
354 else
355 _actions.lineto(cmd.points[0]);
356 }
357 }
358 _actions._currentPoint = cmd.points[0];
359 }
360
361 void operator () (const CubicTo &cmd) {
362 bool smooth=false;
363 if (_shortCommandsActive) {
364 if (auto *prevCubic = mpark::get_if<CubicTo>(_prevCommand)) {
365 Point diff = abs(cmd.points[0] - prevCubic->points[2]*T(2) + prevCubic->points[1]);
366 if ((smooth = (diff.x() < _eps && diff.y() < _eps)))
367 _actions.cubicto(cmd.points[1], cmd.points[2]);
368 }
369 }
370 if (!smooth)
371 _actions.cubicto(cmd.points[0], cmd.points[1], cmd.points[2]);
372 _actions._currentPoint = cmd.points[2];
373 }
374
375 void operator () (const QuadTo &cmd) {
376 bool smooth=false;
377 if (_shortCommandsActive) {
378 if (auto *prevQuad = mpark::get_if<QuadTo>(_prevCommand)) {
379 Point diff = abs(cmd.points[0] - prevQuad->points[1] * T(2) + prevQuad->points[0]);
380 if ((smooth = (diff.x() < _eps && diff.y() < _eps))) // is reflection?
381 _actions.quadto(cmd.points[1]);
382 }
383 }
384 if (!smooth)
385 _actions.quadto(cmd.points[0], cmd.points[1]);
386 _actions._currentPoint = cmd.points[1];
387 }
388
389 void operator () (const ClosePath &cmd) {
390 _actions.closepath();
391 _actions._currentPoint = _actions._startPoint;
392 }
393
394 void operator () (const ArcTo &cmd) {
395 _actions.arcto(cmd.rx, cmd.ry, cmd.xrotation, cmd.largeArcFlag, cmd.sweepFlag, cmd.points[0]);
396 _actions._currentPoint = cmd.points[0];
397 }
398
399 private:
400 IterationActions &_actions;
401 bool _shortCommandsActive=false;
402 double _eps=1e-7;
403 const CommandVariant *_prevCommand=nullptr;
404 };
405
406 ///////////////////////////////////////////////////////////////////////////////
407
408 /** Transforms all Point parameters of a path command. */
409 class TransformVisior {
410 public:
411 explicit TransformVisior (const Matrix &m) : matrix(m) {}
412
413 template <typename Cmd> void operator () (Cmd &cmd) {
414 Point cp = cmd.point(cmd.numPoints()-1);
415 cmd.transform(matrix, _currentPoint);
416 _currentPoint = cp;
417 }
418
419 void operator () (MoveTo &cmd) {
420 Point cp = cmd.point(0);
421 cmd.transform(matrix, _currentPoint);
422 _startPoint = _currentPoint = cp;
423 }
424
425 void operator () (ClosePath &cmd) {
426 _currentPoint = _startPoint;
427 }
428
429 private:
430 const Matrix &matrix;
431 Point _startPoint, _currentPoint; ///< untransformed start end current point
107432 };
108433
109434 public:
126451 return _commands.size();
127452 }
128453
454 const Point& startPoint () const {return _startPoint;}
455 const Point& finalPoint () const {return _finalPoint;}
456
129457 /// Insert another path at the beginning of this one.
130458 void prepend (const GraphicsPath &path) {
131459 _commands.insert(_commands.begin(), path._commands.begin(), path._commands.end());
137465
138466 void moveto (const Point &p) {
139467 // avoid sequences of several MOVETOs; always use latest
140 if (_commands.empty() || _commands.back().type != Command::Type::MOVETO)
141 _commands.emplace_back(Command(Command::Type::MOVETO, p));
468 if (_commands.empty() || !mpark::get_if<MoveTo>(&_commands.back()))
469 _commands.emplace_back(MoveTo{p});
142470 else
143 _commands.back().params[0] = p;
471 mpark::get<MoveTo>(_commands.back()).points[0] = p;
472 _startPoint = _finalPoint = p;
144473 }
145474
146475 void lineto (const T &x, const T &y) {
148477 }
149478
150479 void lineto (const Point &p) {
151 _commands.emplace_back(Command(Command::Type::LINETO, p));
152 }
153
154 void conicto (const T &x1, const T &y1, const T &x2, const T &y2) {
155 conicto(Point(x1, y1), Point(x2, y2));
156 }
157
158 void conicto (const Point &p1, const Point &p2) {
159 _commands.emplace_back(Command(Command::Type::CONICTO, p1, p2));
480 _commands.emplace_back(LineTo{p});
481 _finalPoint = p;
482 }
483
484 void quadto (const T &x1, const T &y1, const T &x2, const T &y2) {
485 quadto(Point(x1, y1), Point(x2, y2));
486 }
487
488 /** Creates a quadratic Bézier segment. */
489 void quadto (const Point &p1, const Point &p2) {
490 _commands.emplace_back(QuadTo{p1, p2});
491 _finalPoint = p2;
492 }
493
494 /** Creates a quadratic Bézier segment smoothly extending a preceding one, i.e. the gradients
495 * of the two curves are identical at the connection point. The control point of the second
496 * curve is computed as the reflection of the preceding curve's control point at the connection
497 * point. */
498 void quadto (const Point &p2) {
499 Point p1;
500 if (!_commands.empty()) {
501 if (auto qto = mpark::get_if<QuadTo>(&_commands.back()))
502 p1 = _finalPoint*T(2) - qto->point(0); // reflect previous control point at current point
503 else // previous command isn't a quadto?
504 p1 = _finalPoint; // => use current point as control point
505 }
506 quadto(p1, p2);
160507 }
161508
162509 void cubicto (const T &x1, const T &y1, const T &x2, const T &y2, const T &x3, const T &y3) {
163510 cubicto(Point(x1, y1), Point(x2, y2), Point(x3, y3));
164511 }
165512
513 /** Creates a cubic Bézier segment. */
166514 void cubicto (const Point &p1, const Point &p2, const Point &p3) {
167 _commands.emplace_back(Command(Command::Type::CUBICTO, p1, p2, p3));
515 _commands.emplace_back(CubicTo{p1, p2, p3});
516 _finalPoint = p3;
517 }
518
519 /** Creates a cubic Bézier segment smoothly extending a preceding one, i.e. the gradients
520 * of the two curves are identical at the connection point. The first control point of
521 * the second curve is computed as the reflection of the preceding curve's second control
522 * point at the connection point. */
523 void cubicto (const Point &p2, const Point &p3) {
524 Point p1;
525 if (!_commands.empty()) {
526 if (auto cto = mpark::get_if<CubicTo>(&_commands.back()))
527 p1 = _finalPoint*T(2) - cto->point(1); // reflect previous control point at current point
528 else // previous command isn't a cubicto?
529 p1 = _finalPoint; // => use current point as control point
530 }
531 cubicto(p1, p2, p3);
168532 }
169533
170534 void closepath () {
171 _commands.emplace_back(Command(Command::Type::CLOSEPATH));
172 }
173
174 const std::vector<Command>& commands () const {
175 return _commands;
176 }
177
535 if (!_commands.empty() && !mpark::get_if<ClosePath>(&_commands.back())) {
536 _commands.emplace_back(ClosePath{});
537 _finalPoint = _startPoint;
538 }
539 }
540
541 void arcto (double rx, double ry, double angle, bool laf, bool sweep, const Point &p) {
542 _commands.emplace_back(ArcTo{rx, ry, angle, laf, sweep, p});
543 _finalPoint = p;
544 }
178545
179546 /** Detects all open subpaths and closes them by adding a closePath command.
180547 * Most font formats only support closed outline paths so there are no explicit closePath statements
181548 * in the glyph's outline description. All open paths are automatically closed by the renderer.
182549 * This method detects all open paths and adds the missing closePath statement. */
183550 void closeOpenSubPaths () {
184 Command *prevCommand=0;
551 CommandVariant *prevCmd = nullptr;
185552 for (auto it=_commands.begin(); it != _commands.end(); ++it) {
186 if (it->type == Command::Type::MOVETO && prevCommand && prevCommand->type != Command::Type::CLOSEPATH) {
187 prevCommand = &(*it);
188 it = _commands.insert(it, Command(Command::Type::CLOSEPATH))+1;
553 if (mpark::get_if<MoveTo>(&*it) && prevCmd && !mpark::get_if<ClosePath>(prevCmd)) {
554 prevCmd = &*it;
555 it = _commands.insert(it, ClosePath{})+1;
189556 }
190557 else
191 prevCommand = &(*it);
192 }
193 if (!_commands.empty() && _commands.back().type != Command::Type::CLOSEPATH)
558 prevCmd = &*it;
559 }
560 if (!_commands.empty() && !mpark::get_if<ClosePath>(&_commands.back()))
194561 closepath();
195562 }
196563
197
198 /** Removes redundant path commands commands. Currently, it only removes movetos. */
564 /** Removes redundant path commands commands. Currently, only removes movetos. */
199565 void removeRedundantCommands () {
200566 // remove trailing moveto commands
201 while (!_commands.empty() && _commands.back().type == Command::Type::MOVETO)
567 while (!_commands.empty() && mpark::get_if<MoveTo>(&_commands.back()))
202568 _commands.pop_back();
203569 // resolve intermediate sequences of moveto commands
204570 auto it=_commands.begin();
206572 return;
207573 auto prev = it++;
208574 while (it != _commands.end()) {
209 if (prev->type != Command::Type::MOVETO || it->type != Command::Type::MOVETO)
575 if (!mpark::get_if<MoveTo>(&*prev) || !mpark::get_if<MoveTo>(&*it))
210576 prev = it++;
211577 else {
212578 prev = _commands.erase(prev); // remove leading MOVETO and advance 'prev' to 'it'
214580 }
215581 }
216582 }
217
218583
219584 /** Writes the path data as SVG path drawing command to a given output stream.
220585 * @param[in] os output stream used to write the SVG commands to
224589 * @param[in] dx horizontal translation in PS point units
225590 * @param[in] dy vertical translation in PS point units */
226591 void writeSVG (std::ostream &os, bool relative, double sx=1.0, double sy=1.0, double dx=0.0, double dy=0.0) const {
227 struct WriteActions : Actions {
228 WriteActions (std::ostream &os, bool relative, double sx, double sy, double dx, double dy)
229 : _os(os), _relative(relative), _sx(sx), _sy(sy), _dx(dx), _dy(dy) {}
230
231 void draw (char cmd, const Point *points, int n) override {
232 if (_relative)
233 cmd = tolower(cmd);
234 _os << cmd;
235 switch (cmd) {
236 case 'h': _os << XMLString(_sx*(points->x()-_currentPoint.x())+_dx); break;
237 case 'v': _os << XMLString(_sy*(points->y()-_currentPoint.y())+_dy); break;
238 case 'z': _currentPoint = _startPoint; break;
239 case 'H': _os << XMLString(_sx*points->x()+_dx); break;
240 case 'V': _os << XMLString(_sy*points->y()+_dy); break;
241 default : {
242 for (int i=0; i < n; i++) {
243 Point p = points[i];
244 if (_relative)
245 p -= _currentPoint;
246 double x = _sx*p.x() + _dx;
247 XMLString xstr(x);
248 if (i > 0 && (xstr[0] != '-')) // space required to separate numbers?
249 _os << ' ';
250 _os << xstr;
251 double y = _sy*p.y() + _dy;
252 XMLString ystr(y);
253 if (ystr[0] != '-') // space required to separate numbers?
254 _os << ' ';
255 _os << ystr;
256 }
257 }
258 }
259 if (cmd == 'm')
260 _startPoint = points[0];
261 if (islower(cmd) && n > 0)
262 _currentPoint = points[n-1];
263 }
264 std::ostream &_os;
265 bool _relative;
266 double _sx, _sy, _dx, _dy;
267 Point _startPoint, _currentPoint;
268 } actions(os, relative, sx, sy, dx, dy);
592 WriteActions actions(os, relative, sx, sy, dx, dy);
269593 iterate(actions, true);
270594 }
271
272 #if 0
273 void writePS (std::ostream &os, double sx=1.0, double sy=1.0, double dx=0.0, double dy=0.0) const {
274 struct WriteActions : Actions {
275 WriteActions (std::ostream &os, double sx, double sy, double dx, double dy)
276 : _os(os), _sx(sx), _sy(sy), _dx(dx), _dy(dy) {}
277 void draw (char cmd, const Point *points, int n) {
278 for (int i=0; i < n; i++)
279 _os << _sx*points[i].x()+_dx << ' ' << _sy*points[i].y()+_dy << ' ';
280 switch (cmd) {
281 case 'M': _os << "moveto"; break;
282 case 'L': _os << "lineto"; break;
283 case 'C': _os << "curveto"; break;
284 case 'Z': _os << "closepath"; break;
285 default: ;
286 }
287 _os << '\n';
288 }
289 std::ostream &_os;
290 bool _relative;
291 double _sx, _sy, _dx, _dy;
292 } actions(os, sx, sy, dx, dy);
293 iterate(actions, false);
294 }
295 #endif
296
297595
298596 /** Computes the bounding box of the current path.
299597 * @param[out] bbox the computed bounding box */
300598 void computeBBox (BoundingBox &bbox) const {
301 struct BBoxActions : Actions {
599 struct BBoxActions : IterationActions {
302600 explicit BBoxActions (BoundingBox &bb) : bbox(bb) {}
303601 void moveto (const Point &p) override {bbox.embed(p);}
304602 void lineto (const Point &p) override {bbox.embed(p);}
305 void conicto (const Point &p1, const Point &p2) override {bbox.embed(p1); bbox.embed(p2);}
603 void quadto (const Point &p1, const Point &p2) override {bbox.embed(p1); bbox.embed(p2);}
306604 void cubicto (const Point &p1, const Point &p2, const Point &p3) override {bbox.embed(p1); bbox.embed(p2); bbox.embed(p3);}
605 void arcto (T rx, T ry, double angle, bool laf, bool sweep, const Point &p) override {
606 bbox.embed(EllipticalArc(this->currentPoint(), double(rx), double(ry), angle, laf, sweep, p).getBBox());
607 }
307608 BoundingBox &bbox;
308609 } actions(bbox);
309610 iterate(actions, false);
310611 }
311
312612
313613 /** Checks whether the current path describes a dot/point only (with no extent).
314614 * @param[out] p coordinates of the point if path describes a dot
315615 * @return true if path is a dot/point */
316616 bool isDot (Point &p) const {
317 struct DotActions : Actions {
617 struct DotActions : IterationActions {
318618 DotActions () : differs(false) {}
319619 void moveto (const Point &p) override {point = p;}
320620 void lineto (const Point &p) override {differs = (p != point);}
321 void conicto (const Point &p1, const Point &p2) override {differs = (point != p1 || point != p2);}
621 void quadto (const Point &p1, const Point &p2) override { differs = (point != p1 || point != p2);}
322622 void cubicto (const Point &p1, const Point &p2, const Point &p3) override {differs = (point != p1 || point != p2 || point != p3);}
623 void arcto (T rx, T ry, double angle, bool largeArcFlag, bool sweepFlag, const Point &p) override { differs = (point != p);}
323624 bool quit () override {return differs;}
324625 Point point;
325626 bool differs;
329630 return !actions.differs;
330631 }
331632
633 /** Replaces all elliptic arcs with cubic Bézier curves. */
634 void approximateArcs () {
635 struct ArcActions : ModificationActions {
636 explicit ArcActions (GraphicsPath &path) : ModificationActions(path) {}
637 void arcto (T rx, T ry, double angle, bool largeArcFlag, bool sweepFlag, const Point &p) override {
638 EllipticalArc arc(this->currentPoint(), rx, ry, angle, largeArcFlag, sweepFlag, p);
639 std::vector<CommandVariant> cmds;
640 for (const Bezier &bezier : arc.approximate())
641 cmds.emplace_back(CubicTo{bezier.point(1), bezier.point(2), bezier.point(3)});
642 this->path().replace(this->commandPos(), cmds);
643 }
644 } actions(*this);
645 iterate(actions);
646 }
332647
333648 /** Transforms the path according to a given Matrix.
334649 * @param[in] matrix Matrix describing the affine transformation */
335650 void transform (const Matrix &matrix) {
336 for (Command &command : _commands)
337 command.transform(matrix);
338 }
339
340
651 TransformVisior visior(matrix);
652 for (CommandVariant &command : _commands)
653 mpark::visit(visior, command);
654 }
655
656 /** Returns true if this path equals another one, i.e. it consists the same sequence
657 * of commands and coordinates. */
341658 bool operator == (const GraphicsPath &path) const {
342659 if (size() != path.size())
343660 return false;
344661 auto it = _commands.begin();
345 for (const Command &cmd : path._commands) {
662 for (const auto &cmd : path._commands) {
346663 if (*it++ != cmd)
347664 return false;
348665 }
349666 return true;
350667 }
351668
352
669 /** Returns true if this path differs from another one (command-wise). */
353670 bool operator != (const GraphicsPath &path) const {
354671 if (size() != path.size())
355672 return true;
356673 auto it = _commands.begin();
357 for (const Command &cmd : path._commands) {
674 for (const auto &cmd : path._commands) {
358675 if (*it++ != cmd)
359676 return true;
360677 }
361678 return false;
362679 }
363680
364
365 void iterate (Actions &actions, bool optimize) const;
681 /** Iterates over all commands defining this path and calls the corresponding template methods.
682 * In the case of successive bezier curve sequences, control points or tangent slopes are often
683 * identical so that the path description contains redundant information. SVG provides shorthand
684 * curve commands that require less parameters. If 'optimize' is true, this method detects such
685 * command sequences.
686 * @param[in] actions template methods called by each iteration step
687 * @param[in] optimize if true, shorthand drawing commands (hlineto, vlineto,...) are considered */
688 void iterate (IterationActions &actions, bool optimize) const {
689 double eps = XMLString::DECIMAL_PLACES > 0 ? pow(10, -XMLString::DECIMAL_PLACES) : 1e-7;
690 IterationVisitor visitor(actions, optimize, eps);
691 for (const CommandVariant &cmd : _commands) {
692 if (actions.quit())
693 break;
694 mpark::visit(visitor, cmd);
695 visitor.setPrevCommand(cmd);
696 }
697 actions.finished();
698 }
699
700 protected:
701 /** Replaces a command by a sequence of other ones.
702 * @param[in] pos position of command to replace (0-based)
703 * @param[in] cmds commands to insert */
704 void replace (int pos, const std::vector<CommandVariant> &cmds) {
705 auto it = _commands.end();
706 if (!_commands.empty()) {
707 it = _commands.begin()+pos;
708 it = _commands.erase(it);
709 }
710 _commands.insert(it, cmds.begin(), cmds.end());
711 }
712
713 /** Iterates over all commands of the path and calls the corresponding template methods.
714 * In contrast to the public iterate() method, this one allows to modify the command sequence.
715 * @param[in] actions template methods called by each iteration step */
716 void iterate (ModificationActions &actions) {
717 IterationVisitor visitor(actions, false);
718 // no iterators here since they may be invalidated during path modifications
719 for (size_t i=0; i < _commands.size(); i++) {
720 if (actions.quit())
721 break;
722 actions._commandPos = i;
723 mpark::visit(visitor, _commands[i]);
724 visitor.setPrevCommand(_commands[i]);
725 }
726 actions.finished();
727 }
366728
367729 private:
368 std::deque<Command> _commands;
730 std::deque<CommandVariant> _commands; ///< sequence of path commands
369731 WindingRule _windingRule;
732 Point _startPoint; ///< start point of final sub-path
733 Point _finalPoint; ///< final point reached by last command in path
370734 };
371
372
373 /** Iterates over all commands defining this path and calls the corresponding template methods.
374 * In the case of successive bezier curve sequences, control points or tangent slopes are often
375 * identical so that the path description contains redundant information. SVG provides shorthand
376 * curve commands that require less parameters. If 'optimize' is true, this method detects such
377 * command sequences.
378 * @param[in] actions template methods called by each iteration step
379 * @param[in] optimize if true, shorthand drawing commands (hlineto, vlineto,...) are considered */
380 template <typename T>
381 void GraphicsPath<T>::iterate (Actions &actions, bool optimize) const {
382 auto prev = _commands.end(); // pointer to preceding command
383 Point fp; // first point of current path
384 Point cp; // current point
385 Point pstore[2];
386 const double eps = XMLString::DECIMAL_PLACES > 0 ? pow(10, -XMLString::DECIMAL_PLACES) : 1e-7;
387 for (auto it=_commands.begin(); it != _commands.end() && !actions.quit(); ++it) {
388 const Point *params = it->params;
389 switch (it->type) {
390 case Command::Type::MOVETO:
391 actions.moveto(params[0]);
392 actions.draw('M', params, 1);
393 fp = params[0];
394 break;
395 case Command::Type::LINETO: {
396 Point diff = abs(cp - params[0]);
397 if (diff.x() < eps && diff.y() < eps)
398 break;
399 if (optimize) {
400 if (diff.x() < eps) {
401 actions.vlineto(params[0].y());
402 actions.draw('V', params, 1);
403 }
404 else if (diff.y() < eps) {
405 actions.hlineto(params[0].x());
406 actions.draw('H', params, 1);
407 }
408 else {
409 actions.lineto(params[0]);
410 actions.draw('L', params, 1);
411 }
412 }
413 else {
414 actions.lineto(params[0]);
415 actions.draw('L', params, 1);
416 }
417 break;
418 }
419 case Command::Type::CONICTO: {
420 // check if first control point is the reflection of the preceding second control point?
421 Point diff = abs(params[0]-pstore[1]*T(2)+pstore[0]);
422 bool isReflection = diff.x() < eps && diff.y() < eps;
423 if (optimize && prev != _commands.end() && prev->type == Command::Type::CONICTO && isReflection) {
424 actions.conicto(params[1]);
425 actions.draw('T', params+1, 1);
426 }
427 else {
428 actions.conicto(params[0], params[1]);
429 actions.draw('Q', params, 2);
430 }
431 pstore[0] = params[0]; // store control point and
432 pstore[1] = params[1]; // curve endpoint
433 break;
434 }
435 case Command::Type::CUBICTO: {
436 // check if first control point is the reflection of the preceding second control point?
437 Point diff = abs(params[0]-pstore[1]*T(2)+pstore[0]);
438 bool isReflection = diff.x() < eps && diff.y() < eps;
439 // is first control point reflection of preceding second control point?
440 if (optimize && prev != _commands.end() && prev->type == Command::Type::CUBICTO && isReflection) {
441 actions.cubicto(params[1], params[2]);
442 actions.draw('S', params+1, 2);
443 }
444 else {
445 actions.cubicto(params[0], params[1], params[2]);
446 actions.draw('C', params, 3);
447 }
448 pstore[0] = params[1]; // store second control point and
449 pstore[1] = params[2]; // curve endpoint
450 break;
451 }
452 case Command::Type::CLOSEPATH:
453 actions.closepath();
454 actions.draw('Z', params, 0);
455 cp = fp;
456 }
457 // update current point
458 const int np = it->numParams();
459 if (np > 0)
460 cp = it->params[np-1];
461 prev = it;
462 }
463 actions.finished();
464 }
465
466 #endif
3030
3131 /** Returns a vector containing the names of the currently supported hash algorithms. */
3232 vector<string> HashFunction::supportedAlgorithms () {
33 return vector<string> {"md5", "xxh32", "xxh64"};
33 return vector<string> {
34 "md5", "xxh32", "xxh64",
35 #ifdef ENABLE_XXH128
36 "xxh128"
37 #endif
38 };
3439 }
3540
3641
5156 return util::make_unique<XXH32HashFunction>();
5257 if (lowerName == "xxh64")
5358 return util::make_unique<XXH64HashFunction>();
59 #ifdef ENABLE_XXH128
60 if (lowerName == "xxh128")
61 return util::make_unique<XXH128HashFunction>();
62 #endif
5463 return nullptr;
5564 }
5665
7382 }
7483
7584
85 void HashFunction::update (istream &is) {
86 char buf[4096];
87 while (is) {
88 is.read(buf, 4096);
89 update(buf, is.gcount());
90 }
91 }
92
93
7694 /** Returns the current digest as hexadecimal value. */
7795 string HashFunction::digestString () const {
7896 ostringstream oss;
2020 #ifndef HASHFUNCTION_HPP
2121 #define HASHFUNCTION_HPP
2222
23 #include <istream>
2324 #include <memory>
2425 #include <string>
2526 #include <vector>
3435 virtual void update (const std::string &data) =0;
3536 virtual void update (const std::vector<uint8_t> &data) =0;
3637 virtual std::vector<uint8_t> digestValue () const =0;
38 void update (std::istream &is);
3739 std::string digestString () const;
3840 static std::vector<std::string> supportedAlgorithms ();
3941 static bool isSupportedAlgorithm (const std::string &algo);
9595 uri = "#loc"+XMLString(id);
9696 if (actions.getCurrentPageNumber() != it->second.pageno) {
9797 ostringstream oss;
98 oss << actions.getSVGFilename(it->second.pageno) << uri;
98 oss << actions.getSVGFilePath(it->second.pageno).relative() << uri;
9999 uri = oss.str();
100100 }
101101 }
8484 _svg.setBBox(_bbox);
8585 _svg.appendToDoc(util::make_unique<XMLComment>(" This file was generated by dvisvgm " + string(PROGRAM_VERSION) + " "));
8686 bool success = _svg.write(_out.getPageStream(pageno, totalPageCount()));
87 string svgfname = _out.filename(pageno, totalPageCount());
87 string svgfname = _out.filepath(pageno, totalPageCount()).shorterAbsoluteOrRelative();
8888 if (svgfname.empty())
8989 svgfname = "<stdout>";
9090 if (!success)
144144 }
145145
146146
147 string ImageToSVG::getSVGFilename (unsigned pageno) const {
147 FilePath ImageToSVG::getSVGFilePath (unsigned pageno) const {
148 FilePath path;
148149 if (pageno == 1)
149 return _out.filename(1, 1);
150 return "";
150 path = _out.filepath(1, 1);
151 return path;
151152 }
152153
153154
6767 unsigned getCurrentPageNumber() const override {return 0;}
6868 BoundingBox& bbox () override {return _bbox;}
6969 BoundingBox& bbox (const std::string &name, bool reset=false) override {return _bbox;}
70 std::string getSVGFilename (unsigned pageno) const override;
70 FilePath getSVGFilePath (unsigned pageno) const override;
7171 std::string getBBoxFormatString () const override {return "";}
7272
7373 private:
3131
3232 class MD5HashFunction : public HashFunction {
3333 public:
34 explicit MD5HashFunction () {MD5_Init(&_context);}
34 MD5HashFunction () {MD5_Init(&_context);}
3535 MD5HashFunction (const char *data, size_t length) : MD5HashFunction() {update(data, length);}
3636 explicit MD5HashFunction (const std::string &data) : MD5HashFunction() {update(data);}
3737 explicit MD5HashFunction (const std::vector<uint8_t> &data) : MD5HashFunction() {update(data);}
5454 Color.hpp Color.cpp \
5555 ColorSpecialHandler.hpp ColorSpecialHandler.cpp \
5656 CommandLine.hpp \
57 CRC32.hpp CRC32.cpp \
5857 Directory.hpp Directory.cpp \
5958 DVIActions.hpp \
6059 DLLoader.hpp DLLoader.cpp \
6261 DvisvgmSpecialHandler.hpp DvisvgmSpecialHandler.cpp \
6362 DVIToSVG.hpp DVIToSVG.cpp \
6463 DVIToSVGActions.hpp DVIToSVGActions.cpp \
64 EllipticalArc.hpp EllipticalArc.cpp \
6565 EmSpecialHandler.hpp EmSpecialHandler.cpp \
6666 EncFile.hpp EncFile.cpp \
6767 EPSFile.hpp EPSFile.cpp \
113113 @ENABLE_WOFF_TRUE@am__append_13 = $(TTFAUTOHINT_LIBS)
114114 subdir = src
115115 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
116 am__aclocal_m4_deps = $(top_srcdir)/configure.ac
116 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_compile_flag.m4 \
117 $(top_srcdir)/m4/ax_code_coverage.m4 \
118 $(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \
119 $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
120 $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
121 $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac
117122 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
118123 $(ACLOCAL_M4)
119124 DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
133138 CLCommandLine.hpp CLCommandLine.cpp CMap.hpp CMap.cpp \
134139 CMapManager.hpp CMapManager.cpp CMapReader.hpp CMapReader.cpp \
135140 CLOption.hpp Color.hpp Color.cpp ColorSpecialHandler.hpp \
136 ColorSpecialHandler.cpp CommandLine.hpp CRC32.hpp CRC32.cpp \
137 Directory.hpp Directory.cpp DVIActions.hpp DLLoader.hpp \
138 DLLoader.cpp DVIReader.hpp DVIReader.cpp \
139 DvisvgmSpecialHandler.hpp DvisvgmSpecialHandler.cpp \
140 DVIToSVG.hpp DVIToSVG.cpp DVIToSVGActions.hpp \
141 DVIToSVGActions.cpp EmSpecialHandler.hpp EmSpecialHandler.cpp \
141 ColorSpecialHandler.cpp CommandLine.hpp Directory.hpp \
142 Directory.cpp DVIActions.hpp DLLoader.hpp DLLoader.cpp \
143 DVIReader.hpp DVIReader.cpp DvisvgmSpecialHandler.hpp \
144 DvisvgmSpecialHandler.cpp DVIToSVG.hpp DVIToSVG.cpp \
145 DVIToSVGActions.hpp DVIToSVGActions.cpp EllipticalArc.hpp \
146 EllipticalArc.cpp EmSpecialHandler.hpp EmSpecialHandler.cpp \
142147 EncFile.hpp EncFile.cpp EPSFile.hpp EPSFile.cpp EPSToSVG.hpp \
143148 FileFinder.hpp FileFinder.cpp FilePath.hpp FilePath.cpp \
144149 FileSystem.hpp FileSystem.cpp FixWord.hpp Font.hpp Font.cpp \
193198 BgColorSpecialHandler.lo Bitmap.lo BoundingBox.lo \
194199 Calculator.lo CharMapID.lo CLCommandLine.lo CMap.lo \
195200 CMapManager.lo CMapReader.lo Color.lo ColorSpecialHandler.lo \
196 CRC32.lo Directory.lo DLLoader.lo DVIReader.lo \
197 DvisvgmSpecialHandler.lo DVIToSVG.lo DVIToSVGActions.lo \
201 Directory.lo DLLoader.lo DVIReader.lo DvisvgmSpecialHandler.lo \
202 DVIToSVG.lo DVIToSVGActions.lo EllipticalArc.lo \
198203 EmSpecialHandler.lo EncFile.lo EPSFile.lo FileFinder.lo \
199204 FilePath.lo FileSystem.lo Font.lo FontCache.lo FontEncoding.lo \
200205 FontEngine.lo FontManager.lo FontMap.lo FontMetrics.lo \
249254 ./$(DEPDIR)/Bitmap.Plo ./$(DEPDIR)/BoundingBox.Plo \
250255 ./$(DEPDIR)/CLCommandLine.Plo ./$(DEPDIR)/CMap.Plo \
251256 ./$(DEPDIR)/CMapManager.Plo ./$(DEPDIR)/CMapReader.Plo \
252 ./$(DEPDIR)/CRC32.Plo ./$(DEPDIR)/Calculator.Plo \
253 ./$(DEPDIR)/CharMapID.Plo ./$(DEPDIR)/Color.Plo \
254 ./$(DEPDIR)/ColorSpecialHandler.Plo ./$(DEPDIR)/DLLoader.Plo \
255 ./$(DEPDIR)/DVIReader.Plo ./$(DEPDIR)/DVIToSVG.Plo \
256 ./$(DEPDIR)/DVIToSVGActions.Plo ./$(DEPDIR)/Directory.Plo \
257 ./$(DEPDIR)/Calculator.Plo ./$(DEPDIR)/CharMapID.Plo \
258 ./$(DEPDIR)/Color.Plo ./$(DEPDIR)/ColorSpecialHandler.Plo \
259 ./$(DEPDIR)/DLLoader.Plo ./$(DEPDIR)/DVIReader.Plo \
260 ./$(DEPDIR)/DVIToSVG.Plo ./$(DEPDIR)/DVIToSVGActions.Plo \
261 ./$(DEPDIR)/Directory.Plo \
257262 ./$(DEPDIR)/DvisvgmSpecialHandler.Plo ./$(DEPDIR)/EPSFile.Plo \
258 ./$(DEPDIR)/EmSpecialHandler.Plo ./$(DEPDIR)/EncFile.Plo \
259 ./$(DEPDIR)/FileFinder.Plo ./$(DEPDIR)/FilePath.Plo \
260 ./$(DEPDIR)/FileSystem.Plo ./$(DEPDIR)/Font.Plo \
261 ./$(DEPDIR)/FontCache.Plo ./$(DEPDIR)/FontEncoding.Plo \
262 ./$(DEPDIR)/FontEngine.Plo ./$(DEPDIR)/FontManager.Plo \
263 ./$(DEPDIR)/FontMap.Plo ./$(DEPDIR)/FontMetrics.Plo \
264 ./$(DEPDIR)/FontWriter.Plo ./$(DEPDIR)/GFGlyphTracer.Plo \
265 ./$(DEPDIR)/GFReader.Plo ./$(DEPDIR)/GFTracer.Plo \
266 ./$(DEPDIR)/Ghostscript.Plo ./$(DEPDIR)/HashFunction.Plo \
263 ./$(DEPDIR)/EllipticalArc.Plo ./$(DEPDIR)/EmSpecialHandler.Plo \
264 ./$(DEPDIR)/EncFile.Plo ./$(DEPDIR)/FileFinder.Plo \
265 ./$(DEPDIR)/FilePath.Plo ./$(DEPDIR)/FileSystem.Plo \
266 ./$(DEPDIR)/Font.Plo ./$(DEPDIR)/FontCache.Plo \
267 ./$(DEPDIR)/FontEncoding.Plo ./$(DEPDIR)/FontEngine.Plo \
268 ./$(DEPDIR)/FontManager.Plo ./$(DEPDIR)/FontMap.Plo \
269 ./$(DEPDIR)/FontMetrics.Plo ./$(DEPDIR)/FontWriter.Plo \
270 ./$(DEPDIR)/GFGlyphTracer.Plo ./$(DEPDIR)/GFReader.Plo \
271 ./$(DEPDIR)/GFTracer.Plo ./$(DEPDIR)/Ghostscript.Plo \
272 ./$(DEPDIR)/HashFunction.Plo \
267273 ./$(DEPDIR)/HtmlSpecialHandler.Plo \
268274 ./$(DEPDIR)/HyperlinkManager.Plo ./$(DEPDIR)/ImageToSVG.Plo \
269275 ./$(DEPDIR)/InputBuffer.Plo ./$(DEPDIR)/InputReader.Plo \
587593 CLCommandLine.hpp CLCommandLine.cpp CMap.hpp CMap.cpp \
588594 CMapManager.hpp CMapManager.cpp CMapReader.hpp CMapReader.cpp \
589595 CLOption.hpp Color.hpp Color.cpp ColorSpecialHandler.hpp \
590 ColorSpecialHandler.cpp CommandLine.hpp CRC32.hpp CRC32.cpp \
591 Directory.hpp Directory.cpp DVIActions.hpp DLLoader.hpp \
592 DLLoader.cpp DVIReader.hpp DVIReader.cpp \
593 DvisvgmSpecialHandler.hpp DvisvgmSpecialHandler.cpp \
594 DVIToSVG.hpp DVIToSVG.cpp DVIToSVGActions.hpp \
595 DVIToSVGActions.cpp EmSpecialHandler.hpp EmSpecialHandler.cpp \
596 ColorSpecialHandler.cpp CommandLine.hpp Directory.hpp \
597 Directory.cpp DVIActions.hpp DLLoader.hpp DLLoader.cpp \
598 DVIReader.hpp DVIReader.cpp DvisvgmSpecialHandler.hpp \
599 DvisvgmSpecialHandler.cpp DVIToSVG.hpp DVIToSVG.cpp \
600 DVIToSVGActions.hpp DVIToSVGActions.cpp EllipticalArc.hpp \
601 EllipticalArc.cpp EmSpecialHandler.hpp EmSpecialHandler.cpp \
596602 EncFile.hpp EncFile.cpp EPSFile.hpp EPSFile.cpp EPSToSVG.hpp \
597603 FileFinder.hpp FileFinder.cpp FilePath.hpp FilePath.cpp \
598604 FileSystem.hpp FileSystem.cpp FixWord.hpp Font.hpp Font.cpp \
666672 exit 1;; \
667673 esac; \
668674 done; \
669 echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \
675 echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Makefile'; \
670676 $(am__cd) $(top_srcdir) && \
671 $(AUTOMAKE) --gnu src/Makefile
677 $(AUTOMAKE) --foreign src/Makefile
672678 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
673679 @case '$?' in \
674680 *config.status*) \
772778 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CMap.Plo@am__quote@ # am--include-marker
773779 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CMapManager.Plo@am__quote@ # am--include-marker
774780 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CMapReader.Plo@am__quote@ # am--include-marker
775 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CRC32.Plo@am__quote@ # am--include-marker
776781 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Calculator.Plo@am__quote@ # am--include-marker
777782 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CharMapID.Plo@am__quote@ # am--include-marker
778783 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Color.Plo@am__quote@ # am--include-marker
784789 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Directory.Plo@am__quote@ # am--include-marker
785790 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DvisvgmSpecialHandler.Plo@am__quote@ # am--include-marker
786791 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/EPSFile.Plo@am__quote@ # am--include-marker
792 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/EllipticalArc.Plo@am__quote@ # am--include-marker
787793 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/EmSpecialHandler.Plo@am__quote@ # am--include-marker
788794 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/EncFile.Plo@am__quote@ # am--include-marker
789795 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/FileFinder.Plo@am__quote@ # am--include-marker
11311137 -rm -f ./$(DEPDIR)/CMap.Plo
11321138 -rm -f ./$(DEPDIR)/CMapManager.Plo
11331139 -rm -f ./$(DEPDIR)/CMapReader.Plo
1134 -rm -f ./$(DEPDIR)/CRC32.Plo
11351140 -rm -f ./$(DEPDIR)/Calculator.Plo
11361141 -rm -f ./$(DEPDIR)/CharMapID.Plo
11371142 -rm -f ./$(DEPDIR)/Color.Plo
11431148 -rm -f ./$(DEPDIR)/Directory.Plo
11441149 -rm -f ./$(DEPDIR)/DvisvgmSpecialHandler.Plo
11451150 -rm -f ./$(DEPDIR)/EPSFile.Plo
1151 -rm -f ./$(DEPDIR)/EllipticalArc.Plo
11461152 -rm -f ./$(DEPDIR)/EmSpecialHandler.Plo
11471153 -rm -f ./$(DEPDIR)/EncFile.Plo
11481154 -rm -f ./$(DEPDIR)/FileFinder.Plo
12721278 -rm -f ./$(DEPDIR)/CMap.Plo
12731279 -rm -f ./$(DEPDIR)/CMapManager.Plo
12741280 -rm -f ./$(DEPDIR)/CMapReader.Plo
1275 -rm -f ./$(DEPDIR)/CRC32.Plo
12761281 -rm -f ./$(DEPDIR)/Calculator.Plo
12771282 -rm -f ./$(DEPDIR)/CharMapID.Plo
12781283 -rm -f ./$(DEPDIR)/Color.Plo
12841289 -rm -f ./$(DEPDIR)/Directory.Plo
12851290 -rm -f ./$(DEPDIR)/DvisvgmSpecialHandler.Plo
12861291 -rm -f ./$(DEPDIR)/EPSFile.Plo
1292 -rm -f ./$(DEPDIR)/EllipticalArc.Plo
12871293 -rm -f ./$(DEPDIR)/EmSpecialHandler.Plo
12881294 -rm -f ./$(DEPDIR)/EncFile.Plo
12891295 -rm -f ./$(DEPDIR)/FileFinder.Plo
1717 ** along with this program; if not, see <http://www.gnu.org/licenses/>. **
1818 *************************************************************************/
1919
20 #include <cstdlib>
2120 #include <cctype>
2221 #include <fstream>
2322 #include <sstream>
3736 // ensure that folder paths ends with slash
3837 if (_dir.empty())
3938 _dir = "./";
40 else if (_dir != "/" && dir[dir.length()-1] != '/')
39 else if (_dir != "/" && _dir.back() != '/')
4140 _dir += '/';
4241 }
4342
8786 iss.getline(buf, sizeof(buf));
8887 string line = buf;
8988 if (line.substr(0, 3) == ">> ") {
90 resolution = atoi(line.substr(3).c_str());
89 resolution = stoi(line.substr(3));
9190 break;
9291 }
9392 }
5050 "-dWRITESYSTEMDICT", // leave systemdict writable as some operators must be replaced
5151 "-dNOPROMPT"
5252 };
53 if (int gsrev = _gs.revision())
53 if (int gsrev = _gs.revision()) {
5454 gsargs.emplace_back(gsrev == 922 ? "-dREALLYDELAYBIND" : "-dDELAYBIND");
55 // As of GS 9.50, -dSAFER is active by default which leads to warnings
56 // in conjunction with -dDELAYBIND and -dWRITESYSTEMDICT.
57 // Thus, -dDELAYSAFER (or -dNOSAFER) must be added.
58 // https://www.ghostscript.com/doc/9.50/Use.htm#Safer
59 if (gsrev >= 950)
60 gsargs.emplace_back("-dDELAYSAFER");
61 }
5562 _gs.init(gsargs.size(), gsargs.data(), this);
5663 _gs.set_stdio(input, output, error);
5764 _initialized = true;
2525 #include "macros.hpp"
2626
2727 template <typename T>
28 class Pair
29 {
28 class Pair {
3029 public:
3130 explicit Pair (T x=0, T y=0) : _x(x), _y(y) {}
31 template <typename U> Pair (const Pair<U> &p) : _x(U(p.x())), _y(U(p.y())) {}
32 Pair (const Pair &p) =default;
33 Pair (Pair &&p) =default;
34 Pair& operator = (const Pair &p) =default;
35 Pair& operator = (Pair &&p) =default;
3236 Pair operator += (const Pair &p) {_x += p._x; _y += p._y; return *this;}
3337 Pair operator -= (const Pair &p) {_x -= p._x; _y -= p._y; return *this;}
3438 Pair operator *= (T c) {_x *= c; _y *= c; return *this;}
3539 Pair operator /= (T c) {_x /= c; _y /= c; return *this;}
3640 Pair operator - () const {return Pair(-_x, -_y);}
3741 Pair ortho () const {return Pair(-_y, _x);}
38 double length () const {return std::sqrt(_x*_x + _y*_y);}
42 double length () const {return std::hypot(_x, _y);}
3943 bool operator == (const Pair &p) const {return _x == p._x && _y == p._y;}
4044 bool operator != (const Pair &p) const {return _x != p._x || _y != p._y;}
4145 T x () const {return _x;}
5357 return Pair<T>(std::abs(p.x()), std::abs(p.y()));
5458 }
5559
60 /** Returns the dot product of two 2D vectors. */
61 template <typename T>
62 inline T dot (const Pair<T> &p1, const Pair<T> &p2) {
63 return p1.x()*p1.y() + p1.y()*p2.y();
64 }
65
66 /** Returns the determinant of two 2D vectors. */
67 template <typename T>
68 inline T det (const Pair<T> &p1, const Pair<T> &p2) {
69 return p1.x()*p2.y() - p1.y()*p2.x();
70 }
71
5672 struct Pair32 : public Pair<int32_t> {
5773 explicit Pair32 (int32_t x=0, int32_t y=0) : Pair<int32_t>(x, y) {}
5874 explicit Pair32 (double x, double y) : Pair<int32_t>(lround(x), lround(y)) {}
6076 };
6177
6278 typedef Pair<double> DPair;
79
80 inline DPair round (const DPair &p) {
81 return DPair(std::lround(p.x()), std::lround(p.y()));
82 }
6383
6484 template <typename T>
6585 IMPLEMENT_ARITHMETIC_OPERATOR(Pair<T>, +)
4848 /** In order to flatten a curved path, all path segements are processed sequentially.
4949 * Depending on the type of the segment, one of the methods provided by this class
5050 * is called. */
51 class FlattenActions : public CurvedPath::Actions {
51 class FlattenActions : public CurvedPath::IterationActions {
5252 public:
5353 FlattenActions (vector<Bezier> &curves, Polygons &polygons, int &numLines)
5454 : _polygons(polygons), _curves(curves), _numLines(numLines) {}
7272 _currentPoint = p;
7373 }
7474
75 void conicto (const CurvedPath::Point &p1, const CurvedPath::Point &p2) override {
75 void quadto (const CurvedPath::Point &p1, const CurvedPath::Point &p2) override {
7676 Bezier bezier(_currentPoint, p1, p2);
7777 addCurvePoints(bezier);
7878 }
205205
206206 /** Returns the label of point q that lies on the line between points p1 and p2. */
207207 inline ZLabel division_label (const IntPoint &p1, const IntPoint &p2, const IntPoint &q) {
208 double t1, t2;
208 double t1=0, t2=0;
209209 double s=0;
210210 int32_t id = segment_id(p1, p2, t1, t2);
211211 if (id > 0)
2424 #include <sstream>
2525 #include "EPSFile.hpp"
2626 #include "FileFinder.hpp"
27 #include "FilePath.hpp"
2728 #include "FileSystem.hpp"
2829 #include "Message.hpp"
2930 #include "PathClipper.hpp"
182183 }
183184
184185
186 static string filename_suffix (const string &fname) {
187 string ret;
188 size_t pos = fname.rfind('.');
189 if (pos != string::npos)
190 ret = util::tolower(fname.substr(pos+1));
191 return ret;
192 }
193
194
185195 bool PsSpecialHandler::process (const string &prefix, istream &is, SpecialActions &actions) {
186196 // process PS headers only once (in prescan)
187197 if (prefix == "!" || prefix == "header=")
203213 if (_actions) {
204214 StreamInputReader in(is);
205215 const string fname = in.getQuotedString(in.peek() == '"' ? "\"" : nullptr);
216 FileType fileType = FileType::EPS;
217 if (prefix == "pdffile")
218 fileType = FileType::PDF;
219 else {
220 // accept selected non-PS files in psfile special
221 string ext = filename_suffix(fname);
222 if (ext == "pdf")
223 fileType = FileType::PDF;
224 else if (ext == "svg")
225 fileType = FileType::SVG;
226 else if (ext == "jpg" || ext == "jpeg" || ext == "png")
227 fileType = FileType::BITMAP;
228 }
206229 map<string,string> attr;
207230 in.parseAttributes(attr, false);
208 imgfile(prefix == "pdffile=" ? FileType::PDF : FileType::EPS, fname, attr);
231 imgfile(fileType, fname, attr);
209232 }
210233 }
211234 else if (prefix == "ps::") {
289312 double ury = (it = attr.find("ury")) != attr.end() ? stod(it->second) : 0;
290313 int pageno = (it = attr.find("page")) != attr.end() ? stoi(it->second, nullptr, 10) : 1;
291314
292 if (filetype == FileType::PDF && llx == 0 && lly == 0 && urx == 0 && ury == 0) {
315 if (filetype == FileType::BITMAP || filetype == FileType::SVG)
316 swap(lly, ury);
317 else if (filetype == FileType::PDF && llx == 0 && lly == 0 && urx == 0 && ury == 0) {
293318 BoundingBox pagebox = _psi.pdfPageBox(fname, pageno);
294319 if (pagebox.valid()) {
295320 llx = pagebox.minX();
336361 _actions->setY(0);
337362 moveToDVIPos();
338363
339 // clip image to its bounding box if flag 'clip' is given
340 string rectclip;
341 if (clipToBbox)
342 rectclip = to_string(llx)+" "+to_string(lly)+" "+to_string(urx-llx)+" "+to_string(ury-lly)+" rectclip";
343
344 auto groupNode = util::make_unique<XMLElement>("g"); // put SVG nodes created from the EPS/PDF file in this group
345 _xmlnode = groupNode.get();
346 _psi.execute(
347 "\n@beginspecial @setspecial" // enter special environment
348 "/setpagedevice{@setpagedevice}def " // activate processing of operator "setpagedevice"
349 "matrix setmatrix" // don't apply outer PS transformations
350 "/FirstPage "+to_string(pageno)+" def" // set number of fisrt page to convert (PDF only)
351 "/LastPage "+to_string(pageno)+" def " // set number of last page to convert (PDF only)
352 +rectclip+ // clip to bounding box (if requexted by attribute 'clip')
353 "("+ filepath + ")run " // execute file content
354 "@endspecial " // leave special environment
355 );
356 if (!groupNode->empty()) { // has anything been drawn?
364 auto imgNode = createImageNode(filetype, filepath, pageno, BoundingBox(llx, lly, urx, ury), clipToBbox);
365 if (imgNode) { // has anything been drawn?
357366 Matrix matrix(1);
358 matrix.scale(sx, -sy).rotate(-angle).scale(hscale/100, vscale/100); // apply transformation attributes
367 if (filetype == FileType::EPS || filetype == FileType::PDF)
368 sy = -sy; // adapt orientation of y-coordinates
369 matrix.scale(sx, sy).rotate(-angle).scale(hscale/100, vscale/100); // apply transformation attributes
359370 matrix.translate(x+hoffset, y-voffset); // move image to current DVI position
360371 matrix.lmultiply(_actions->getMatrix());
361372
364375 bbox.transform(matrix);
365376 _actions->embed(bbox);
366377
367 // insert group containing SVG nodes created from image
378 // insert element containing the image data
368379 matrix.rmultiply(TranslationMatrix(-llx, -lly)); // move lower left corner of image to origin
369380 if (!matrix.isIdentity())
370 groupNode->addAttribute("transform", matrix.toSVG());
371 _actions->svgTree().appendToPage(std::move(groupNode));
372 }
373 _xmlnode = nullptr; // append following elements to page group again
374
381 imgNode->addAttribute("transform", matrix.toSVG());
382 _actions->svgTree().appendToPage(std::move(imgNode));
383 }
375384 // restore DVI position
376385 _actions->setX(x);
377386 _actions->setY(y);
378387 moveToDVIPos();
388 }
389
390
391 /** Creates an XML element containing the image data depending on the file type.
392 * @param[in] type file type of the image
393 * @param[in] pathstr absolute path to image file
394 * @param[in] pageno number of page to process (PDF only)
395 * @param[in] bbox bounding box of the image
396 * @param[in] clip if true, the image is clipped to its bounding box
397 * @return pointer to the element or nullptr if there's no image data */
398 unique_ptr<XMLElement> PsSpecialHandler::createImageNode (FileType type, const string &pathstr, int pageno, BoundingBox bbox, bool clip) {
399 unique_ptr<XMLElement> node;
400 if (type == FileType::BITMAP || type == FileType::SVG) {
401 node = util::make_unique<XMLElement>("image");
402 node->addAttribute("x", 0);
403 node->addAttribute("y", 0);
404 node->addAttribute("width", bbox.width());
405 node->addAttribute("height", bbox.height());
406 // add path to image file relative to SVG file being generated
407 FilePath imgPath(pathstr);
408 string svgPathStr = _actions->getSVGFilePath(pageno).absolute(false);
409 node->addAttribute("xlink:href", imgPath.relative(svgPathStr));
410 }
411 else { // PostScript or PDF
412 // clip image to its bounding box if flag 'clip' is given
413 string rectclip;
414 if (clip)
415 rectclip = to_string(bbox.minX())+" "+to_string(bbox.minY())+" "+to_string(bbox.width())+" "+to_string(bbox.height())+" rectclip";
416
417 node = util::make_unique<XMLElement>("g"); // put SVG nodes created from the EPS/PDF file in this group
418 _xmlnode = node.get();
419 _psi.execute(
420 "\n@beginspecial @setspecial" // enter special environment
421 "/setpagedevice{@setpagedevice}def " // activate processing of operator "setpagedevice"
422 "matrix setmatrix" // don't apply outer PS transformations
423 "/FirstPage "+to_string(pageno)+" def" // set number of first page to convert (PDF only)
424 "/LastPage "+to_string(pageno)+" def " // set number of last page to convert (PDF only)
425 +rectclip+ // clip to bounding box (if requexted by attribute 'clip')
426 "(" + pathstr + ")run " // execute file content
427 "@endspecial " // leave special environment
428 );
429 if (node->empty())
430 node.reset(nullptr);
431 _xmlnode = nullptr; // append following elements to page group again
432 }
433 return node;
379434 }
380435
381436
393448 return false; // => non-horizontal baseline, can't compute meaningful extents
394449
395450 if (ex.y() == 0) // horizontal scaling or skewing?
396 w *= fabs(ex.x());
451 w *= abs(ex.x());
397452 if (ey.x()==0 || ex.y()==0) { // vertical scaling?
398 if (ey.y() < 0) swap(h, d);
399 if (double sy = fabs(ey.y())/ey.length()) {
400 h *= fabs(ey.y()/sy);
401 d *= fabs(ey.y()/sy);
402 }
403 else
453 if (ey.y() < 0)
454 swap(h, d);
455 double sy = abs(ey.y())/ey.length();
456 if (sy < 1e-8)
404457 h = d = 0;
458 else {
459 h *= abs(ey.y()/sy);
460 d *= abs(ey.y()/sy);
461 }
405462 }
406463 return true;
407464 }
599656 if (_blendmode > 0 && _blendmode < 16)
600657 path->addAttribute("style", "mix-blend-mode:"+css_blendmode_name(_blendmode));
601658 if (!_dashpattern.empty()) {
602 ostringstream oss;
603 for (size_t i=0; i < _dashpattern.size(); i++) {
604 if (i > 0)
605 oss << ',';
606 oss << XMLString(_dashpattern[i]);
607 }
608 path->addAttribute("stroke-dasharray", oss.str());
659 string patternStr;
660 for (double dashValue : _dashpattern)
661 patternStr += XMLString(dashValue)+",";
662 patternStr.pop_back();
663 path->addAttribute("stroke-dasharray", patternStr);
609664 if (_dashoffset != 0)
610665 path->addAttribute("stroke-dashoffset", _dashoffset);
611666 }
689744 // using corresponding values of the identity matrix.
690745 if (v.size()-startindex < 6) {
691746 v.resize(6+startindex);
692 for (int i=v.size()-startindex; i < 6; ++i)
747 for (size_t i=v.size()-startindex; i < 6; ++i)
693748 v[i+startindex] = (i%3 ? 0 : 1);
694749 }
695750 // PS matrix [a b c d e f] equals ((a,b,0),(c,d,0),(e,f,1)).
10061061 #if 0
10071062 if (bgcolorGiven) {
10081063 // fill whole patch area with given background color
1009 GraphicsPath<double> outline;
1010 patch->getBoundaryPath(outline);
1064 GraphicsPath<double> outline = patch->getBoundaryPath();
10111065 callback.patchSegment(outline, bgcolor);
10121066 }
10131067 #endif
10141068 patch->approximate(SHADING_SEGMENT_SIZE, SHADING_SEGMENT_OVERLAP, SHADING_SIMPLIFY_DELTA, callback);
10151069 if (!_xmlnode) {
10161070 // update bounding box
1017 BoundingBox bbox;
1018 patch->getBBox(bbox);
1071 BoundingBox bbox = patch->getBBox();
10191072 bbox.transform(_actions->getMatrix());
10201073 _actions->embed(bbox);
10211074 }
7676 };
7777
7878 enum PsSection {PS_NONE, PS_HEADERS, PS_BODY};
79 enum class FileType {EPS, PDF};
79 enum class FileType {EPS, PDF, SVG, BITMAP};
8080
8181 public:
8282 PsSpecialHandler ();
103103 void executeAndSync (std::istream &is, bool updatePos);
104104 void processHeaderFile (const char *fname);
105105 void imgfile (FileType type, const std::string &fname, const std::map<std::string,std::string> &attr);
106 std::unique_ptr<XMLElement> createImageNode (FileType type, const std::string &pathstr, int pageno, BoundingBox bbox, bool clip);
106107 void dviEndPage (unsigned pageno, SpecialActions &actions) override;
107108 void clip (Path path, bool evenodd);
108109 void processSequentialPatchMesh (int shadingTypeID, ColorSpace cspace, VectorIterator<double> &it);
4545 * @param[in] hash hash value of the current page
4646 * @return output stream for the given page */
4747 ostream& SVGOutput::getPageStream (int page, int numPages, const HashTriple &hashes) const {
48 string fname = filename(page, numPages, hashes);
49 if (fname.empty()) {
48 FilePath path = filepath(page, numPages, hashes);
49 if (path.empty()) {
5050 if (_zipLevel == 0) {
5151 _osptr.reset();
5252 return cout;
6262
6363 _page = page;
6464 if (_zipLevel > 0)
65 _osptr = util::make_unique<ZLibOutputFileStream>(fname, ZLIB_GZIP, _zipLevel);
65 _osptr = util::make_unique<ZLibOutputFileStream>(path.absolute(), ZLIB_GZIP, _zipLevel);
6666 else
67 _osptr = util::make_unique<ofstream>(fname);
67 _osptr = util::make_unique<ofstream>(path.absolute());
6868 if (!_osptr)
69 throw MessageException("can't open file "+fname+" for writing");
69 throw MessageException("can't open file "+path.shorterAbsoluteOrRelative()+" for writing");
7070 return *_osptr;
7171 }
7272
7373
74 /** Returns the name of the SVG file containing the given page.
74 /** Returns the path of the SVG file containing the given page number.
7575 * @param[in] page number of current page
7676 * @param[in] numPages total number of pages
7777 * @param[in] hash hash value of current page */
78 string SVGOutput::filename (int page, int numPages, const HashTriple &hashes) const {
79 if (_stdout)
80 return "";
81
82 string expanded_pattern = util::trim(expandFormatString(_pattern, page, numPages, hashes));
83 // set and expand default pattern if necessary
84 if (expanded_pattern.empty()) {
85 string pattern = hashes.empty() ? (numPages > 1 ? "%f-%p" : "%f") : "%f-%hd";
86 expanded_pattern = expandFormatString(pattern, page, numPages, hashes);
78 FilePath SVGOutput::filepath (int page, int numPages, const HashTriple &hashes) const {
79 FilePath outpath;
80 if (!_stdout) {
81 string expanded_pattern = util::trim(expandFormatString(_pattern, page, numPages, hashes));
82 // set and expand default pattern if necessary
83 if (expanded_pattern.empty()) {
84 string pattern = hashes.empty() ? (numPages > 1 ? "%f-%p" : "%f") : "%f-%hd";
85 expanded_pattern = expandFormatString(pattern, page, numPages, hashes);
86 }
87 // append suffix if necessary
88 outpath.set(expanded_pattern, true);
89 if (outpath.suffix().empty())
90 outpath.suffix(_zipLevel > 0 ? "svgz" : "svg");
8791 }
88 // append suffix if necessary
89 FilePath outpath(expanded_pattern, true);
90 if (outpath.suffix().empty())
91 outpath.suffix(_zipLevel > 0 ? "svgz" : "svg");
92 string abspath = outpath.absolute();
93 string relpath = outpath.relative();
94 return abspath.length() < relpath.length() ? abspath : relpath;
92 return outpath;
9593 }
96
97
98 #if 0
99 string SVGOutput::outpath (int page, int numPages) const {
100 string path = filename(page, numPages);
101 if (path.empty())
102 return "";
103 size_t pos = path.rfind('/');
104 if (pos == string::npos)
105 return ".";
106 if (pos == 0)
107 return "/";
108 return path.substr(0, pos);
109 }
110 #endif
11194
11295
11396 /** Replaces expressions in a given string by the corresponding values and returns the result.
4545
4646 virtual ~SVGOutputBase () =default;
4747 virtual std::ostream& getPageStream (int page, int numPages, const HashTriple &hashes=HashTriple()) const =0;
48 virtual std::string filename (int page, int numPages, const HashTriple &hashes=HashTriple()) const =0;
48 virtual FilePath filepath (int page, int numPages, const HashTriple &hashes= HashTriple()) const =0;
4949 virtual bool ignoresHashes () const {return true;}
5050 };
5151
5757 SVGOutput (const std::string &base, const std::string &pattern) : SVGOutput(base, pattern, 0) {}
5858 SVGOutput (const std::string &base, std::string pattern, int zipLevel);
5959 std::ostream& getPageStream (int page, int numPages, const HashTriple &hash=HashTriple()) const override;
60 std::string filename (int page, int numPages, const HashTriple &hash=HashTriple()) const override;
60 FilePath filepath (int page, int numPages, const HashTriple &hash=HashTriple()) const override;
6161 bool ignoresHashes () const override;
6262
6363 protected:
4141 virtual ~ShadingPatch () =default;
4242 virtual int psShadingType () const =0;
4343 virtual void approximate (int gridsize, bool overlap, double delta, Callback &callback) const =0;
44 virtual void getBBox (BoundingBox &bbox) const =0;
45 virtual void getBoundaryPath (GraphicsPath<double> &path) const =0;
44 virtual BoundingBox getBBox () const =0;
45 virtual GraphicsPath<double> getBoundaryPath () const =0;
4646 virtual void setPoints (const PointVec &points, int edgeflag, ShadingPatch *patch) =0;
4747 virtual void setColors (const ColorVec &colors, int edgeflag, ShadingPatch *patch) =0;
4848 virtual int numPoints (int edgeflag) const =0;
2424 #include <memory>
2525 #include "BoundingBox.hpp"
2626 #include "Color.hpp"
27 #include "FilePath.hpp"
2728 #include "Matrix.hpp"
2829 #include "SVGTree.hpp"
2930
5152 virtual void embed (const BoundingBox &bbox) =0;
5253 virtual void embed (const DPair &p, double r=0) =0;
5354 virtual unsigned getCurrentPageNumber () const =0;
54 virtual std::string getSVGFilename (unsigned pageno) const =0;
55 virtual FilePath getSVGFilePath (unsigned pageno) const =0;
5556 virtual std::string getBBoxFormatString () const =0;
5657 virtual void progress (const char *id) {}
5758 virtual int getDVIStackDepth () const {return 0;}
7980 void embed (const BoundingBox &bbox) override {}
8081 void embed (const DPair &p, double r=0) override {}
8182 unsigned getCurrentPageNumber() const override {return 0;}
82 std::string getSVGFilename (unsigned pageno) const override {return "";}
83 FilePath getSVGFilePath (unsigned pageno) const override {return FilePath();}
8384 std::string getBBoxFormatString () const override {return "";}
8485
8586 private:
1919
2020 #include <algorithm>
2121 #include <vector>
22 #include "CRC32.hpp"
22 #include "HashFunction.hpp"
2323 #include "StreamReader.hpp"
24 #include "utility.hpp"
2425
2526 using namespace std;
2627
4546 }
4647
4748
48 /** Reads an unsigned integer from assigned input stream and updates the CRC32 checksum.
49 * @param[in] bytes number of bytes to read (max. 4)
50 * @param[in,out] crc32 checksum to be updated
49 /** Reads an unsigned integer from assigned input stream and updates the hash value.
50 * @param[in] n number of bytes to read (max. 4)
51 * @param[in,out] hashfunc hash to update
5152 * @return read integer */
52 uint32_t StreamReader::readUnsigned (int bytes, CRC32 &crc32) {
53 uint32_t ret = readUnsigned(bytes);
54 crc32.update(ret, bytes);
53 uint32_t StreamReader::readUnsigned (int n, HashFunction &hashfunc) {
54 uint32_t ret = readUnsigned(n);
55 hashfunc.update(util::bytes(ret, n));
5556 return ret;
5657 }
5758
6970 }
7071
7172
72 /** Reads an signed integer from assigned input stream and updates the CRC32 checksum.
73 /** Reads an signed integer from assigned input stream and updates the hash value.
7374 * @param[in] bytes number of bytes to read (max. 4)
74 * @param[in,out] crc32 checksum to be updated
75 * @param[in,out] hashfunc hash to update
7576 * @return read integer */
76 int32_t StreamReader::readSigned (int bytes, CRC32 &crc32) {
77 int32_t ret = readSigned(bytes);
78 crc32.update(uint32_t(ret), bytes);
77 int32_t StreamReader::readSigned (int n, HashFunction &hashfunc) {
78 int32_t ret = readSigned(n);
79 hashfunc.update(util::bytes(ret, n));
7980 return ret;
8081 }
8182
9293 }
9394
9495
95 /** Reads a string terminated by a 0-byte and updates the CRC32 checksum.
96 * @param[in,out] crc32 checksum to be updated
96 /** Reads a string terminated by a 0-byte and updates the hash value.
97 * @param[in,out] hashfunc hash to update
9798 * @param[in] finalZero consider final 0-byte in checksum
9899 * @return the string read */
99 string StreamReader::readString (CRC32 &crc32, bool finalZero) {
100 string StreamReader::readString (HashFunction &hashfunc, bool finalZero) {
100101 string ret = readString();
101 crc32.update(reinterpret_cast<const uint8_t*>(ret.data()), ret.length());
102 hashfunc.update(ret.data(), ret.length());
102103 if (finalZero)
103 crc32.update(0, 1);
104 hashfunc.update(0, 1);
104105 return ret;
105106 }
106107
118119 }
119120
120121
121 /** Reads a string of a given length and updates the CRC32 checksum.
122 /** Reads a string of a given length and updates the hash value.
122123 * @param[in] length number of characters to read
123 * @param[in,out] crc32 checksum to be updated
124 * @param[in,out] hashfunc hash to update
124125 * @return the string read */
125 string StreamReader::readString (int length, CRC32 &crc32) {
126 string StreamReader::readString (int length, HashFunction &hashfunc) {
126127 string ret = readString(length);
127 crc32.update(reinterpret_cast<const uint8_t*>(ret.data()), length);
128 hashfunc.update(ret.data(), length);
128129 return ret;
129130 }
130131
131132
132 vector<uint8_t>& StreamReader::readBytes (int n, vector<uint8_t> &bytes) {
133 vector<uint8_t> StreamReader::readBytes (int n) {
134 vector<uint8_t> bytes(n);
133135 if (n > 0)
134 _is->read((char*)&bytes[0], n);
136 _is->read(reinterpret_cast<char*>(bytes.data()), n);
135137 return bytes;
136138 }
137139
138140
139 vector<uint8_t>& StreamReader::readBytes (int n, vector<uint8_t> &bytes, CRC32 &crc32) {
140 readBytes(n, bytes);
141 crc32.update(&bytes[0], bytes.size());
141 vector<uint8_t> StreamReader::readBytes (int n, HashFunction &hashfunc) {
142 vector<uint8_t> bytes = readBytes(n);
143 hashfunc.update(bytes);
142144 return bytes;
143145 }
144146
145147
146 int StreamReader::readByte (CRC32 &crc32) {
148 int StreamReader::readByte (HashFunction &hashfunc) {
147149 int ret = readByte();
148150 if (ret >= 0) {
149 const uint8_t c = uint8_t(ret & 0xff);
150 crc32.update(&c, 1);
151 char c = ret & 0xff;
152 hashfunc.update(&c, 1);
151153 }
152154 return ret;
153155 }
2525 #include <vector>
2626 #include "MessageException.hpp"
2727
28 class CRC32;
28 class HashFunction;
2929
3030 class StreamReader {
3131 public:
3636 void clearStream () {_is->clear();}
3737 std::istream& replaceStream (std::istream &s);
3838 uint32_t readUnsigned (int n);
39 uint32_t readUnsigned (int n, CRC32 &crc32);
39 uint32_t readUnsigned (int n, HashFunction &hashfunc);
4040 int32_t readSigned (int n);
41 int32_t readSigned (int n, CRC32 &crc32);
41 int32_t readSigned (int n, HashFunction &hashfunc);
4242 std::string readString ();
43 std::string readString (CRC32 &crc32, bool finalZero=false);
43 std::string readString (HashFunction &hashfunc, bool finalZero=false);
4444 std::string readString (int length);
45 std::string readString (int length, CRC32 &crc32);
46 std::vector<uint8_t>& readBytes (int n, std::vector<uint8_t> &bytes);
47 std::vector<uint8_t>& readBytes (int n, std::vector<uint8_t> &bytes, CRC32 &crc32);
45 std::string readString (int length, HashFunction &hashfunc);
46 std::vector<uint8_t> readBytes (int n);
47 std::vector<uint8_t> readBytes (int n, HashFunction &hash);
4848 int readByte () {return _is->get();}
49 int readByte (CRC32 &crc32);
49 int readByte (HashFunction &hashfunc);
5050 void seek (std::streampos pos, std::ios::seekdir dir) {_is->seekg(pos, dir);}
5151 void seek (std::streampos pos) {_is->seekg(pos);}
5252 std::streampos tell () const {return _is->tellg();}
1717 ** along with this program; if not, see <http://www.gnu.org/licenses/>. **
1818 *************************************************************************/
1919
20 #include "CRC32.hpp"
20 #include "HashFunction.hpp"
2121 #include "StreamWriter.hpp"
22 #include "utility.hpp"
2223
2324 using namespace std;
2425
3637 * @param[in] val the value to write
3738 * @param[in] n number of bytes to be considered */
3839 void StreamWriter::writeSigned (int32_t val, int n) {
39 writeUnsigned((uint32_t)val, n);
40 writeUnsigned(uint32_t(val), n);
4041 }
4142
4243
7071 /** Writes an unsigned integer to the output stream.
7172 * @param[in] val the value to write
7273 * @param[in] n number of bytes to be considered
73 * @param[in,out] crc32 checksum to be updated */
74 void StreamWriter::writeUnsigned (uint32_t val, int n, CRC32 &crc32) {
74 * @param[in,out] hashfunc hash to update */
75 void StreamWriter::writeUnsigned (uint32_t val, int n, HashFunction &hashfunc) {
7576 writeUnsigned(val, n);
76 crc32.update(val, n);
77 hashfunc.update(util::bytes(val, n));
7778 }
7879
7980
80 /** Writes a signed integer to the output stream and updates the CRC32 checksum.
81 /** Writes a signed integer to the output stream and updates the hash value.
8182 * @param[in] val the value to write
8283 * @param[in] n number of bytes to be considered
83 * @param[in,out] crc32 checksum to be updated */
84 void StreamWriter::writeSigned (int32_t val, int n, CRC32 &crc32) {
85 writeUnsigned((uint32_t)val, n, crc32);
84 * @param[in,out] hashfunc hash to update */
85 void StreamWriter::writeSigned (int32_t val, int n, HashFunction &hashfunc) {
86 writeUnsigned(uint32_t(val), n, hashfunc);
8687 }
8788
8889
89 /** Writes a string to the output stream and updates the CRC32 checksum.
90 /** Writes a string to the output stream and updates the hash value.
9091 * @param[in] str the string to write
91 * @param[in,out] crc32 checksum to be updated
92 * @param[in,out] hashfunc hash to update
9293 * @param[in] finalZero if true, a final 0-byte is appended */
93 void StreamWriter::writeString (const std::string &str, CRC32 &crc32, bool finalZero) {
94 void StreamWriter::writeString (const std::string &str, HashFunction &hashfunc, bool finalZero) {
9495 writeString(str, finalZero);
95 crc32.update((const uint8_t*)str.c_str(), str.length() + (finalZero ? 1 : 0));
96 hashfunc.update(str.data(), str.length() + (finalZero ? 1 : 0));
9697 }
2323 #include <ostream>
2424 #include <vector>
2525
26 class CRC32;
26 class HashFunction;
2727
2828 class StreamWriter {
2929 public:
3434 void writeBytes (const uint8_t *buf, size_t bufsize);
3535 void writeBytes (int byte, size_t count);
3636 void writeString (const std::string &str, bool finalZero=false);
37 void writeUnsigned (uint32_t val, int n, CRC32 &crc32);
38 void writeSigned (int32_t val, int n, CRC32 &crc32);
39 void writeString (const std::string &str, CRC32 &crc32, bool finalZero=false);
37 void writeUnsigned (uint32_t val, int n, HashFunction &hashfunc);
38 void writeSigned (int32_t val, int n, HashFunction &hashfunc);
39 void writeString (const std::string &str, HashFunction &hashfunc, bool finalZero=false);
4040
4141 private:
4242 std::ostream &_os;
200200 }
201201
202202
203 void TensorProductPatch::getBoundaryPath (GraphicsPath<double> &path) const {
203 GraphicsPath<double> TensorProductPatch::getBoundaryPath () const {
204204 // Simple approach: Use the outer curves as boundary path. This doesn't always lead
205205 // to correct results since, depending on the control points, P(u,v) might exceed
206206 // the simple boundary.
207 GraphicsPath<double> path;
207208 path.moveto(_points[0][0]);
208209 path.cubicto(_points[0][1], _points[0][2], _points[0][3]);
209210 path.cubicto(_points[1][3], _points[2][3], _points[3][3]);
210211 path.cubicto(_points[3][2], _points[3][1], _points[3][0]);
211212 path.cubicto(_points[2][0], _points[1][0], _points[0][0]);
212213 path.closepath();
214 return path;
213215 }
214216
215217
353355 void TensorProductPatch::approximate (int gridsize, bool overlap, double delta, Callback &callback) const {
354356 if (_colors[0] == _colors[1] && _colors[1] == _colors[2] && _colors[2] == _colors[3]) {
355357 // simple case: monochromatic patch
356 GraphicsPath<double> path;
357 getBoundaryPath(path);
358 GraphicsPath<double> path = getBoundaryPath();
358359 callback.patchSegment(path, _colors[0]);
359360 }
360361 else {
376377 }
377378
378379
379 void TensorProductPatch::getBBox (BoundingBox &bbox) const {
380 BoundingBox TensorProductPatch::getBBox () const {
381 BoundingBox bbox;
380382 Bezier bezier;
381 BoundingBox bezierBox;
382383 for (int i=0; i <= 1; i++) {
383384 horizontalCurve(i, bezier);
384 bezier.getBBox(bezierBox);
385 bbox.embed(bezierBox);
385 bbox.embed(bezier.getBBox());
386386 verticalCurve(i, bezier);
387 bezier.getBBox(bezierBox);
388 bbox.embed(bezierBox);
389 }
387 bbox.embed(bezier.getBBox());
388 }
389 return bbox;
390390 }
391391
392392
5050 Color averageColor () const override;
5151 void horizontalCurve (double v, Bezier &bezier) const;
5252 void verticalCurve (double u, Bezier &bezier) const;
53 void getBoundaryPath (GraphicsPath<double> &path) const override;
53 GraphicsPath<double> getBoundaryPath () const override;
5454 void subpatch (double u1, double u2, double v1, double v2, TensorProductPatch &patch) const;
5555 DPair blossomValue (double u1, double u2, double u3, double v1, double v2, double v3) const;
5656 DPair blossomValue (double u[3], double v[3]) const {return blossomValue(u[0], u[1], u[2], v[0], v[1], v[2]);}
5757 void approximate (int gridsize, bool overlap, double delta, Callback &callback) const override;
58 void getBBox (BoundingBox &bbox) const override;
58 BoundingBox getBBox () const override;
5959 int numPoints (int edgeflag) const override {return edgeflag == 0 ? 16 : 12;}
6060 int numColors (int edgeflag) const override {return edgeflag == 0 ? 4 : 2;}
6161
2222 #include <sstream>
2323 #include <string>
2424 #include "Color.hpp"
25 #include "EllipticalArc.hpp"
2526 #include "InputBuffer.hpp"
2627 #include "InputReader.hpp"
2728 #include "GraphicsPath.hpp"
163164 const DPair p1 = p+_points[i];
164165 const DPair p2 = p+_points[i+1];
165166 mid = p1+(p2-p1)/2.0;
166 path.conicto(p1, mid);
167 path.quadto(p1, mid);
167168 actions.embed(mid);
168169 actions.embed((p0+p1*6.0+p2)/8.0, _penwidth);
169170 }
183184 }
184185 }
185186 reset();
186 }
187
188
189 static double normalized_angle (double rad) {
190 rad = fmod(rad, math::TWO_PI);
191 if (rad < 0)
192 rad += math::TWO_PI;
193 return rad;
194187 }
195188
196189
204197 * @param[in] actions object providing the actions that can be performed by the SpecialHandler */
205198 void TpicSpecialHandler::drawArc (double cx, double cy, double rx, double ry, double angle1, double angle2, SpecialActions &actions) {
206199 if (_penwidth > 0 || _grayLevel >= 0) {
207 angle1 = -angle1;
208 angle2 = -angle2;
209200 cx += actions.getX();
210201 cy += actions.getY();
211202 unique_ptr<XMLElement> elem;
213204 if (abs(angle2-angle1) >= math::TWO_PI) // closed ellipse?
214205 elem = create_ellipse_element(cx, cy, rx, ry);
215206 else {
216 angle1 = normalized_angle(angle1);
217 angle2 = normalized_angle(angle2);
218 double delta = normalized_angle(angle2-angle1);
219 int large_arg = (delta < math::PI) ? 1 : 0;
220 ostringstream oss;
221 oss << 'M' << XMLString(cx+rx*cos(angle1)) << ' ' << XMLString(cy+ry*sin(-angle1))
222 << 'A' << XMLString(rx) << ' ' << XMLString(ry)
223 << " 0 " // no rotation of x-axis
224 << large_arg << " 1 " // always draw arc clockwise (sweep flag == 1)
225 << XMLString(cx+rx*cos(angle2)) << ' ' << XMLString(cy-ry*sin(angle2));
207 EllipticalArc arc(DPair(cx, cy), rx, ry, 0, -angle1, math::normalize_0_2pi(angle2-angle1));
208 GraphicsPath<double> path;
209 path.moveto(arc.startPoint());
210 path.arcto(rx, ry, 0, arc.largeArc(), arc.sweepPositive(), arc.endPoint());
226211 if (_grayLevel >= 0)
227 oss << 'Z';
212 path.closepath();
228213 else
229214 closed = false;
230215 elem = util::make_unique<XMLElement>("path");
216 ostringstream oss;
217 path.writeSVG(oss, SVGTree::RELATIVE_PATH_CMDS);
231218 elem->addAttribute("d", oss.str());
232219 }
233220 if (_penwidth > 0) {
160160 * @param[in] callback object notified */
161161 void TriangularPatch::approximate (int gridsize, bool overlap, double delta, Callback &callback) const {
162162 if (_colors[0] == _colors[1] && _colors[1] == _colors[2]) {
163 GraphicsPath<double> path;
164 getBoundaryPath(path);
163 GraphicsPath<double> path = getBoundaryPath();
165164 callback.patchSegment(path, _colors[0]);
166165 }
167166 else {
196195 }
197196
198197
199 void TriangularPatch::getBoundaryPath(GraphicsPath<double> &path) const {
198 GraphicsPath<double> TriangularPatch::getBoundaryPath () const {
199 GraphicsPath<double> path;
200200 path.clear();
201201 path.moveto(_points[0]);
202202 path.lineto(_points[1]);
203203 path.lineto(_points[2]);
204204 path.closepath();
205 }
206
207
208 void TriangularPatch::getBBox (BoundingBox &bbox) const {
209 bbox.invalidate();
205 return path;
206 }
207
208
209 BoundingBox TriangularPatch::getBBox () const {
210 BoundingBox bbox;
210211 bbox.embed(_points[0]);
211212 bbox.embed(_points[1]);
212213 bbox.embed(_points[2]);
213 }
214 return bbox;
215 }
3838 void setColors (const ColorVec &colors, int edgeflag, ShadingPatch *patch) override;
3939 void setColors (const Color &c1, const Color &c2, const Color &c3);
4040 void approximate (int gridsize, bool overlap, double delta, Callback &listener) const override;
41 void getBBox (BoundingBox &bbox) const override;
42 void getBoundaryPath(GraphicsPath<double> &path) const override;
41 BoundingBox getBBox () const override;
42 GraphicsPath<double> getBoundaryPath () const override;
4343 int numPoints (int edgeflag) const override {return edgeflag == 0 ? 3 : 1;}
4444 int numColors (int edgeflag) const override {return edgeflag == 0 ? 3 : 1;}
4545
126126
127127
128128 void TrueTypeFont::writeWOFF (const string &fname) const {
129 ofstream ofs(fname.c_str(), ios::binary);
129 ofstream ofs(fname, ios::binary);
130130 writeWOFF(ofs);
131131 }
132132
150150
151151
152152 bool TrueTypeFont::writeWOFF2 (const string &fname) const {
153 ofstream ofs(fname.c_str(), ios::binary);
153 ofstream ofs(fname, ios::binary);
154154 return writeWOFF2(ofs);
155155 }
156156
171171 while (startptr < endptr)
172172 sum += *startptr++;
173173 return sum;
174 }
174 }
136136 else {
137137 uint32_t cc = readUnsigned(4); // character code
138138 readUnsigned(4); // equals character width from corresponding TFM file
139 vector<uint8_t> dvi(pl); // DVI subroutine
140 readBytes(pl, dvi);
139 auto dvi = readBytes(pl); // DVI subroutine
141140 _actions->defineVFChar(cc, std::move(dvi)); // call template method for user actions
142141 }
143142 }
151150 else {
152151 uint32_t cc = readUnsigned(1); // character code
153152 readUnsigned(3); // character width from corresponding TFM file
154 vector<uint8_t> dvi(pl); // DVI subroutine
155 readBytes(pl, dvi);
153 auto dvi = readBytes(pl); // DVI subroutine
156154 _actions->defineVFChar(cc, std::move(dvi)); // call template method for user actions
157155 }
158156 }
2222
2323 #include <xxhash.h>
2424 #include "HashFunction.hpp"
25 #include "utility.hpp"
2526
27 #if (XXH_VERSION_NUMBER >= 701) && defined(XXH3_SECRET_SIZE_MIN)
28 #define ENABLE_XXH128
29 #endif
2630
2731 template <int HASH_SIZE>
2832 struct XXHInterface {
4852 static constexpr auto digest = &XXH64_digest;
4953 };
5054
55 #ifdef ENABLE_XXH128
56 template<>
57 struct XXHInterface<16> {
58 using State = XXH3_state_t;
59 static constexpr auto createState = &XXH3_createState;
60 static constexpr auto freeState = &XXH3_freeState;
61 static constexpr auto reset = &XXH3_128bits_reset_withSeed;
62 static constexpr auto update = &XXH3_128bits_update;
63 static constexpr auto digest = &XXH3_128bits_digest;
64 };
65 #endif
5166
5267 /** Implements the HashFunction class for the xxHash algorithms. */
5368 template <int HASH_BYTES>
6580 void update (const std::string &data) override {update(data.data(), data.length());}
6681 void update (const std::vector<uint8_t> &data) override {update(reinterpret_cast<const char*>(data.data()), data.size());}
6782
83 using HashFunction::update; // unhide update(istream &is) defined in base class
84
6885 std::vector<uint8_t> digestValue () const override {
69 std::vector<uint8_t> hash(HASH_BYTES);
70 auto digest = Interface::digest(_state);
71 for (int i=HASH_BYTES-1; i >= 0; i--) {
72 hash[i] = digest & 0xff;
73 digest >>= 8;
74 }
75 return hash;
86 return util::bytes(Interface::digest(_state), HASH_BYTES);
7687 }
7788
7889 static unsigned version () {return XXH_versionNumber();}
8495 using XXH32HashFunction = XXHashFunction<4>;
8596 using XXH64HashFunction = XXHashFunction<8>;
8697
98 #ifdef ENABLE_XXH128
99 using XXH128HashFunction = XXHashFunction<16>;
100
101 template<>
102 inline std::vector<uint8_t> XXHashFunction<16>::digestValue () const {
103 std::vector<uint8_t> hash;
104 auto digest = Interface::digest(_state);
105 for (auto chunk : {digest.high64, digest.low64}) {
106 auto bytes = util::bytes(chunk);
107 hash.insert(hash.end(), bytes.begin(), bytes.end());
108 }
109 return hash;
110 }
87111 #endif
112
113 #endif
114114 else
115115 Message::wstream(true) << "cache directory '" << args.cacheOpt.value() << "' does not exist (caching disabled)\n";
116116 }
117 else if (const char *userdir = FileSystem::userdir()) {
117 else {
118 string &cachepath = PhysicalFont::CACHE_PATH;
119 const char *cachehome = getenv("XDG_CACHE_HOME");
120 if (!cachehome || util::trim(cachehome).empty()) {
118121 #ifdef _WIN32
119 string cachedir = "\\.dvisvgm\\cache";
122 cachehome = "~\\.cache";
120123 #else
121 string cachedir = "/.dvisvgm/cache";
122 #endif
123 static string cachepath = userdir + cachedir;
124 cachehome = "~/.cache";
125 #endif
126 }
127 cachepath = util::trim(cachehome) + FileSystem::PATHSEP + "dvisvgm";
128 if (cachepath[0] == '~' && cachepath[1] == FileSystem::PATHSEP) {
129 if (FileSystem::userdir())
130 cachepath.replace(0, 1, FileSystem::userdir());
131 else
132 cachepath.erase(0, 2); // strip leading "~/"
133 }
124134 if (!FileSystem::exists(cachepath))
125135 FileSystem::mkdir(cachepath);
126 PhysicalFont::CACHE_PATH = cachepath.c_str();
127136 }
128137 if (args.cacheOpt.given() && args.cacheOpt.value().empty()) {
129138 cout << "cache directory: " << (PhysicalFont::CACHE_PATH.empty() ? "(none)" : PhysicalFont::CACHE_PATH) << '\n';
99 TransformSimplifier.hpp TransformSimplifier.cpp \
1010 WSNodeRemover.hpp WSNodeRemover.cpp
1111
12 AM_CXXFLAGS = -I$(dvisvgm_srcdir)/libs/variant/include
9090 target_triplet = @target@
9191 subdir = src/optimizer
9292 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
93 am__aclocal_m4_deps = $(top_srcdir)/configure.ac
93 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_compile_flag.m4 \
94 $(top_srcdir)/m4/ax_code_coverage.m4 \
95 $(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \
96 $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
97 $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
98 $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac
9499 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
95100 $(ACLOCAL_M4)
96101 DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
363368 TransformSimplifier.hpp TransformSimplifier.cpp \
364369 WSNodeRemover.hpp WSNodeRemover.cpp
365370
371 AM_CXXFLAGS = -I$(dvisvgm_srcdir)/libs/variant/include
366372 all: all-am
367373
368374 .SUFFIXES:
376382 exit 1;; \
377383 esac; \
378384 done; \
379 echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/optimizer/Makefile'; \
385 echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/optimizer/Makefile'; \
380386 $(am__cd) $(top_srcdir) && \
381 $(AUTOMAKE) --gnu src/optimizer/Makefile
387 $(AUTOMAKE) --foreign src/optimizer/Makefile
382388 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
383389 @case '$?' in \
384390 *config.status*) \
1818 *************************************************************************/
1919
2020 #include <cmath>
21 #include <cstdlib>
2122 #include "TransformSimplifier.hpp"
2223 #include "../Matrix.hpp"
2324 #include "../utility.hpp"
3738 return;
3839 if (const char *transform = context->getAttributeValue("transform")) {
3940 Matrix matrix = Matrix::parseSVGTransform(transform);
40 string decomp = decompose(matrix);
41 if (decomp.length() > matrix.toSVG().length())
42 context->addAttribute("transform", matrix.toSVG());
43 else {
44 if (decomp.empty())
45 context->removeAttribute("transform");
46 else
47 context->addAttribute("transform", decomp);
41 if (!incorporateTransform(context, matrix)) {
42 string decomp = decompose(matrix);
43 if (decomp.length() > matrix.toSVG().length())
44 context->addAttribute("transform", matrix.toSVG());
45 else {
46 if (decomp.empty())
47 context->removeAttribute("transform");
48 else
49 context->addAttribute("transform", decomp);
50 }
4851 }
4952 }
5053 // continue with child elements
5255 if (XMLElement *elem = child->toElement())
5356 execute(elem);
5457 }
58 }
59
60
61 /** Tries to incorporate the translation and scaling components of the 'transform' attribute
62 * of a given element into the positional and/or size attributes of that element. If successful,
63 * the 'transform' attribute is removed.
64 * Currently, only 'image' and 'rect' elements are considered.
65 * @param[in] elem element to check
66 * @param[in] matrix matrix representing the 'transform' attribute of the element
67 * @return true on success */
68 bool TransformSimplifier::incorporateTransform (XMLElement *elem, const Matrix &matrix) {
69 if ((elem->name() == "image" || elem->name() == "rect") && matrix.get(0, 1) == 0 && matrix.get(1, 0) == 0) {
70 double tx = matrix.get(0, 2);
71 double ty = matrix.get(1, 2);
72 double sx = matrix.get(0, 0);
73 double sy = matrix.get(1, 1);
74 if (const char *xstr = elem->getAttributeValue("x"))
75 tx += sx*strtod(xstr, nullptr);
76 if (const char *ystr = elem->getAttributeValue("y"))
77 ty += sy*strtod(ystr, nullptr);
78 if (const char *wstr = elem->getAttributeValue("width"))
79 elem->addAttribute("width", sx*strtod(wstr, nullptr));
80 if (const char *hstr = elem->getAttributeValue("height"))
81 elem->addAttribute("height", sy*strtod(hstr, nullptr));
82 elem->addAttribute("x", tx); // update x attribute
83 elem->addAttribute("y", ty); // update x attribute
84 elem->removeAttribute("transform");
85 return true;
86 }
87 return false;
5588 }
5689
5790
3131 const char* info () const override;
3232
3333 protected:
34 bool incorporateTransform (XMLElement *elem, const Matrix &matrix);
3435 std::string decompose (const Matrix &matrix);
3536 };
1919
2020 #include <algorithm>
2121 #include <cctype>
22 #include <cmath>
2223 #include <fstream>
2324 #include <functional>
2425 #include <iterator>
2526 #include "utility.hpp"
2627
2728 using namespace std;
29
30 /** Computes the singular value decomposition of a given 2x2 matrix M
31 * so that M = rotate(phi)*scale(sx,sy)*rotate(theta), where
32 * rotate(t):={{cos t, -sin t}, {sin t, cos t}} and scale(sx, sy):={{sx, 0}, {0, sy}}.
33 * The corresponding math can be found in Jim Blinn: "Consider the Lowly 2x2 Matrix"
34 * https://ieeexplore.ieee.org/document/486688
35 * Also published in "Jim Blinn's Corner: Notation, Notation, Notation", pp. 69--95.
36 * @param[in] m matrix {{m00, m01}, {m10, m11}} where the inner pairs denote the rows
37 * @return vector {phi, sx, sy, theta} */
38 vector<double> math::svd (const double (&m)[2][2]) {
39 double phi=0, theta=0, sx=0, sy=0;
40 if (m[0][0] != 0 || m[0][1] != 0 || m[1][0] != 0 || m[1][1] != 0) {
41 double e = (m[0][0] + m[1][1])/2; // = cos(phi+theta)*(sx+sy)/2
42 double f = (m[0][0] - m[1][1])/2; // = cos(phi-theta)*(sx-sy)/2
43 double g = (m[1][0] + m[0][1])/2; // = sin(phi-theta)*(sx-sy)/2
44 double h = (m[1][0] - m[0][1])/2; // = sin(phi+theta)*(sx+sy)/2
45 double hyp1 = hypot(e, h); // = (sx+sy)/2
46 double hyp2 = hypot(f, g); // = (sx-sy)/2
47 sx = hyp1+hyp2;
48 sy = hyp1-hyp2;
49 if (hyp2 == 0) // uniformly scaled rotation?
50 theta = atan2(h, e);
51 else if (hyp1 == 0) // uniformly scaled reflection?
52 theta = -atan2(g, f);
53 else {
54 double a1 = atan2(g, f); // = phi-theta (g/f = tan(phi-theta))
55 double a2 = atan2(h, e); // = phi+theta (h/e = tan(phi+theta))
56 phi = (a2+a1)/2;
57 theta = (a2-a1)/2;
58 }
59 }
60 return vector<double>{phi, sx, sy, theta};
61 }
62
63
64 /** Normalizes an angle to the interval [-mod, mod). */
65 double math::normalize_angle (double angle, double mod) {
66 angle = fmod(angle+mod, 2.0*mod);
67 if (angle < 0)
68 angle += 2.0*mod;
69 return angle-mod;
70 }
71
72
73 double math::normalize_0_2pi (double rad) {
74 rad = fmod(rad, TWO_PI);
75 if (rad < 0)
76 rad += TWO_PI;
77 return rad;
78 }
2879
2980
3081 /** Returns a given string with leading and trailing whitespace removed.
3535
3636 inline double deg2rad (double deg) {return PI*deg/180.0;}
3737 inline double rad2deg (double rad) {return 180.0*rad/PI;}
38 double normalize_angle (double angle, double mod);
39 double normalize_0_2pi (double rad);
40 std::vector<double> svd (const double (&m)[2][2]);
41
42 /** Signum function (returns x/abs(x) if x != 0, and 0 otherwise). */
43 template <typename T>
44 inline int sgn (T x) {return (x > T(0)) - (x < T(0));}
3845
3946 } // namespace math
4047
5764
5865 std::string read_file_contents (const std::string &fname);
5966 void write_file_contents (const std::string &fname, std::string::iterator start, std::string::iterator end);
67
68
69 /** Returns a sequence of bytes of a given integral value.
70 * @param[in] val get bytes of this value
71 * @param[in] n number of bytes to extract (from LSB to MSB), all if n == 0
72 * @return vector of bytes in big-endian order */
73 template <typename T>
74 std::vector<uint8_t> bytes (T val, int n=0) {
75 if (n <= 0)
76 n = sizeof(T);
77 std::vector<uint8_t> ret(n);
78 for (int i=0; i < n; i++) {
79 ret[n-i-1] = val & 0xff;
80 val >>= 8;
81 }
82 return ret;
83 }
84
6085
6186 /** Encodes the bytes in the half-open range [first,last) to Base64 and writes
6287 * the result to the range starting at 'dest'.
107107
108108 TEST(BezierTest, bbox) {
109109 Bezier bezier(DPair(0,0), DPair(12,12), DPair(24,6), DPair(30,-5));
110 BoundingBox bbox;
111 bezier.getBBox(bbox);
112 EXPECT_BBOX_NEAR(bbox, BoundingBox(0, -5, 30, 6.598));
110 EXPECT_BBOX_NEAR(bezier.getBBox(), BoundingBox(0, -5, 30, 6.598));
113111 }
114112
115113
+0
-78
tests/CRC32Test.cpp less more
0 /*************************************************************************
1 ** CRC32Test.cpp **
2 ** **
3 ** This file is part of dvisvgm -- a fast DVI to SVG converter **
4 ** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
5 ** **
6 ** This program is free software; you can redistribute it and/or **
7 ** modify it under the terms of the GNU General Public License as **
8 ** published by the Free Software Foundation; either version 3 of **
9 ** the License, or (at your option) any later version. **
10 ** **
11 ** This program is distributed in the hope that it will be useful, but **
12 ** WITHOUT ANY WARRANTY; without even the implied warranty of **
13 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the **
14 ** GNU General Public License for more details. **
15 ** **
16 ** You should have received a copy of the GNU General Public License **
17 ** along with this program; if not, see <http://www.gnu.org/licenses/>. **
18 *************************************************************************/
19
20 #include <gtest/gtest.h>
21 #include <string>
22 #include "CRC32.hpp"
23
24 using namespace std;
25
26 TEST(CRC32Test, init) {
27 CRC32 crc;
28 EXPECT_EQ(crc.get(), 0u);
29 crc.reset();
30 EXPECT_EQ(crc.get(), 0u);
31 }
32
33
34 TEST(CRC32Test, update_numbers) {
35 CRC32 crc;
36 const uint32_t comp[]={0xf8923be6, 0x4dcd2866, 0x4fdbb57a, 0xcb40f3bf, 0xf1a33887, 0x3422c816, 0x3a8b92a4, 0xedafc4ce, 0x4f5d17ec, 0x4a9f2f68};
37 for (int i=-5; i < 5; ++i) {
38 crc.update(i);
39 EXPECT_EQ(crc.get(), comp[i+5]) << "i=" << i;
40 }
41 crc.reset();
42 EXPECT_EQ(crc.get(), 0u);
43 // add 32 bit values
44 for (int i=0; i < 256; ++i)
45 crc.update(i);
46 EXPECT_EQ(crc.get(), 0xd4c2968b);
47 for (int i=256; i < 10000; ++i)
48 crc.update(i);
49 EXPECT_EQ(crc.get(), 0x6de9e841u);
50 }
51
52
53 TEST(CRC32Test, update_array) {
54 CRC32 crc;
55 uint8_t vals[256];
56 // add 8 bit values
57 for (int i=0; i < 256; ++i)
58 vals[i] = i;
59 crc.update(vals, 256);
60 EXPECT_EQ(crc.get(), 0x29058c73u);
61 }
62
63
64 TEST(CRC32Test, update_string) {
65 CRC32 crc;
66 crc.update("dvisvgm converts DVI files to SVG.");
67 EXPECT_EQ(crc.get(), 0x7c4ef359u);
68 crc.update("It is published under the GNU General Public License.");
69 EXPECT_EQ(crc.get(), 0xa732081bu);
70 }
71
72
73 TEST(CRC32Test, compute) {
74 EXPECT_EQ(CRC32::compute("dvisvgm converts DVI files to SVG."), 0x7c4ef359u);
75 istringstream iss("It is published under the GNU General Public License.");
76 EXPECT_EQ(CRC32::compute(iss), 0xbc02ba40u);
77 }
0 /*************************************************************************
1 ** EllipticalArcTest.cpp **
2 ** **
3 ** This file is part of dvisvgm -- a fast DVI to SVG converter **
4 ** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
5 ** **
6 ** This program is free software; you can redistribute it and/or **
7 ** modify it under the terms of the GNU General Public License as **
8 ** published by the Free Software Foundation; either version 3 of **
9 ** the License, or (at your option) any later version. **
10 ** **
11 ** This program is distributed in the hope that it will be useful, but **
12 ** WITHOUT ANY WARRANTY; without even the implied warranty of **
13 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the **
14 ** GNU General Public License for more details. **
15 ** **
16 ** You should have received a copy of the GNU General Public License **
17 ** along with this program; if not, see <http://www.gnu.org/licenses/>. **
18 *************************************************************************/
19
20 #include <gtest/gtest.h>
21 #include <sstream>
22 #include "EllipticalArc.hpp"
23 #include "utility.hpp"
24
25 using namespace std;
26
27 #define EXPECT_NEAR_PAIR(p1, p2, eps) \
28 EXPECT_NEAR(p1.x(), p2.x(), eps); \
29 EXPECT_NEAR(p1.y(), p2.y(), eps)
30
31
32 TEST(EllipticalArcTest, construct1) {
33 EllipticalArc arc(DPair(125,75), 100, 50, math::deg2rad(30), 1, 1, DPair(225, 125));
34 EXPECT_FALSE(arc.isStraightLine());
35 EXPECT_EQ(arc.startPoint(), DPair(125,75));
36 EXPECT_EQ(arc.endPoint(), DPair(225,125));
37 EXPECT_EQ(arc.rx(), 100);
38 EXPECT_EQ(arc.ry(), 50);
39 EXPECT_NEAR(math::rad2deg(arc.rotationAngle()), 30, 0.0001);
40 EXPECT_TRUE(arc.largeArc());
41 EXPECT_TRUE(arc.sweepPositive());
42 }
43
44
45 TEST(EllipticalArcTest, construct2) {
46 // radii two small, check automatic adaption
47 EllipticalArc arc(DPair(125,75), 20, 10, math::deg2rad(30), 1, 1, DPair(225, 125));
48 EXPECT_FALSE(arc.isStraightLine());
49 EXPECT_EQ(arc.startPoint(), DPair(125,75));
50 EXPECT_EQ(arc.endPoint(), DPair(225,125));
51 EXPECT_NEAR(arc.rx(), 56.2, 0.01);
52 EXPECT_NEAR(arc.ry(), 28.1, 0.01);
53 EXPECT_NEAR(math::rad2deg(arc.rotationAngle()), 30, 0.0001);
54 EXPECT_TRUE(arc.largeArc());
55 EXPECT_TRUE(arc.sweepPositive());
56 }
57
58
59 TEST(EllipticalArcTest, construct3) {
60 EXPECT_TRUE(EllipticalArc(DPair(125,75), 0, 10, math::deg2rad(30), 1, 1, DPair(225, 125)).isStraightLine());
61 EXPECT_TRUE(EllipticalArc(DPair(125,75), 20, 0, math::deg2rad(30), 1, 1, DPair(225, 125)).isStraightLine());
62 EXPECT_TRUE(EllipticalArc(DPair(125,75), 0, 0, math::deg2rad(30), 1, 1, DPair(225, 125)).isStraightLine());
63 }
64
65
66 TEST(EllipticalArcTest, construct4) {
67 // center parameterization
68 EllipticalArc arc(DPair(100,100), 100, 50, math::deg2rad(30), math::deg2rad(30), math::deg2rad(80));
69 EXPECT_FALSE(arc.isStraightLine());
70 EXPECT_NEAR_PAIR(arc.startPoint(), DPair(152.452, 164.952), 0.001);
71 EXPECT_NEAR_PAIR(arc.endPoint(), DPair(50.856, 123.589), 0.001);
72 EXPECT_NEAR(arc.rx(), 100, 0.1);
73 EXPECT_NEAR(arc.ry(), 50, 0.1);
74 EXPECT_NEAR(math::rad2deg(arc.rotationAngle()), 30, 0.0001);
75 EXPECT_FALSE(arc.largeArc());
76 EXPECT_TRUE(arc.sweepPositive());
77 }
78
79
80 TEST(EllipticalArcTest, transform) {
81 EllipticalArc arc(DPair(125,75), 100, 50, math::deg2rad(30), 1, 1, DPair(225, 125));
82 Matrix m(1);
83 m.scale(1,2).rotate(30).xskewByAngle(15).rotate(20).yskewByAngle(-20);
84 arc.transform(m);
85 EXPECT_NEAR_PAIR(arc.startPoint(), DPair(13.8871, 204.752), 0.001);
86 EXPECT_NEAR_PAIR(arc.endPoint(), DPair(35.957, 350.121), 0.001);
87 EXPECT_NEAR(arc.rx(), 154.73, 0.001);
88 EXPECT_NEAR(arc.ry(), 64.629, 0.001);
89 EXPECT_NEAR(math::rad2deg(arc.rotationAngle()), -81.748, 0.001);
90 EXPECT_TRUE(arc.largeArc());
91 EXPECT_TRUE(arc.sweepPositive());
92 }
93
94
95 TEST(EllipticalArcTest, bbox1) {
96 EllipticalArc arc(DPair(125,75), 100, 50, math::deg2rad(30), 1, 1, DPair(225, 125));
97 BoundingBox bbox = arc.getBBox();
98 EXPECT_NEAR(bbox.minX(), 96.854, 0.001);
99 EXPECT_NEAR(bbox.minY(), -6.633, 0.001);
100 EXPECT_NEAR(bbox.width(), 180.278, 0.001);
101 EXPECT_NEAR(bbox.height(), 132.288, 0.001);
102 }
103
104
105 TEST(EllipticalArcTest, bbox2) {
106 EllipticalArc arc(DPair(125,75), 100, 50, math::deg2rad(30), 0, 1, DPair(225, 125));
107 BoundingBox bbox = arc.getBBox();
108 EXPECT_NEAR(bbox.minX(), 125, 0.1);
109 EXPECT_NEAR(bbox.minY(), 75, 0.1);
110 EXPECT_NEAR(bbox.width(), 100, 0.1);
111 EXPECT_NEAR(bbox.height(), 50, 0.1);
112 }
113
114
115 TEST(EllipticalArcTest, approximate1) {
116 EllipticalArc arc(DPair(125,75), 100, 50, math::deg2rad(30), 1, 1, DPair(225, 125));
117 auto beziers = arc.approximate();
118 ASSERT_EQ(beziers.size(), 4u);
119 DPair data[4][4] = {
120 {DPair(125, 75), DPair(96.271, 46.768), DPair(88.655, 17.402), DPair(106.223, 2.602)},
121 {DPair(106.223, 2.602), DPair(123.791, -12.198), DPair(162.434, -8.971), DPair(201.493, 10.558)},
122 {DPair(201.493, 10.558), DPair(240.551, 30.088), DPair(270.89, 61.351), DPair(276.289, 87.635)},
123 {DPair(276.289, 87.635), DPair(281.688, 113.919), DPair(260.884, 129.074), DPair(225, 125)}
124 };
125 for (int i=0; i < 4; i++) {
126 for (int j=0; j < 4; j++) {
127 EXPECT_NEAR_PAIR(beziers[i].point(j), data[i][j], 0.001);
128 }
129 }
130 }
131
132
133 TEST(EllipticalArcTest, approximate2) {
134 EllipticalArc arc(DPair(125,75), 100, 50, math::deg2rad(30), 0, 1, DPair(225, 125));
135 auto beziers = arc.approximate();
136 ASSERT_EQ(beziers.size(), 1u);
137 DPair data[] = {DPair(125, 75), DPair(158.522, 78.806), DPair(198.163, 98.627), DPair(225, 125)};
138 for (int j=0; j < 4; j++) {
139 EXPECT_NEAR_PAIR(beziers[0].point(j), data[j], 0.001);
140 }
141 }
2727 #endif
2828
2929 using namespace std;
30
31
32 TEST(FilePathTest, empty) {
33 FilePath path;
34 ASSERT_TRUE(path.empty());
35 path.set("/a/b/c/d", false, "/");
36 ASSERT_FALSE(path.empty());
37 ASSERT_EQ(path.absolute(), "/a/b/c/d");
38 }
3039
3140
3241 TEST(FilePathTest, dir1) {
9099 ASSERT_FALSE(fp2.empty());
91100 ASSERT_EQ(fp2.absolute(), FileSystem::getcwd());
92101 }
93
6565 glyph2.moveto(0, 0);
6666 glyph2.cubicto(10, 10, 20, 0, 50, 50);
6767 glyph2.lineto(30, 20);
68 glyph2.conicto(20, 40, 20, 20);
68 glyph2.quadto(20, 40, 20, 20);
6969 glyph2.closepath();
7070 }
7171
72 ~FontCacheTest () {
72 ~FontCacheTest () override {
7373 FileSystem::remove(cachedir+"/testfont.fgd");
7474 }
7575
102102 TEST_F(FontCacheTest, write1) {
103103 cache.setGlyph(1, glyph1);
104104 ASSERT_TRUE(cache.fontname().empty());
105 ASSERT_FALSE(cache.write(cachedir.c_str()));
105 ASSERT_FALSE(cache.write(cachedir));
106106 }
107107
108108
109109 TEST_F(FontCacheTest, write2) {
110110 cache.setGlyph(1, glyph1);
111111 ASSERT_TRUE(FileSystem::exists(cachedir));
112 ASSERT_TRUE(cache.write("testfont", cachedir.c_str()));
112 ASSERT_TRUE(cache.write("testfont", cachedir));
113113 cache.setGlyph(10, glyph2);
114 ASSERT_TRUE(cache.write("testfont", cachedir.c_str()));
115 ASSERT_TRUE(cache.fontname().empty());
114 EXPECT_TRUE(cache.write("testfont", cachedir));
115 EXPECT_TRUE(cache.fontname().empty());
116116 }
117117
118118
119119 TEST_F(FontCacheTest, read) {
120120 cache.setGlyph(1, glyph1);
121121 cache.setGlyph(10, glyph2);
122 ASSERT_TRUE(cache.write("testfont", cachedir.c_str()));
122 ASSERT_TRUE(cache.write("testfont", cachedir));
123123 // clear cache object
124124 cache.clear();
125 ASSERT_EQ(cache.getGlyph(1), nullptr);
126 ASSERT_EQ(cache.getGlyph(2), nullptr);
127 ASSERT_EQ(cache.getGlyph(10), nullptr);
125 EXPECT_EQ(cache.getGlyph(1), nullptr);
126 EXPECT_EQ(cache.getGlyph(2), nullptr);
127 EXPECT_EQ(cache.getGlyph(10), nullptr);
128128 // read glyph data from cache file
129 ASSERT_TRUE(cache.read("testfont", cachedir.c_str()));
130 ASSERT_EQ(cache.fontname(), "testfont");
129 ASSERT_TRUE(cache.read("testfont", cachedir));
130 EXPECT_EQ(cache.fontname(), "testfont");
131131 ASSERT_NE(cache.getGlyph(1), nullptr);
132 ASSERT_EQ(cache.getGlyph(2), nullptr);
132 EXPECT_EQ(cache.getGlyph(2), nullptr);
133133 ASSERT_NE(cache.getGlyph(10), nullptr);
134 ASSERT_EQ(*cache.getGlyph(1), glyph1);
135 ASSERT_EQ(*cache.getGlyph(10), glyph2);
134 EXPECT_EQ(*cache.getGlyph(1), glyph1);
135 EXPECT_EQ(*cache.getGlyph(10), glyph2);
136136 }
137137
138138
140140 ostringstream oss;
141141 cache.clear();
142142 FileSystem::remove(cachedir+"/testfont.fgd");
143 cache.fontinfo(cachedir.c_str(), oss);
143 cache.fontinfo(cachedir, oss);
144144 ASSERT_EQ(oss.str(), "cache is empty\n");
145145
146146 // check removal of invalid cache files
149149 cachefile.close();
150150 ASSERT_TRUE(FileSystem::exists(cachedir+"/invalid.fgd"));
151151 oss.str("");
152 cache.fontinfo(cachedir.c_str(), oss, true);
152 cache.fontinfo(cachedir, oss, true);
153153 ASSERT_EQ(oss.str(),
154154 "cache is empty\n"
155155 "invalid cache file invalid.fgd removed\n"
161161 TEST_F(FontCacheTest, fontinfo2) {
162162 cache.setGlyph(1, glyph1);
163163 cache.setGlyph(10, glyph2);
164 ASSERT_TRUE(cache.write("testfont", cachedir.c_str()));
164 ASSERT_TRUE(cache.write("testfont", cachedir));
165165
166166 ostringstream oss;
167 cache.fontinfo(cachedir.c_str(), oss);
167 cache.fontinfo(cachedir, oss);
168168 ASSERT_EQ(oss.str(),
169169 "cache format version 5\n"
170 "testfont 2 glyphs 10 cmds 58 bytes crc:38cb5c67\n"
170 "testfont 2 glyphs 10 cmds 58 bytes hash:3cb32ab6\n"
171171 );
172172 }
2121 #include <sstream>
2222 #include "GraphicsPath.hpp"
2323
24 using std::ostringstream;
24 using namespace std;
2525
2626 TEST(GraphicsPathTest, svg) {
2727 GraphicsPath<int> path;
9191 path.lineto(10,10);
9292 path.lineto(10,20);
9393 path.cubicto(20,20,30,30,40,40);
94 path.conicto(50, 50, 60, 60);
94 path.quadto(50, 50, 60, 60);
9595 path.lineto(100,60);
9696 path.closepath();
9797 ostringstream oss;
104104 GraphicsPath<int> path;
105105 path.moveto(10,10);
106106 path.lineto(100,10);
107 path.conicto(10,100,40,80);
107 path.quadto(10, 100, 40, 80);
108108 path.cubicto(5,5,30,10,90,70);
109109 path.lineto(20,30);
110110 path.closepath();
118118 GraphicsPath<int> path;
119119 path.moveto(10,10);
120120 path.lineto(100,10);
121 path.conicto(10,100,40,80);
121 path.quadto(10, 100, 40, 80);
122122 path.cubicto(5,5,30,10,90,70);
123123 path.moveto(10,10);
124124 path.moveto(15,10);
130130 ostringstream oss;
131131 path.writeSVG(oss, false);
132132 EXPECT_EQ(oss.str(), "M10 10H100Q10 100 40 80C5 5 30 10 90 70M20 20V30");
133 }
134
135 TEST(GraphicsPathTest, cmd_equals) {
136 using Point = Pair<int>;
137 gp::MoveTo<int> m1(Point(1, 2));
138 gp::MoveTo<int> m2(Point(1, 2));
139 gp::MoveTo<int> m3(Point(2, 1));
140 EXPECT_EQ(m1, m2);
141 EXPECT_EQ(m2, m1);
142 EXPECT_NE(m1, m3);
143 EXPECT_NE(m3, m1);
144 gp::LineTo<int> l1(Point(1, 2));
145 EXPECT_NE(l1, m1);
146 EXPECT_NE(m1, l1);
147 gp::CubicTo<int> c1(Point(1, 2), Point(3, 4), Point(5, 6));
148 gp::CubicTo<int> c2(Point(1, 2), Point(3, 4), Point(5, 6));
149 gp::CubicTo<int> c3(Point(1, 2), Point(0, 4), Point(5, 6));
150 EXPECT_EQ(c1, c2);
151 EXPECT_EQ(c2, c1);
152 EXPECT_NE(c1, c3);
153 EXPECT_NE(c3, c1);
133154 }
134155
135156
138159 EXPECT_TRUE(path1 == path1);
139160 path1.moveto(10,10);
140161 path1.lineto(100,10);
141 path1.conicto(10,100,40,80);
162 path1.quadto(10, 100, 40, 80);
142163 path1.cubicto(5,5,30,10,90,70);
143164 path1.lineto(20,30);
144165 path1.closepath();
148169 EXPECT_FALSE(path1 == path2);
149170 path2.moveto(10,10);
150171 path2.lineto(100,10);
151 path2.conicto(10,100,40,80);
172 path2.quadto(10, 100, 40, 80);
152173 path2.cubicto(5,5,30,10,90,70);
153174 path2.lineto(20,30);
154175 EXPECT_FALSE(path1 == path2);
160181 path2.clear();
161182 path2.moveto(10,10);
162183 path2.lineto(100,10);
163 path2.conicto(10,100,40,80);
184 path2.quadto(10, 100, 40, 80);
164185 path2.cubicto(5,5,10,10,90,70);
165186 path2.lineto(20,30);
166187 path2.closepath();
174195 EXPECT_FALSE(path1 != path1);
175196 path1.moveto(10,10);
176197 path1.lineto(100,10);
177 path1.conicto(10,100,40,80);
198 path1.quadto(10, 100, 40, 80);
178199 path1.cubicto(5,5,30,10,90,70);
179200 path1.lineto(20,30);
180201 path1.closepath();
184205 EXPECT_TRUE(path1 != path2);
185206 path2.moveto(10,10);
186207 path2.lineto(100,10);
187 path2.conicto(10,100,40,80);
208 path2.quadto(10, 100, 40, 80);
188209 path2.cubicto(5,5,30,10,90,70);
189210 path2.lineto(20,30);
190211 EXPECT_TRUE(path1 != path2);
196217 path2.clear();
197218 path2.moveto(10,10);
198219 path2.lineto(100,10);
199 path2.conicto(10,100,40,80);
220 path2.quadto(10, 100, 40, 80);
200221 path2.cubicto(5,5,10,10,90,70);
201222 path2.lineto(20,30);
202223 path2.closepath();
203224 EXPECT_TRUE(path1 != path2);
204225 EXPECT_TRUE(path2 != path1);
205226 }
227
228
229 TEST(GraphicsPathTest, approximate_arcs) {
230 GraphicsPath<double> path;
231 XMLString::DECIMAL_PLACES = 2;
232 path.moveto(10, 10);
233 path.lineto(20, 0);
234 path.arcto(30, 20, 20, 1, 1, DPair(50, 50));
235 ostringstream oss;
236 path.writeSVG(oss, false);
237 EXPECT_EQ(oss.str(), "M10 10L20 0A30 20 20 1 1 50 50");
238 path.approximateArcs();
239 oss.str("");
240 path.writeSVG(oss, false);
241 EXPECT_EQ(oss.str(), "M10 10L20 0C25.05-7.15 34.02-8.12 42.72-2.44S58.14 14.42 59.73 25.91S57.48 46.9 50 50");
242 }
243
244
245 TEST(GraphicsPathTest, smooth_quadto) {
246 GraphicsPath<int> path;
247 path.moveto(10, 10);
248 path.quadto(DPair(30, 20), DPair(40, 10));
249 path.quadto(DPair(100, 30));
250 ostringstream oss;
251 path.writeSVG(oss, false);
252 EXPECT_EQ(oss.str(), "M10 10Q30 20 40 10T100 30");
253 }
254
255
256 TEST(GraphicsPathTest, smooth_cubicto) {
257 GraphicsPath<int> path;
258 path.moveto(10, 10);
259 path.cubicto(DPair(30, 20), DPair(40, 0), DPair(20, 50));
260 path.cubicto(DPair(80, 100), DPair(100, 30));
261 ostringstream oss;
262 path.writeSVG(oss, false);
263 EXPECT_EQ(oss.str(), "M10 10C30 20 40 0 20 50S80 100 100 30");
264 }
3434 md5.reset();
3535 md5.update("0123456789");
3636 EXPECT_EQ(md5.digestString(), "781e5e245d69b566979b86e28d23f2c7");
37 uint8_t bytes[] = {0x78, 0x1e, 0x5e, 0x24, 0x5d, 0x69, 0xb5, 0x66, 0x97, 0x9b, 0x86, 0xe2, 0x8d, 0x23, 0xf2, 0xc7};
38 int i=0;
39 for (uint8_t byte : md5.digestValue())
40 EXPECT_EQ(byte, bytes[i++]);
37 vector<uint8_t> bytes = {0x78, 0x1e, 0x5e, 0x24, 0x5d, 0x69, 0xb5, 0x66, 0x97, 0x9b, 0x86, 0xe2, 0x8d, 0x23, 0xf2, 0xc7};
38 EXPECT_EQ(md5.digestValue(), bytes);
4139 }
4240
4341
5149 xxh32.reset();
5250 xxh32.update("0123456789");
5351 EXPECT_EQ(xxh32.digestString(), "950c9c0a");
54 uint8_t bytes[] = {0x95, 0x0c, 0x9c, 0x0a};
55 int i=0;
56 for (uint8_t byte : xxh32.digestValue())
57 EXPECT_EQ(byte, bytes[i++]);
52 vector<uint8_t> bytes = {0x95, 0x0c, 0x9c, 0x0a};
53 EXPECT_EQ(xxh32.digestValue(), bytes);
5854 }
5955
6056
6864 xxh64.reset();
6965 xxh64.update("0123456789");
7066 EXPECT_EQ(xxh64.digestString(), "3f5fc178a81867e7");
71 uint8_t bytes[] = {0x3f, 0x5f, 0xc1, 0x78, 0xa8, 0x18, 0x67, 0xe7};
72 int i=0;
73 for (uint8_t byte : xxh64.digestValue())
74 EXPECT_EQ(byte, bytes[i++]);
67 vector<uint8_t> bytes = {0x3f, 0x5f, 0xc1, 0x78, 0xa8, 0x18, 0x67, 0xe7};
68 EXPECT_EQ(xxh64.digestValue(), bytes);
7569 }
70
71
72 #ifdef ENABLE_XXH128
73 TEST(HashFunctionTest, xxh128) {
74 XXH128HashFunction xxh128;
75 ASSERT_EQ(xxh128.digestSize(), 16);
76 xxh128.update("0123456789");
77 EXPECT_EQ(xxh128.digestString(), "942eb242912d99ecb1844fcc57198e3a");
78 xxh128.update("abcdefghij");
79 EXPECT_EQ(xxh128.digestString(), "f37bc26b7087c656f0345fdf02a75bc4");
80 xxh128.reset();
81 xxh128.update("0123456789");
82 EXPECT_EQ(xxh128.digestString(), "942eb242912d99ecb1844fcc57198e3a");
83 vector<uint8_t> bytes = {0x94, 0x2e, 0xb2, 0x42, 0x91, 0x2d, 0x99, 0xec, 0xb1, 0x84, 0x4f, 0xcc, 0x57, 0x19, 0x8e, 0x3a};
84 EXPECT_EQ(xxh128.digestValue(), bytes);
85 }
86 #endif
7687
7788
7889 TEST(HashFunctionTest, createMD5) {
111122 }
112123
113124
125 #ifdef ENABLE_XXH128
126 TEST(HashFunctionTest, createXXH128) {
127 auto hashfunc = HashFunction::create("xxh128");
128 ASSERT_TRUE(dynamic_cast<XXH128HashFunction*>(hashfunc.get()) != nullptr);
129 hashfunc->update("0123456789");
130 EXPECT_EQ(hashfunc->digestString(), "942eb242912d99ecb1844fcc57198e3a");
131
132 hashfunc = HashFunction::create("xxh128", "0123456789");
133 ASSERT_TRUE(dynamic_cast<XXH128HashFunction*>(hashfunc.get()) != nullptr);
134 EXPECT_EQ(hashfunc->digestString(), "942eb242912d99ecb1844fcc57198e3a");
135 }
136 #endif
137
138
114139 TEST(HashFunctionTest, createFail) {
115140 ASSERT_TRUE(HashFunction::create("not-available") == nullptr);
116 }
141 }
1515 gtest/src/gtest-filepath.cc \
1616 gtest/src/gtest-internal-inl.h \
1717 gtest/src/gtest_main.cc \
18 gtest/src/gtest-matchers.cc \
1819 gtest/src/gtest-port.cc \
1920 gtest/src/gtest-printers.cc \
2021 gtest/src/gtest-test-part.cc \
116117 CommandLineTest_CPPFLAGS = -I$(dvisvgm_srcdir)/tests/gtest/include $(LIBS_CFLAGS)
117118 CommandLineTest_LDADD = $(TESTLIBS)
118119
119 TESTS += CRC32Test
120 check_PROGRAMS += CRC32Test
121 CRC32Test_SOURCES = CRC32Test.cpp testutil.hpp
122 CRC32Test_CPPFLAGS = -I$(dvisvgm_srcdir)/tests/gtest/include $(LIBS_CFLAGS)
123 CRC32Test_LDADD = $(TESTLIBS)
124
125120 TESTS += DependencyGraphTest
126121 check_PROGRAMS += DependencyGraphTest
127122 DependencyGraphTest_SOURCES = DependencyGraphTest.cpp testutil.hpp
146141 DvisvgmSpecialTest_CPPFLAGS = -I$(dvisvgm_srcdir)/tests/gtest/include $(LIBS_CFLAGS)
147142 DvisvgmSpecialTest_LDADD = $(TESTLIBS)
148143
144 TESTS += EllipticalArcTest
145 check_PROGRAMS += EllipticalArcTest
146 EllipticalArcTest_SOURCES = EllipticalArcTest.cpp testutil.hpp
147 EllipticalArcTest_CPPFLAGS = -I$(dvisvgm_srcdir)/tests/gtest/include $(LIBS_CFLAGS)
148 EllipticalArcTest_LDADD = $(TESTLIBS)
149
149150 TESTS += EmSpecialTest
150151 check_PROGRAMS += EmSpecialTest
151152 EmSpecialTest_SOURCES = EmSpecialTest.cpp testutil.hpp
100100 BoundingBoxTest$(EXEEXT) CalculatorTest$(EXEEXT) \
101101 CMapManagerTest$(EXEEXT) CMapReaderTest$(EXEEXT) \
102102 CMapTest$(EXEEXT) ColorSpecialTest$(EXEEXT) ColorTest$(EXEEXT) \
103 CommandLineTest$(EXEEXT) CRC32Test$(EXEEXT) \
104 DependencyGraphTest$(EXEEXT) DirectoryTest$(EXEEXT) \
105 DVIReaderTest$(EXEEXT) DvisvgmSpecialTest$(EXEEXT) \
103 CommandLineTest$(EXEEXT) DependencyGraphTest$(EXEEXT) \
104 DirectoryTest$(EXEEXT) DVIReaderTest$(EXEEXT) \
105 DvisvgmSpecialTest$(EXEEXT) EllipticalArcTest$(EXEEXT) \
106106 EmSpecialTest$(EXEEXT) FileFinderTest$(EXEEXT) \
107107 FilePathTest$(EXEEXT) FileSystemTest$(EXEEXT) \
108108 FontCacheTest$(EXEEXT) FontManagerTest$(EXEEXT) \
131131 CalculatorTest$(EXEEXT) CMapManagerTest$(EXEEXT) \
132132 CMapReaderTest$(EXEEXT) CMapTest$(EXEEXT) \
133133 ColorSpecialTest$(EXEEXT) ColorTest$(EXEEXT) \
134 CommandLineTest$(EXEEXT) CRC32Test$(EXEEXT) \
135 DependencyGraphTest$(EXEEXT) DirectoryTest$(EXEEXT) \
136 DVIReaderTest$(EXEEXT) DvisvgmSpecialTest$(EXEEXT) \
134 CommandLineTest$(EXEEXT) DependencyGraphTest$(EXEEXT) \
135 DirectoryTest$(EXEEXT) DVIReaderTest$(EXEEXT) \
136 DvisvgmSpecialTest$(EXEEXT) EllipticalArcTest$(EXEEXT) \
137137 EmSpecialTest$(EXEEXT) FileFinderTest$(EXEEXT) \
138138 FilePathTest$(EXEEXT) FileSystemTest$(EXEEXT) \
139139 FontCacheTest$(EXEEXT) FontManagerTest$(EXEEXT) \
160160 @ENABLE_WOFF_TRUE@am__append_10 = ../libs/ff-woff/libfontforge.a
161161 subdir = tests
162162 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
163 am__aclocal_m4_deps = $(top_srcdir)/configure.ac
163 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_compile_flag.m4 \
164 $(top_srcdir)/m4/ax_code_coverage.m4 \
165 $(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \
166 $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
167 $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
168 $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac
164169 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
165170 $(ACLOCAL_M4)
166171 DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
210215 am_CMapTest_OBJECTS = CMapTest-CMapTest.$(OBJEXT)
211216 CMapTest_OBJECTS = $(am_CMapTest_OBJECTS)
212217 CMapTest_DEPENDENCIES = $(am__DEPENDENCIES_7)
213 am_CRC32Test_OBJECTS = CRC32Test-CRC32Test.$(OBJEXT)
214 CRC32Test_OBJECTS = $(am_CRC32Test_OBJECTS)
215 CRC32Test_DEPENDENCIES = $(am__DEPENDENCIES_7)
216218 am_CalculatorTest_OBJECTS = CalculatorTest-CalculatorTest.$(OBJEXT)
217219 CalculatorTest_OBJECTS = $(am_CalculatorTest_OBJECTS)
218220 CalculatorTest_DEPENDENCIES = $(am__DEPENDENCIES_7)
241243 DvisvgmSpecialTest-DvisvgmSpecialTest.$(OBJEXT)
242244 DvisvgmSpecialTest_OBJECTS = $(am_DvisvgmSpecialTest_OBJECTS)
243245 DvisvgmSpecialTest_DEPENDENCIES = $(am__DEPENDENCIES_7)
246 am_EllipticalArcTest_OBJECTS = \
247 EllipticalArcTest-EllipticalArcTest.$(OBJEXT)
248 EllipticalArcTest_OBJECTS = $(am_EllipticalArcTest_OBJECTS)
249 EllipticalArcTest_DEPENDENCIES = $(am__DEPENDENCIES_7)
244250 am_EmSpecialTest_OBJECTS = EmSpecialTest-EmSpecialTest.$(OBJEXT)
245251 EmSpecialTest_OBJECTS = $(am_EmSpecialTest_OBJECTS)
246252 EmSpecialTest_DEPENDENCIES = $(am__DEPENDENCIES_7)
418424 ./$(DEPDIR)/CMapManagerTest-CMapManagerTest.Po \
419425 ./$(DEPDIR)/CMapReaderTest-CMapReaderTest.Po \
420426 ./$(DEPDIR)/CMapTest-CMapTest.Po \
421 ./$(DEPDIR)/CRC32Test-CRC32Test.Po \
422427 ./$(DEPDIR)/CalculatorTest-CalculatorTest.Po \
423428 ./$(DEPDIR)/ColorSpecialTest-ColorSpecialTest.Po \
424429 ./$(DEPDIR)/ColorTest-ColorTest.Po \
427432 ./$(DEPDIR)/DependencyGraphTest-DependencyGraphTest.Po \
428433 ./$(DEPDIR)/DirectoryTest-DirectoryTest.Po \
429434 ./$(DEPDIR)/DvisvgmSpecialTest-DvisvgmSpecialTest.Po \
435 ./$(DEPDIR)/EllipticalArcTest-EllipticalArcTest.Po \
430436 ./$(DEPDIR)/EmSpecialTest-EmSpecialTest.Po \
431437 ./$(DEPDIR)/FileFinderTest-FileFinderTest.Po \
432438 ./$(DEPDIR)/FilePathTest-FilePathTest.Po \
514520 SOURCES = $(libgtest_la_SOURCES) $(BezierTest_SOURCES) \
515521 $(BitmapTest_SOURCES) $(BoundingBoxTest_SOURCES) \
516522 $(CMapManagerTest_SOURCES) $(CMapReaderTest_SOURCES) \
517 $(CMapTest_SOURCES) $(CRC32Test_SOURCES) \
518 $(CalculatorTest_SOURCES) $(ColorSpecialTest_SOURCES) \
519 $(ColorTest_SOURCES) $(CommandLineTest_SOURCES) \
520 $(DVIReaderTest_SOURCES) $(DependencyGraphTest_SOURCES) \
521 $(DirectoryTest_SOURCES) $(DvisvgmSpecialTest_SOURCES) \
523 $(CMapTest_SOURCES) $(CalculatorTest_SOURCES) \
524 $(ColorSpecialTest_SOURCES) $(ColorTest_SOURCES) \
525 $(CommandLineTest_SOURCES) $(DVIReaderTest_SOURCES) \
526 $(DependencyGraphTest_SOURCES) $(DirectoryTest_SOURCES) \
527 $(DvisvgmSpecialTest_SOURCES) $(EllipticalArcTest_SOURCES) \
522528 $(EmSpecialTest_SOURCES) $(FileFinderTest_SOURCES) \
523529 $(FilePathTest_SOURCES) $(FileSystemTest_SOURCES) \
524530 $(FontCacheTest_SOURCES) $(FontManagerTest_SOURCES) \
546552 DIST_SOURCES = $(libgtest_la_SOURCES) $(BezierTest_SOURCES) \
547553 $(BitmapTest_SOURCES) $(BoundingBoxTest_SOURCES) \
548554 $(CMapManagerTest_SOURCES) $(CMapReaderTest_SOURCES) \
549 $(CMapTest_SOURCES) $(CRC32Test_SOURCES) \
550 $(CalculatorTest_SOURCES) $(ColorSpecialTest_SOURCES) \
551 $(ColorTest_SOURCES) $(CommandLineTest_SOURCES) \
552 $(DVIReaderTest_SOURCES) $(DependencyGraphTest_SOURCES) \
553 $(DirectoryTest_SOURCES) $(DvisvgmSpecialTest_SOURCES) \
555 $(CMapTest_SOURCES) $(CalculatorTest_SOURCES) \
556 $(ColorSpecialTest_SOURCES) $(ColorTest_SOURCES) \
557 $(CommandLineTest_SOURCES) $(DVIReaderTest_SOURCES) \
558 $(DependencyGraphTest_SOURCES) $(DirectoryTest_SOURCES) \
559 $(DvisvgmSpecialTest_SOURCES) $(EllipticalArcTest_SOURCES) \
554560 $(EmSpecialTest_SOURCES) $(FileFinderTest_SOURCES) \
555561 $(FilePathTest_SOURCES) $(FileSystemTest_SOURCES) \
556562 $(FontCacheTest_SOURCES) $(FontManagerTest_SOURCES) \
10121018 EXTRA_DIST = gtest/LICENSE gtest/include gtest/src/gtest.cc \
10131019 gtest/src/gtest-death-test.cc gtest/src/gtest-filepath.cc \
10141020 gtest/src/gtest-internal-inl.h gtest/src/gtest_main.cc \
1015 gtest/src/gtest-port.cc gtest/src/gtest-printers.cc \
1016 gtest/src/gtest-test-part.cc gtest/src/gtest-typed-test.cc \
1017 check-conv genhashcheck.py normalize.xsl
1021 gtest/src/gtest-matchers.cc gtest/src/gtest-port.cc \
1022 gtest/src/gtest-printers.cc gtest/src/gtest-test-part.cc \
1023 gtest/src/gtest-typed-test.cc check-conv genhashcheck.py \
1024 normalize.xsl
10181025 @HAVE_POTRACE_FALSE@POTRACE_CFLAGS = -I$(dvisvgm_srcdir)/libs/potrace
10191026 @HAVE_POTRACE_FALSE@POTRACE_LIBS = ../libs/potrace/libpotrace.a
10201027 @HAVE_XXHASH_FALSE@XXHASH_CFLAGS = -I$(dvisvgm_srcdir)/libs/xxHash
10621069 CommandLineTest_SOURCES = CommandLineTest.cpp testutil.hpp
10631070 CommandLineTest_CPPFLAGS = -I$(dvisvgm_srcdir)/tests/gtest/include $(LIBS_CFLAGS)
10641071 CommandLineTest_LDADD = $(TESTLIBS)
1065 CRC32Test_SOURCES = CRC32Test.cpp testutil.hpp
1066 CRC32Test_CPPFLAGS = -I$(dvisvgm_srcdir)/tests/gtest/include $(LIBS_CFLAGS)
1067 CRC32Test_LDADD = $(TESTLIBS)
10681072 DependencyGraphTest_SOURCES = DependencyGraphTest.cpp testutil.hpp
10691073 DependencyGraphTest_CPPFLAGS = -I$(dvisvgm_srcdir)/tests/gtest/include $(LIBS_CFLAGS)
10701074 DependencyGraphTest_LDADD = $(TESTLIBS)
10771081 DvisvgmSpecialTest_SOURCES = DvisvgmSpecialTest.cpp testutil.hpp
10781082 DvisvgmSpecialTest_CPPFLAGS = -I$(dvisvgm_srcdir)/tests/gtest/include $(LIBS_CFLAGS)
10791083 DvisvgmSpecialTest_LDADD = $(TESTLIBS)
1084 EllipticalArcTest_SOURCES = EllipticalArcTest.cpp testutil.hpp
1085 EllipticalArcTest_CPPFLAGS = -I$(dvisvgm_srcdir)/tests/gtest/include $(LIBS_CFLAGS)
1086 EllipticalArcTest_LDADD = $(TESTLIBS)
10801087 EmSpecialTest_SOURCES = EmSpecialTest.cpp testutil.hpp
10811088 EmSpecialTest_CPPFLAGS = -I$(dvisvgm_srcdir)/tests/gtest/include $(LIBS_CFLAGS)
10821089 EmSpecialTest_LDADD = $(TESTLIBS)
12231230 exit 1;; \
12241231 esac; \
12251232 done; \
1226 echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tests/Makefile'; \
1233 echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign tests/Makefile'; \
12271234 $(am__cd) $(top_srcdir) && \
1228 $(AUTOMAKE) --gnu tests/Makefile
1235 $(AUTOMAKE) --foreign tests/Makefile
12291236 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
12301237 @case '$?' in \
12311238 *config.status*) \
13001307 @rm -f CMapTest$(EXEEXT)
13011308 $(AM_V_CXXLD)$(CXXLINK) $(CMapTest_OBJECTS) $(CMapTest_LDADD) $(LIBS)
13021309
1303 CRC32Test$(EXEEXT): $(CRC32Test_OBJECTS) $(CRC32Test_DEPENDENCIES) $(EXTRA_CRC32Test_DEPENDENCIES)
1304 @rm -f CRC32Test$(EXEEXT)
1305 $(AM_V_CXXLD)$(CXXLINK) $(CRC32Test_OBJECTS) $(CRC32Test_LDADD) $(LIBS)
1306
13071310 CalculatorTest$(EXEEXT): $(CalculatorTest_OBJECTS) $(CalculatorTest_DEPENDENCIES) $(EXTRA_CalculatorTest_DEPENDENCIES)
13081311 @rm -f CalculatorTest$(EXEEXT)
13091312 $(AM_V_CXXLD)$(CXXLINK) $(CalculatorTest_OBJECTS) $(CalculatorTest_LDADD) $(LIBS)
13351338 DvisvgmSpecialTest$(EXEEXT): $(DvisvgmSpecialTest_OBJECTS) $(DvisvgmSpecialTest_DEPENDENCIES) $(EXTRA_DvisvgmSpecialTest_DEPENDENCIES)
13361339 @rm -f DvisvgmSpecialTest$(EXEEXT)
13371340 $(AM_V_CXXLD)$(CXXLINK) $(DvisvgmSpecialTest_OBJECTS) $(DvisvgmSpecialTest_LDADD) $(LIBS)
1341
1342 EllipticalArcTest$(EXEEXT): $(EllipticalArcTest_OBJECTS) $(EllipticalArcTest_DEPENDENCIES) $(EXTRA_EllipticalArcTest_DEPENDENCIES)
1343 @rm -f EllipticalArcTest$(EXEEXT)
1344 $(AM_V_CXXLD)$(CXXLINK) $(EllipticalArcTest_OBJECTS) $(EllipticalArcTest_LDADD) $(LIBS)
13381345
13391346 EmSpecialTest$(EXEEXT): $(EmSpecialTest_OBJECTS) $(EmSpecialTest_DEPENDENCIES) $(EXTRA_EmSpecialTest_DEPENDENCIES)
13401347 @rm -f EmSpecialTest$(EXEEXT)
15301537 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CMapManagerTest-CMapManagerTest.Po@am__quote@ # am--include-marker
15311538 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CMapReaderTest-CMapReaderTest.Po@am__quote@ # am--include-marker
15321539 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CMapTest-CMapTest.Po@am__quote@ # am--include-marker
1533 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CRC32Test-CRC32Test.Po@am__quote@ # am--include-marker
15341540 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CalculatorTest-CalculatorTest.Po@am__quote@ # am--include-marker
15351541 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ColorSpecialTest-ColorSpecialTest.Po@am__quote@ # am--include-marker
15361542 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ColorTest-ColorTest.Po@am__quote@ # am--include-marker
15391545 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DependencyGraphTest-DependencyGraphTest.Po@am__quote@ # am--include-marker
15401546 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DirectoryTest-DirectoryTest.Po@am__quote@ # am--include-marker
15411547 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DvisvgmSpecialTest-DvisvgmSpecialTest.Po@am__quote@ # am--include-marker
1548 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/EllipticalArcTest-EllipticalArcTest.Po@am__quote@ # am--include-marker
15421549 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/EmSpecialTest-EmSpecialTest.Po@am__quote@ # am--include-marker
15431550 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/FileFinderTest-FileFinderTest.Po@am__quote@ # am--include-marker
15441551 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/FilePathTest-FilePathTest.Po@am__quote@ # am--include-marker
17151722 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
17161723 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CMapTest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o CMapTest-CMapTest.obj `if test -f 'CMapTest.cpp'; then $(CYGPATH_W) 'CMapTest.cpp'; else $(CYGPATH_W) '$(srcdir)/CMapTest.cpp'; fi`
17171724
1718 CRC32Test-CRC32Test.o: CRC32Test.cpp
1719 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC32Test_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT CRC32Test-CRC32Test.o -MD -MP -MF $(DEPDIR)/CRC32Test-CRC32Test.Tpo -c -o CRC32Test-CRC32Test.o `test -f 'CRC32Test.cpp' || echo '$(srcdir)/'`CRC32Test.cpp
1720 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/CRC32Test-CRC32Test.Tpo $(DEPDIR)/CRC32Test-CRC32Test.Po
1721 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='CRC32Test.cpp' object='CRC32Test-CRC32Test.o' libtool=no @AMDEPBACKSLASH@
1722 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
1723 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC32Test_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o CRC32Test-CRC32Test.o `test -f 'CRC32Test.cpp' || echo '$(srcdir)/'`CRC32Test.cpp
1724
1725 CRC32Test-CRC32Test.obj: CRC32Test.cpp
1726 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC32Test_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT CRC32Test-CRC32Test.obj -MD -MP -MF $(DEPDIR)/CRC32Test-CRC32Test.Tpo -c -o CRC32Test-CRC32Test.obj `if test -f 'CRC32Test.cpp'; then $(CYGPATH_W) 'CRC32Test.cpp'; else $(CYGPATH_W) '$(srcdir)/CRC32Test.cpp'; fi`
1727 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/CRC32Test-CRC32Test.Tpo $(DEPDIR)/CRC32Test-CRC32Test.Po
1728 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='CRC32Test.cpp' object='CRC32Test-CRC32Test.obj' libtool=no @AMDEPBACKSLASH@
1729 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
1730 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC32Test_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o CRC32Test-CRC32Test.obj `if test -f 'CRC32Test.cpp'; then $(CYGPATH_W) 'CRC32Test.cpp'; else $(CYGPATH_W) '$(srcdir)/CRC32Test.cpp'; fi`
1731
17321725 CalculatorTest-CalculatorTest.o: CalculatorTest.cpp
17331726 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CalculatorTest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT CalculatorTest-CalculatorTest.o -MD -MP -MF $(DEPDIR)/CalculatorTest-CalculatorTest.Tpo -c -o CalculatorTest-CalculatorTest.o `test -f 'CalculatorTest.cpp' || echo '$(srcdir)/'`CalculatorTest.cpp
17341727 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/CalculatorTest-CalculatorTest.Tpo $(DEPDIR)/CalculatorTest-CalculatorTest.Po
18401833 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='DvisvgmSpecialTest.cpp' object='DvisvgmSpecialTest-DvisvgmSpecialTest.obj' libtool=no @AMDEPBACKSLASH@
18411834 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
18421835 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(DvisvgmSpecialTest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o DvisvgmSpecialTest-DvisvgmSpecialTest.obj `if test -f 'DvisvgmSpecialTest.cpp'; then $(CYGPATH_W) 'DvisvgmSpecialTest.cpp'; else $(CYGPATH_W) '$(srcdir)/DvisvgmSpecialTest.cpp'; fi`
1836
1837 EllipticalArcTest-EllipticalArcTest.o: EllipticalArcTest.cpp
1838 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(EllipticalArcTest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT EllipticalArcTest-EllipticalArcTest.o -MD -MP -MF $(DEPDIR)/EllipticalArcTest-EllipticalArcTest.Tpo -c -o EllipticalArcTest-EllipticalArcTest.o `test -f 'EllipticalArcTest.cpp' || echo '$(srcdir)/'`EllipticalArcTest.cpp
1839 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/EllipticalArcTest-EllipticalArcTest.Tpo $(DEPDIR)/EllipticalArcTest-EllipticalArcTest.Po
1840 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='EllipticalArcTest.cpp' object='EllipticalArcTest-EllipticalArcTest.o' libtool=no @AMDEPBACKSLASH@
1841 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
1842 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(EllipticalArcTest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o EllipticalArcTest-EllipticalArcTest.o `test -f 'EllipticalArcTest.cpp' || echo '$(srcdir)/'`EllipticalArcTest.cpp
1843
1844 EllipticalArcTest-EllipticalArcTest.obj: EllipticalArcTest.cpp
1845 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(EllipticalArcTest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT EllipticalArcTest-EllipticalArcTest.obj -MD -MP -MF $(DEPDIR)/EllipticalArcTest-EllipticalArcTest.Tpo -c -o EllipticalArcTest-EllipticalArcTest.obj `if test -f 'EllipticalArcTest.cpp'; then $(CYGPATH_W) 'EllipticalArcTest.cpp'; else $(CYGPATH_W) '$(srcdir)/EllipticalArcTest.cpp'; fi`
1846 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/EllipticalArcTest-EllipticalArcTest.Tpo $(DEPDIR)/EllipticalArcTest-EllipticalArcTest.Po
1847 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='EllipticalArcTest.cpp' object='EllipticalArcTest-EllipticalArcTest.obj' libtool=no @AMDEPBACKSLASH@
1848 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
1849 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(EllipticalArcTest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o EllipticalArcTest-EllipticalArcTest.obj `if test -f 'EllipticalArcTest.cpp'; then $(CYGPATH_W) 'EllipticalArcTest.cpp'; else $(CYGPATH_W) '$(srcdir)/EllipticalArcTest.cpp'; fi`
18431850
18441851 EmSpecialTest-EmSpecialTest.o: EmSpecialTest.cpp
18451852 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(EmSpecialTest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT EmSpecialTest-EmSpecialTest.o -MD -MP -MF $(DEPDIR)/EmSpecialTest-EmSpecialTest.Tpo -c -o EmSpecialTest-EmSpecialTest.o `test -f 'EmSpecialTest.cpp' || echo '$(srcdir)/'`EmSpecialTest.cpp
28192826 --log-file $$b.log --trs-file $$b.trs \
28202827 $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
28212828 "$$tst" $(AM_TESTS_FD_REDIRECT)
2822 CRC32Test.log: CRC32Test$(EXEEXT)
2823 @p='CRC32Test$(EXEEXT)'; \
2824 b='CRC32Test'; \
2825 $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
2826 --log-file $$b.log --trs-file $$b.trs \
2827 $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
2828 "$$tst" $(AM_TESTS_FD_REDIRECT)
28292829 DependencyGraphTest.log: DependencyGraphTest$(EXEEXT)
28302830 @p='DependencyGraphTest$(EXEEXT)'; \
28312831 b='DependencyGraphTest'; \
28502850 DvisvgmSpecialTest.log: DvisvgmSpecialTest$(EXEEXT)
28512851 @p='DvisvgmSpecialTest$(EXEEXT)'; \
28522852 b='DvisvgmSpecialTest'; \
2853 $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
2854 --log-file $$b.log --trs-file $$b.trs \
2855 $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
2856 "$$tst" $(AM_TESTS_FD_REDIRECT)
2857 EllipticalArcTest.log: EllipticalArcTest$(EXEEXT)
2858 @p='EllipticalArcTest$(EXEEXT)'; \
2859 b='EllipticalArcTest'; \
28532860 $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
28542861 --log-file $$b.log --trs-file $$b.trs \
28552862 $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
32973304 -rm -f ./$(DEPDIR)/CMapManagerTest-CMapManagerTest.Po
32983305 -rm -f ./$(DEPDIR)/CMapReaderTest-CMapReaderTest.Po
32993306 -rm -f ./$(DEPDIR)/CMapTest-CMapTest.Po
3300 -rm -f ./$(DEPDIR)/CRC32Test-CRC32Test.Po
33013307 -rm -f ./$(DEPDIR)/CalculatorTest-CalculatorTest.Po
33023308 -rm -f ./$(DEPDIR)/ColorSpecialTest-ColorSpecialTest.Po
33033309 -rm -f ./$(DEPDIR)/ColorTest-ColorTest.Po
33063312 -rm -f ./$(DEPDIR)/DependencyGraphTest-DependencyGraphTest.Po
33073313 -rm -f ./$(DEPDIR)/DirectoryTest-DirectoryTest.Po
33083314 -rm -f ./$(DEPDIR)/DvisvgmSpecialTest-DvisvgmSpecialTest.Po
3315 -rm -f ./$(DEPDIR)/EllipticalArcTest-EllipticalArcTest.Po
33093316 -rm -f ./$(DEPDIR)/EmSpecialTest-EmSpecialTest.Po
33103317 -rm -f ./$(DEPDIR)/FileFinderTest-FileFinderTest.Po
33113318 -rm -f ./$(DEPDIR)/FilePathTest-FilePathTest.Po
34043411 -rm -f ./$(DEPDIR)/CMapManagerTest-CMapManagerTest.Po
34053412 -rm -f ./$(DEPDIR)/CMapReaderTest-CMapReaderTest.Po
34063413 -rm -f ./$(DEPDIR)/CMapTest-CMapTest.Po
3407 -rm -f ./$(DEPDIR)/CRC32Test-CRC32Test.Po
34083414 -rm -f ./$(DEPDIR)/CalculatorTest-CalculatorTest.Po
34093415 -rm -f ./$(DEPDIR)/ColorSpecialTest-ColorSpecialTest.Po
34103416 -rm -f ./$(DEPDIR)/ColorTest-ColorTest.Po
34133419 -rm -f ./$(DEPDIR)/DependencyGraphTest-DependencyGraphTest.Po
34143420 -rm -f ./$(DEPDIR)/DirectoryTest-DirectoryTest.Po
34153421 -rm -f ./$(DEPDIR)/DvisvgmSpecialTest-DvisvgmSpecialTest.Po
3422 -rm -f ./$(DEPDIR)/EllipticalArcTest-EllipticalArcTest.Po
34163423 -rm -f ./$(DEPDIR)/EmSpecialTest-EmSpecialTest.Po
34173424 -rm -f ./$(DEPDIR)/FileFinderTest-FileFinderTest.Po
34183425 -rm -f ./$(DEPDIR)/FilePathTest-FilePathTest.Po
3737
3838 TEST_F(SVGOutputTest, defaults) {
3939 SVGOutput out("SVGOutputTest.cpp", "");
40 EXPECT_EQ(out.filename(1, 1), "SVGOutputTest.svg");
41 EXPECT_EQ(out.filename(5, 9), "SVGOutputTest-5.svg");
42 EXPECT_EQ(out.filename(5, 10), "SVGOutputTest-05.svg");
43 EXPECT_EQ(out.filename(5, 256), "SVGOutputTest-005.svg");
40 EXPECT_EQ(out.filepath(1, 1).relative(), "SVGOutputTest.svg");
41 EXPECT_EQ(out.filepath(5, 9).relative(), "SVGOutputTest-5.svg");
42 EXPECT_EQ(out.filepath(5, 10).relative(), "SVGOutputTest-05.svg");
43 EXPECT_EQ(out.filepath(5, 256).relative(), "SVGOutputTest-005.svg");
4444 }
4545
4646
4747 TEST_F(SVGOutputTest, widthSpecifier) {
4848 {
4949 SVGOutput out("SVGOutputTest.cpp", "%f--%3p");
50 EXPECT_EQ(out.filename(5, 9), "SVGOutputTest--005.svg");
51 EXPECT_EQ(out.filename(54, 65), "SVGOutputTest--054.svg");
52 EXPECT_EQ(out.filename(543, 654), "SVGOutputTest--543.svg");
50 EXPECT_EQ(out.filepath(5, 9).relative(), "SVGOutputTest--005.svg");
51 EXPECT_EQ(out.filepath(54, 65).relative(), "SVGOutputTest--054.svg");
52 EXPECT_EQ(out.filepath(543, 654).relative(), "SVGOutputTest--543.svg");
5353 }{
5454 SVGOutput out("SVGOutputTest.cpp", "%f--%3p--%P");
55 EXPECT_EQ(out.filename(5, 9), "SVGOutputTest--005--9.svg");
56 EXPECT_EQ(out.filename(54, 65), "SVGOutputTest--054--65.svg");
57 EXPECT_EQ(out.filename(543, 654), "SVGOutputTest--543--654.svg");
55 EXPECT_EQ(out.filepath(5, 9).relative(), "SVGOutputTest--005--9.svg");
56 EXPECT_EQ(out.filepath(54, 65).relative(), "SVGOutputTest--054--65.svg");
57 EXPECT_EQ(out.filepath(543, 654).relative(), "SVGOutputTest--543--654.svg");
5858 }{
5959 SVGOutput out("SVGOutputTest.cpp", "%f--%3p--%3P");
60 EXPECT_EQ(out.filename(5, 9), "SVGOutputTest--005--009.svg");
61 EXPECT_EQ(out.filename(54, 65), "SVGOutputTest--054--065.svg");
62 EXPECT_EQ(out.filename(543, 654), "SVGOutputTest--543--654.svg");
60 EXPECT_EQ(out.filepath(5, 9).relative(), "SVGOutputTest--005--009.svg");
61 EXPECT_EQ(out.filepath(54, 65).relative(), "SVGOutputTest--054--065.svg");
62 EXPECT_EQ(out.filepath(543, 654).relative(), "SVGOutputTest--543--654.svg");
6363 }{
6464 SVGOutput out("SVGOutputTest.cpp", "%5f--%3p--%3P");
65 EXPECT_EQ(out.filename(5, 9), "SVGOutputTest--005--009.svg");
66 EXPECT_EQ(out.filename(54, 65), "SVGOutputTest--054--065.svg");
67 EXPECT_EQ(out.filename(543, 654), "SVGOutputTest--543--654.svg");
65 EXPECT_EQ(out.filepath(5, 9).relative(), "SVGOutputTest--005--009.svg");
66 EXPECT_EQ(out.filepath(54, 65).relative(), "SVGOutputTest--054--065.svg");
67 EXPECT_EQ(out.filepath(543, 654).relative(), "SVGOutputTest--543--654.svg");
6868 }
6969 }
7070
7272 TEST_F(SVGOutputTest, expressions) {
7373 {
7474 SVGOutput out("SVGOutputTest.cpp", "no-macro");
75 EXPECT_EQ(out.filename(5, 9), "no-macro.svg");
76 EXPECT_EQ(out.filename(54, 65), "no-macro.svg");
77 EXPECT_EQ(out.filename(543, 654), "no-macro.svg");
75 EXPECT_EQ(out.filepath(5, 9).relative(), "no-macro.svg");
76 EXPECT_EQ(out.filepath(54, 65).relative(), "no-macro.svg");
77 EXPECT_EQ(out.filepath(543, 654).relative(), "no-macro.svg");
7878 }{
7979 SVGOutput out("SVGOutputTest.cpp", "%f--%(p-1)");
80 EXPECT_EQ(out.filename(5, 9), "SVGOutputTest--4.svg");
81 EXPECT_EQ(out.filename(54, 65), "SVGOutputTest--53.svg");
82 EXPECT_EQ(out.filename(543, 654), "SVGOutputTest--542.svg");
80 EXPECT_EQ(out.filepath(5, 9).relative(), "SVGOutputTest--4.svg");
81 EXPECT_EQ(out.filepath(54, 65).relative(), "SVGOutputTest--53.svg");
82 EXPECT_EQ(out.filepath(543, 654).relative(), "SVGOutputTest--542.svg");
8383 }{
8484 SVGOutput out("SVGOutputTest.cpp", "%f--%3(p-1)");
85 EXPECT_EQ(out.filename(5, 9), "SVGOutputTest--004.svg");
86 EXPECT_EQ(out.filename(54, 65), "SVGOutputTest--053.svg");
87 EXPECT_EQ(out.filename(543, 654), "SVGOutputTest--542.svg");
85 EXPECT_EQ(out.filepath(5, 9).relative(), "SVGOutputTest--004.svg");
86 EXPECT_EQ(out.filepath(54, 65).relative(), "SVGOutputTest--053.svg");
87 EXPECT_EQ(out.filepath(543, 654).relative(), "SVGOutputTest--542.svg");
8888 }{
8989 SVGOutput out("SVGOutputTest.cpp", "%f--%3(P+2p)");
90 EXPECT_EQ(out.filename(5, 9), "SVGOutputTest--019.svg");
91 EXPECT_EQ(out.filename(54, 65), "SVGOutputTest--173.svg");
92 EXPECT_EQ(out.filename(543, 654), "SVGOutputTest--1740.svg");
90 EXPECT_EQ(out.filepath(5, 9).relative(), "SVGOutputTest--019.svg");
91 EXPECT_EQ(out.filepath(54, 65).relative(), "SVGOutputTest--173.svg");
92 EXPECT_EQ(out.filepath(543, 654).relative(), "SVGOutputTest--1740.svg");
9393 }
9494 }
9595
9898 SVGOutput::HashTriple hashes("dvihash", "opthash", "cmbhash");
9999 {
100100 SVGOutput out("SVGOutputTest.cpp", "%f-%hd-x");
101 EXPECT_EQ(out.filename(1, 10), "SVGOutputTest--x.svg");
102 EXPECT_EQ(out.filename(1, 10, hashes), "SVGOutputTest-dvihash-x.svg");
101 EXPECT_EQ(out.filepath(1, 10).relative(), "SVGOutputTest--x.svg");
102 EXPECT_EQ(out.filepath(1, 10, hashes).relative(), "SVGOutputTest-dvihash-x.svg");
103103 }{
104104 SVGOutput out("SVGOutputTest.cpp", "%f-%hd-x-%hc%ho");
105 EXPECT_EQ(out.filename(1, 10), "SVGOutputTest--x-.svg");
106 EXPECT_EQ(out.filename(1, 10, hashes), "SVGOutputTest-dvihash-x-cmbhashopthash.svg");
105 EXPECT_EQ(out.filepath(1, 10).relative(), "SVGOutputTest--x-.svg");
106 EXPECT_EQ(out.filepath(1, 10, hashes).relative(), "SVGOutputTest-dvihash-x-cmbhashopthash.svg");
107107 }{
108108 SVGOutput out("SVGOutputTest.cpp", "%f-%hd%p%ho");
109 EXPECT_EQ(out.filename(1, 10), "SVGOutputTest-01.svg");
110 EXPECT_EQ(out.filename(1, 10, hashes), "SVGOutputTest-dvihash01opthash.svg");
109 EXPECT_EQ(out.filepath(1, 10).relative(), "SVGOutputTest-01.svg");
110 EXPECT_EQ(out.filepath(1, 10, hashes).relative(), "SVGOutputTest-dvihash01opthash.svg");
111111 }
112112 }
113113
116116 SVGOutput::HashTriple hashes("dvihash", "opthash", "cmbhash");
117117 {
118118 SVGOutput out("SVGOutputTest.cpp", "%f-%h-x");
119 EXPECT_THROW(out.filename(1, 10), MessageException);
120 EXPECT_THROW(out.filename(1, 10, hashes), MessageException);
119 EXPECT_THROW(out.filepath(1, 10).relative(), MessageException);
120 EXPECT_THROW(out.filepath(1, 10, hashes).relative(), MessageException);
121121 }{
122122 SVGOutput out("SVGOutputTest.cpp", "%f-%hd-x-%ha%ho");
123 EXPECT_THROW(out.filename(1, 10), MessageException);
124 EXPECT_THROW(out.filename(1, 10, hashes), MessageException);
123 EXPECT_THROW(out.filepath(1, 10).relative(), MessageException);
124 EXPECT_THROW(out.filepath(1, 10, hashes).relative(), MessageException);
125125 }
126126 }
127127
150150
151151 TEST_F(SVGOutputTest, ignore) {
152152 SVGOutput out("SVGOutputTest.cpp", "%x %y");
153 EXPECT_EQ(out.filename(5, 9), "SVGOutputTest-5.svg");
153 EXPECT_EQ(out.filepath(5, 9).relative(), "SVGOutputTest-5.svg");
154154 }
155155
156156
157157 TEST_F(SVGOutputTest, error) {
158158 SVGOutput out("SVGOutputTest.cpp", "%(p/0)");
159 EXPECT_THROW(out.filename(5, 9), MessageException);
159 EXPECT_THROW(out.filepath(5, 9).relative(), MessageException);
160160 }
2121 #include <fstream>
2222 #include <sstream>
2323 #include <string>
24 #include "CRC32.hpp"
2524 #include "StreamReader.hpp"
25 #include "XXHashFunction.hpp"
2626
2727 using namespace std;
2828
4040 }
4141
4242
43 TEST(StreamReaderTest, readStringCRC) {
43 TEST(StreamReaderTest, readString_hashed) {
4444 string str1 = "dvisvgm converts DVI files to SVG.";
4545 istringstream iss(str1);
4646 ASSERT_TRUE(bool(iss));
4747 StreamReader reader(iss);
48 CRC32 crc;
49 string str2 = reader.readString(iss.str().length(), crc);
48 XXH32HashFunction hashfunc;
49 string str2 = reader.readString(iss.str().length(), hashfunc);
5050 EXPECT_EQ(str1, str2);
51 EXPECT_EQ(crc.get(), 0x7c4ef359u);
51 EXPECT_EQ(hashfunc.digestString(), "190cc9d2");
5252 iss.clear();
5353 iss.str(str1);
54 crc.reset();
55 str2 = reader.readString(crc, false);
56 EXPECT_EQ(crc.get(), 0x7c4ef359u);
54 hashfunc.reset();
55 str2 = reader.readString(hashfunc, false);
56 EXPECT_EQ(hashfunc.digestString(), "190cc9d2");
5757 }
5858
5959
6666 }
6767
6868
69 TEST(StreamReaderTest, readUnsignedCRC) {
69 TEST(StreamReaderTest, readUnsigned_hashed) {
7070 string str = "\x01\x02\x03\x04";
7171 istringstream iss(str);
7272 StreamReader reader(iss);
73 CRC32 crc;
74 uint32_t val = reader.readUnsigned(4, crc);
73 XXH32HashFunction hashfunc;
74 uint32_t val = reader.readUnsigned(4, hashfunc);
7575 EXPECT_EQ(val, 0x01020304u);
76 EXPECT_EQ(crc.get(), 0xb63cfbcdu);
76 EXPECT_EQ(hashfunc.digestString(), "fe96d19c");
7777 }
7878
7979
8686 }
8787
8888
89 TEST(StreamReaderTest, readSignedCRC) {
89 TEST(StreamReaderTest, readSigned_hashed) {
9090 string str = "\xff\xee\xdd\xcc";
9191 istringstream iss(str);
9292 StreamReader reader(iss);
93 CRC32 crc;
94 int32_t val = reader.readSigned(4, crc);
93 XXH32HashFunction hashfunc;
94 int32_t val = reader.readSigned(4, hashfunc);
9595 EXPECT_EQ(val, int32_t(0xffeeddcc));
96 EXPECT_EQ(crc.get(), 0xfa79118eu);
96 EXPECT_EQ(hashfunc.digestString(), "8baa29bd");
9797 }
9898
9999
101101 string str = "\xff\xee\xdd\xcc";
102102 istringstream iss(str);
103103 StreamReader reader(iss);
104 vector<uint8_t> bytes(4);
105 memset(&bytes[0], 0, 4);
106 reader.readBytes(3, bytes);
104 vector<uint8_t> bytes = reader.readBytes(3);
105 EXPECT_EQ(bytes.size(), 3u);
107106 EXPECT_EQ(bytes[0], 0xff);
108107 EXPECT_EQ(bytes[1], 0xee);
109108 EXPECT_EQ(bytes[2], 0xdd);
110 EXPECT_EQ(bytes[3], 0);
111109 }
112110
113111
114 TEST(StreamReaderTest, readBytesCRC) {
112 TEST(StreamReaderTest, readBytes_hashed) {
115113 string str = "\xff\xee\xdd\xcc";
116114 istringstream iss(str);
117115 StreamReader reader(iss);
118 vector<uint8_t> bytes(4);
119 memset(&bytes[0], 0, 4);
120 CRC32 crc;
121 reader.readBytes(3, bytes, crc);
116 XXH32HashFunction hashfunc;
117 vector<uint8_t> bytes = reader.readBytes(3, hashfunc);
118 EXPECT_EQ(bytes.size(), 3u);
122119 EXPECT_EQ(bytes[0], 0xff);
123120 EXPECT_EQ(bytes[1], 0xee);
124121 EXPECT_EQ(bytes[2], 0xdd);
125 EXPECT_EQ(bytes[3], 0);
126 EXPECT_EQ(crc.get(), 0x68ab9f15u);
127 int byte = reader.readByte(crc);
122 EXPECT_EQ(hashfunc.digestString(), "5eda43a0");
123 int byte = reader.readByte(hashfunc);
128124 EXPECT_EQ(byte, 0xcc);
129 EXPECT_EQ(crc.get(), 0x2d652e62u);
125 EXPECT_EQ(hashfunc.digestString(), "8baa29bd");
130126 }
131127
2020 #include <gtest/gtest.h>
2121 #include <sstream>
2222 #include <string>
23 #include "CRC32.hpp"
2423 #include "StreamWriter.hpp"
24 #include "XXHashFunction.hpp"
2525
2626 using namespace std;
2727
3939 }
4040
4141
42 TEST(StreamWriterTest, writeStringCRC) {
42 TEST(StreamWriterTest, writeString_hashed) {
4343 ostringstream oss;
4444 StreamWriter writer(oss);
45 CRC32 crc;
45 XXH32HashFunction hashfunc;
4646 string str = "dvisvgm converts DVI files to SVG.";
47 writer.writeString(str, crc);
47 writer.writeString(str, hashfunc);
4848 EXPECT_EQ(oss.str(), str);
49 EXPECT_EQ(crc.get(), 0x7C4EF359u);
49 EXPECT_EQ(hashfunc.digestString(), "190cc9d2");
5050
5151 oss.str("");
52 crc.reset();
53 writer.writeString(str, crc, true);
52 hashfunc.reset();
53 writer.writeString(str, hashfunc, true);
5454 str.push_back('\0');
5555 EXPECT_EQ(oss.str(), str);
56 EXPECT_EQ(crc.get(), 0xc0c9482e);
56 EXPECT_EQ(hashfunc.digestString(), "f82e1606");
5757 }
5858
5959
7070 }
7171
7272
73 TEST(StreamWriterTest, writeUnsignedCRC) {
73 TEST(StreamWriterTest, writeUnsigned_hashed) {
7474 ostringstream oss;
7575 StreamWriter writer(oss);
76 CRC32 crc;
77 writer.writeUnsigned(0x00010203, 4, crc);
76 XXH32HashFunction hashfunc;
77 writer.writeUnsigned(0x00010203, 4, hashfunc);
7878 string str;
7979 str.push_back('\x00');
8080 str.push_back('\x01');
8181 str.push_back('\x02');
8282 str.push_back('\x03');
8383 EXPECT_EQ(oss.str(), str);
84 EXPECT_EQ(crc.get(), 0x8bb98613);
84 EXPECT_EQ(hashfunc.digestString(), "80691e66");
8585 }
8686
8787
9494 }
9595
9696
97 TEST(StreamWriterTest, writeSignedCRC) {
97 TEST(StreamWriterTest, writeSigned_hashed) {
9898 ostringstream oss;
9999 StreamWriter writer(oss);
100 CRC32 crc;
101 writer.writeSigned(0xffeeddcc, 4, crc);
100 XXH32HashFunction hashfunc;
101 writer.writeSigned(0xffeeddcc, 4, hashfunc);
102102 string str = "\xff\xee\xdd\xcc";
103103 EXPECT_EQ(oss.str(), str);
104 EXPECT_EQ(crc.get(), 0xfa79118e);
104 EXPECT_EQ(hashfunc.digestString(), "8baa29bd");
105105 }
234234
235235
236236 TEST_F(TensorProductPatchTest, boundaryPath) {
237 GraphicsPath<double> path;
238 _patch.getBoundaryPath(path);
237 GraphicsPath<double> path = _patch.getBoundaryPath();
239238 ostringstream oss;
240239 path.writeSVG(oss, false);
241240 EXPECT_EQ(oss.str(), "M10 10C20 0 50 30 70 20C80 50 90 60 100 70C70 100 20 100 10 70C20 40 0 30 10 10Z");
245244 TEST_F(TensorProductPatchTest, subpatch) {
246245 TensorProductPatch tpp;
247246 _patch.subpatch(0, 0.5, 0, 0.5, tpp);
248 GraphicsPath<double> path;
249 tpp.getBoundaryPath(path);
247 GraphicsPath<double> path = tpp.getBoundaryPath();
250248 ostringstream oss;
251249 path.writeSVG(oss, false);
252250 EXPECT_EQ(oss.str(), "M10 10C5 20 7.5 27.5 10 36.25C20.625 46.875 31.25 52.1875 43.28125 54.21875C40 40.9375 36.25 27.5 36.25 15C25 10 15 5 10 10Z");
258256
259257
260258 TEST_F(TensorProductPatchTest, bbox) {
261 BoundingBox bbox;
262 _patch.getBBox(bbox);
259 BoundingBox bbox = _patch.getBBox();
263260 EXPECT_NEAR(bbox.minX(), 7.1132, 0.0001);
264261 EXPECT_NEAR(bbox.minY(), 7.9289, 0.0001);
265262 EXPECT_DOUBLE_EQ(bbox.maxX(), 100.0);
342342 recorder.clear();
343343 handler.processSpecial("ar", "0 0 1000 500 0 "+to_string(3*math::PI/4));
344344 EXPECT_EQ(recorder.getXMLSnippet(),
345 "<path d='M72 0A72 36 0 0 1 -50.91 25.46' stroke-width='1' stroke='#000' stroke-linecap='round' fill='none'/>"
345 "<path d='M72 0A72 36 0 0 1-50.91 25.46' stroke-width='1' stroke='#000' stroke-linecap='round' fill='none'/>"
346346 );
347347 recorder.clear();
348348 handler.processSpecial("ar", "0 0 1000 500 0 "+to_string(math::PI));
349349 EXPECT_EQ(recorder.getXMLSnippet(),
350 "<path d='M72 0A72 36 0 1 1 -72 0' stroke-width='1' stroke='#000' stroke-linecap='round' fill='none'/>"
350 "<path d='M72 0A72 36 0 1 1-72 0' stroke-width='1' stroke='#000' stroke-linecap='round' fill='none'/>"
351351 );
352352 recorder.clear();
353353 handler.processSpecial("ar", "0 0 1000 500 0 "+to_string(5*math::PI/4));
354354 EXPECT_EQ(recorder.getXMLSnippet(),
355 "<path d='M72 0A72 36 0 1 1 -50.91 -25.46' stroke-width='1' stroke='#000' stroke-linecap='round' fill='none'/>"
355 "<path d='M72 0A72 36 0 1 1-50.91-25.46' stroke-width='1' stroke='#000' stroke-linecap='round' fill='none'/>"
356356 );
357357 recorder.clear();
358358 handler.processSpecial("ar", "0 0 1000 500 0 "+to_string(3*math::PI/2));
359359 EXPECT_EQ(recorder.getXMLSnippet(),
360 "<path d='M72 0A72 36 0 1 1 0 -36' stroke-width='1' stroke='#000' stroke-linecap='round' fill='none'/>"
360 "<path d='M72 0A72 36 0 1 1 0-36' stroke-width='1' stroke='#000' stroke-linecap='round' fill='none'/>"
361361 );
362362 recorder.clear();
363363 handler.processSpecial("ar", "0 0 1000 500 0 "+to_string(-3*math::PI/2));
122122 points[2] = DPair(0, 10);
123123 vector<Color> colors(3);
124124 TriangularPatch tp(points, colors, Color::ColorSpace::RGB, 0, 0);
125 BoundingBox bbox;
126 tp.getBBox(bbox);
125 BoundingBox bbox = tp.getBBox();
127126 EXPECT_EQ(bbox, BoundingBox(0, 0, 10, 10));
128127 }
129128
135134 points[2] = DPair(0, 10);
136135 vector<Color> colors(3);
137136 TriangularPatch tp(points, colors, Color::ColorSpace::RGB, 0, 0);
138 GraphicsPath<double> path;
139 tp.getBoundaryPath(path);
137 GraphicsPath<double> path = tp.getBoundaryPath();
140138 ostringstream oss;
141139 path.writeSVG(oss, false);
142140 EXPECT_EQ(oss.str(), "M0 0H10L0 10Z");
8989 target_triplet = @target@
9090 subdir = tests/data
9191 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
92 am__aclocal_m4_deps = $(top_srcdir)/configure.ac
92 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_compile_flag.m4 \
93 $(top_srcdir)/m4/ax_code_coverage.m4 \
94 $(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \
95 $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
96 $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
97 $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac
9398 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
9499 $(ACLOCAL_M4)
95100 DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
307312 exit 1;; \
308313 esac; \
309314 done; \
310 echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tests/data/Makefile'; \
315 echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign tests/data/Makefile'; \
311316 $(am__cd) $(top_srcdir) && \
312 $(AUTOMAKE) --gnu tests/data/Makefile
317 $(AUTOMAKE) --foreign tests/data/Makefile
313318 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
314319 @case '$?' in \
315320 *config.status*) \
160160 // is rarely a problem as people usually don't put the test binary
161161 // directory in PATH.
162162 //
163 // FIXME: make thread-safe death tests search the PATH.
164163
165164 // Asserts that a given statement causes the program to exit, with an
166165 // integer exit status that satisfies predicate, and emitting error output
169168 GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_FATAL_FAILURE_)
170169
171170 // Like ASSERT_EXIT, but continues on to successive tests in the
172 // test case, if any:
171 // test suite, if any:
173172 # define EXPECT_EXIT(statement, predicate, regex) \
174173 GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_NONFATAL_FAILURE_)
175174
180179 ASSERT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex)
181180
182181 // Like ASSERT_DEATH, but continues on to successive tests in the
183 // test case, if any:
182 // test suite, if any:
184183 # define EXPECT_DEATH(statement, regex) \
185184 EXPECT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex)
186185
227226 // return 12;
228227 // }
229228 //
230 // TEST(TestCase, TestDieOr12WorksInDgbAndOpt) {
229 // TEST(TestSuite, TestDieOr12WorksInDgbAndOpt) {
231230 // int sideeffect = 0;
232231 // // Only asserts in dbg.
233232 // EXPECT_DEBUG_DEATH(DieInDebugOr12(&sideeffect), "death");
276275 // This macro is used for implementing macros such as
277276 // EXPECT_DEATH_IF_SUPPORTED and ASSERT_DEATH_IF_SUPPORTED on systems where
278277 // death tests are not supported. Those macros must compile on such systems
279 // iff EXPECT_DEATH and ASSERT_DEATH compile with the same parameters on
280 // systems that support death tests. This allows one to write such a macro
281 // on a system that does not support death tests and be sure that it will
282 // compile on a death-test supporting system. It is exposed publicly so that
283 // systems that have death-tests with stricter requirements than
284 // GTEST_HAS_DEATH_TEST can write their own equivalent of
285 // EXPECT_DEATH_IF_SUPPORTED and ASSERT_DEATH_IF_SUPPORTED.
278 // if and only if EXPECT_DEATH and ASSERT_DEATH compile with the same parameters
279 // on systems that support death tests. This allows one to write such a macro on
280 // a system that does not support death tests and be sure that it will compile
281 // on a death-test supporting system. It is exposed publicly so that systems
282 // that have death-tests with stricter requirements than GTEST_HAS_DEATH_TEST
283 // can write their own equivalent of EXPECT_DEATH_IF_SUPPORTED and
284 // ASSERT_DEATH_IF_SUPPORTED.
286285 //
287286 // Parameters:
288287 // statement - A statement that a macro such as EXPECT_DEATH would test
289288 // for program termination. This macro has to make sure this
290289 // statement is compiled but not executed, to ensure that
291290 // EXPECT_DEATH_IF_SUPPORTED compiles with a certain
292 // parameter iff EXPECT_DEATH compiles with it.
291 // parameter if and only if EXPECT_DEATH compiles with it.
293292 // regex - A regex that a macro such as EXPECT_DEATH would use to test
294293 // the output of statement. This parameter has to be
295294 // compiled but not evaluated by this macro, to ensure that
0 // Copyright 2007, Google Inc.
1 // All rights reserved.
2 //
3 // Redistribution and use in source and binary forms, with or without
4 // modification, are permitted provided that the following conditions are
5 // met:
6 //
7 // * Redistributions of source code must retain the above copyright
8 // notice, this list of conditions and the following disclaimer.
9 // * Redistributions in binary form must reproduce the above
10 // copyright notice, this list of conditions and the following disclaimer
11 // in the documentation and/or other materials provided with the
12 // distribution.
13 // * Neither the name of Google Inc. nor the names of its
14 // contributors may be used to endorse or promote products derived from
15 // this software without specific prior written permission.
16 //
17 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
21 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28
29 // The Google C++ Testing and Mocking Framework (Google Test)
30 //
31 // This file implements just enough of the matcher interface to allow
32 // EXPECT_DEATH and friends to accept a matcher argument.
33
34 // IWYU pragma: private, include "testing/base/public/gunit.h"
35 // IWYU pragma: friend third_party/googletest/googlemock/.*
36 // IWYU pragma: friend third_party/googletest/googletest/.*
37
38 #ifndef GTEST_INCLUDE_GTEST_GTEST_MATCHERS_H_
39 #define GTEST_INCLUDE_GTEST_GTEST_MATCHERS_H_
40
41 #include <memory>
42 #include <ostream>
43 #include <string>
44 #include <type_traits>
45
46 #include "gtest/gtest-printers.h"
47 #include "gtest/internal/gtest-internal.h"
48 #include "gtest/internal/gtest-port.h"
49
50 // MSVC warning C5046 is new as of VS2017 version 15.8.
51 #if defined(_MSC_VER) && _MSC_VER >= 1915
52 #define GTEST_MAYBE_5046_ 5046
53 #else
54 #define GTEST_MAYBE_5046_
55 #endif
56
57 GTEST_DISABLE_MSC_WARNINGS_PUSH_(
58 4251 GTEST_MAYBE_5046_ /* class A needs to have dll-interface to be used by
59 clients of class B */
60 /* Symbol involving type with internal linkage not defined */)
61
62 namespace testing {
63
64 // To implement a matcher Foo for type T, define:
65 // 1. a class FooMatcherImpl that implements the
66 // MatcherInterface<T> interface, and
67 // 2. a factory function that creates a Matcher<T> object from a
68 // FooMatcherImpl*.
69 //
70 // The two-level delegation design makes it possible to allow a user
71 // to write "v" instead of "Eq(v)" where a Matcher is expected, which
72 // is impossible if we pass matchers by pointers. It also eases
73 // ownership management as Matcher objects can now be copied like
74 // plain values.
75
76 // MatchResultListener is an abstract class. Its << operator can be
77 // used by a matcher to explain why a value matches or doesn't match.
78 //
79 class MatchResultListener {
80 public:
81 // Creates a listener object with the given underlying ostream. The
82 // listener does not own the ostream, and does not dereference it
83 // in the constructor or destructor.
84 explicit MatchResultListener(::std::ostream* os) : stream_(os) {}
85 virtual ~MatchResultListener() = 0; // Makes this class abstract.
86
87 // Streams x to the underlying ostream; does nothing if the ostream
88 // is NULL.
89 template <typename T>
90 MatchResultListener& operator<<(const T& x) {
91 if (stream_ != nullptr) *stream_ << x;
92 return *this;
93 }
94
95 // Returns the underlying ostream.
96 ::std::ostream* stream() { return stream_; }
97
98 // Returns true if and only if the listener is interested in an explanation
99 // of the match result. A matcher's MatchAndExplain() method can use
100 // this information to avoid generating the explanation when no one
101 // intends to hear it.
102 bool IsInterested() const { return stream_ != nullptr; }
103
104 private:
105 ::std::ostream* const stream_;
106
107 GTEST_DISALLOW_COPY_AND_ASSIGN_(MatchResultListener);
108 };
109
110 inline MatchResultListener::~MatchResultListener() {
111 }
112
113 // An instance of a subclass of this knows how to describe itself as a
114 // matcher.
115 class MatcherDescriberInterface {
116 public:
117 virtual ~MatcherDescriberInterface() {}
118
119 // Describes this matcher to an ostream. The function should print
120 // a verb phrase that describes the property a value matching this
121 // matcher should have. The subject of the verb phrase is the value
122 // being matched. For example, the DescribeTo() method of the Gt(7)
123 // matcher prints "is greater than 7".
124 virtual void DescribeTo(::std::ostream* os) const = 0;
125
126 // Describes the negation of this matcher to an ostream. For
127 // example, if the description of this matcher is "is greater than
128 // 7", the negated description could be "is not greater than 7".
129 // You are not required to override this when implementing
130 // MatcherInterface, but it is highly advised so that your matcher
131 // can produce good error messages.
132 virtual void DescribeNegationTo(::std::ostream* os) const {
133 *os << "not (";
134 DescribeTo(os);
135 *os << ")";
136 }
137 };
138
139 // The implementation of a matcher.
140 template <typename T>
141 class MatcherInterface : public MatcherDescriberInterface {
142 public:
143 // Returns true if and only if the matcher matches x; also explains the
144 // match result to 'listener' if necessary (see the next paragraph), in
145 // the form of a non-restrictive relative clause ("which ...",
146 // "whose ...", etc) that describes x. For example, the
147 // MatchAndExplain() method of the Pointee(...) matcher should
148 // generate an explanation like "which points to ...".
149 //
150 // Implementations of MatchAndExplain() should add an explanation of
151 // the match result *if and only if* they can provide additional
152 // information that's not already present (or not obvious) in the
153 // print-out of x and the matcher's description. Whether the match
154 // succeeds is not a factor in deciding whether an explanation is
155 // needed, as sometimes the caller needs to print a failure message
156 // when the match succeeds (e.g. when the matcher is used inside
157 // Not()).
158 //
159 // For example, a "has at least 10 elements" matcher should explain
160 // what the actual element count is, regardless of the match result,
161 // as it is useful information to the reader; on the other hand, an
162 // "is empty" matcher probably only needs to explain what the actual
163 // size is when the match fails, as it's redundant to say that the
164 // size is 0 when the value is already known to be empty.
165 //
166 // You should override this method when defining a new matcher.
167 //
168 // It's the responsibility of the caller (Google Test) to guarantee
169 // that 'listener' is not NULL. This helps to simplify a matcher's
170 // implementation when it doesn't care about the performance, as it
171 // can talk to 'listener' without checking its validity first.
172 // However, in order to implement dummy listeners efficiently,
173 // listener->stream() may be NULL.
174 virtual bool MatchAndExplain(T x, MatchResultListener* listener) const = 0;
175
176 // Inherits these methods from MatcherDescriberInterface:
177 // virtual void DescribeTo(::std::ostream* os) const = 0;
178 // virtual void DescribeNegationTo(::std::ostream* os) const;
179 };
180
181 namespace internal {
182
183 // Converts a MatcherInterface<T> to a MatcherInterface<const T&>.
184 template <typename T>
185 class MatcherInterfaceAdapter : public MatcherInterface<const T&> {
186 public:
187 explicit MatcherInterfaceAdapter(const MatcherInterface<T>* impl)
188 : impl_(impl) {}
189 ~MatcherInterfaceAdapter() override { delete impl_; }
190
191 void DescribeTo(::std::ostream* os) const override { impl_->DescribeTo(os); }
192
193 void DescribeNegationTo(::std::ostream* os) const override {
194 impl_->DescribeNegationTo(os);
195 }
196
197 bool MatchAndExplain(const T& x,
198 MatchResultListener* listener) const override {
199 return impl_->MatchAndExplain(x, listener);
200 }
201
202 private:
203 const MatcherInterface<T>* const impl_;
204
205 GTEST_DISALLOW_COPY_AND_ASSIGN_(MatcherInterfaceAdapter);
206 };
207
208 struct AnyEq {
209 template <typename A, typename B>
210 bool operator()(const A& a, const B& b) const { return a == b; }
211 };
212 struct AnyNe {
213 template <typename A, typename B>
214 bool operator()(const A& a, const B& b) const { return a != b; }
215 };
216 struct AnyLt {
217 template <typename A, typename B>
218 bool operator()(const A& a, const B& b) const { return a < b; }
219 };
220 struct AnyGt {
221 template <typename A, typename B>
222 bool operator()(const A& a, const B& b) const { return a > b; }
223 };
224 struct AnyLe {
225 template <typename A, typename B>
226 bool operator()(const A& a, const B& b) const { return a <= b; }
227 };
228 struct AnyGe {
229 template <typename A, typename B>
230 bool operator()(const A& a, const B& b) const { return a >= b; }
231 };
232
233 // A match result listener that ignores the explanation.
234 class DummyMatchResultListener : public MatchResultListener {
235 public:
236 DummyMatchResultListener() : MatchResultListener(nullptr) {}
237
238 private:
239 GTEST_DISALLOW_COPY_AND_ASSIGN_(DummyMatchResultListener);
240 };
241
242 // A match result listener that forwards the explanation to a given
243 // ostream. The difference between this and MatchResultListener is
244 // that the former is concrete.
245 class StreamMatchResultListener : public MatchResultListener {
246 public:
247 explicit StreamMatchResultListener(::std::ostream* os)
248 : MatchResultListener(os) {}
249
250 private:
251 GTEST_DISALLOW_COPY_AND_ASSIGN_(StreamMatchResultListener);
252 };
253
254 // An internal class for implementing Matcher<T>, which will derive
255 // from it. We put functionalities common to all Matcher<T>
256 // specializations here to avoid code duplication.
257 template <typename T>
258 class MatcherBase {
259 public:
260 // Returns true if and only if the matcher matches x; also explains the
261 // match result to 'listener'.
262 bool MatchAndExplain(const T& x, MatchResultListener* listener) const {
263 return impl_->MatchAndExplain(x, listener);
264 }
265
266 // Returns true if and only if this matcher matches x.
267 bool Matches(const T& x) const {
268 DummyMatchResultListener dummy;
269 return MatchAndExplain(x, &dummy);
270 }
271
272 // Describes this matcher to an ostream.
273 void DescribeTo(::std::ostream* os) const { impl_->DescribeTo(os); }
274
275 // Describes the negation of this matcher to an ostream.
276 void DescribeNegationTo(::std::ostream* os) const {
277 impl_->DescribeNegationTo(os);
278 }
279
280 // Explains why x matches, or doesn't match, the matcher.
281 void ExplainMatchResultTo(const T& x, ::std::ostream* os) const {
282 StreamMatchResultListener listener(os);
283 MatchAndExplain(x, &listener);
284 }
285
286 // Returns the describer for this matcher object; retains ownership
287 // of the describer, which is only guaranteed to be alive when
288 // this matcher object is alive.
289 const MatcherDescriberInterface* GetDescriber() const {
290 return impl_.get();
291 }
292
293 protected:
294 MatcherBase() {}
295
296 // Constructs a matcher from its implementation.
297 explicit MatcherBase(const MatcherInterface<const T&>* impl) : impl_(impl) {}
298
299 template <typename U>
300 explicit MatcherBase(
301 const MatcherInterface<U>* impl,
302 typename std::enable_if<!std::is_same<U, const U&>::value>::type* =
303 nullptr)
304 : impl_(new internal::MatcherInterfaceAdapter<U>(impl)) {}
305
306 MatcherBase(const MatcherBase&) = default;
307 MatcherBase& operator=(const MatcherBase&) = default;
308 MatcherBase(MatcherBase&&) = default;
309 MatcherBase& operator=(MatcherBase&&) = default;
310
311 virtual ~MatcherBase() {}
312
313 private:
314 std::shared_ptr<const MatcherInterface<const T&>> impl_;
315 };
316
317 } // namespace internal
318
319 // A Matcher<T> is a copyable and IMMUTABLE (except by assignment)
320 // object that can check whether a value of type T matches. The
321 // implementation of Matcher<T> is just a std::shared_ptr to const
322 // MatcherInterface<T>. Don't inherit from Matcher!
323 template <typename T>
324 class Matcher : public internal::MatcherBase<T> {
325 public:
326 // Constructs a null matcher. Needed for storing Matcher objects in STL
327 // containers. A default-constructed matcher is not yet initialized. You
328 // cannot use it until a valid value has been assigned to it.
329 explicit Matcher() {} // NOLINT
330
331 // Constructs a matcher from its implementation.
332 explicit Matcher(const MatcherInterface<const T&>* impl)
333 : internal::MatcherBase<T>(impl) {}
334
335 template <typename U>
336 explicit Matcher(
337 const MatcherInterface<U>* impl,
338 typename std::enable_if<!std::is_same<U, const U&>::value>::type* =
339 nullptr)
340 : internal::MatcherBase<T>(impl) {}
341
342 // Implicit constructor here allows people to write
343 // EXPECT_CALL(foo, Bar(5)) instead of EXPECT_CALL(foo, Bar(Eq(5))) sometimes
344 Matcher(T value); // NOLINT
345 };
346
347 // The following two specializations allow the user to write str
348 // instead of Eq(str) and "foo" instead of Eq("foo") when a std::string
349 // matcher is expected.
350 template <>
351 class GTEST_API_ Matcher<const std::string&>
352 : public internal::MatcherBase<const std::string&> {
353 public:
354 Matcher() {}
355
356 explicit Matcher(const MatcherInterface<const std::string&>* impl)
357 : internal::MatcherBase<const std::string&>(impl) {}
358
359 // Allows the user to write str instead of Eq(str) sometimes, where
360 // str is a std::string object.
361 Matcher(const std::string& s); // NOLINT
362
363 // Allows the user to write "foo" instead of Eq("foo") sometimes.
364 Matcher(const char* s); // NOLINT
365 };
366
367 template <>
368 class GTEST_API_ Matcher<std::string>
369 : public internal::MatcherBase<std::string> {
370 public:
371 Matcher() {}
372
373 explicit Matcher(const MatcherInterface<const std::string&>* impl)
374 : internal::MatcherBase<std::string>(impl) {}
375 explicit Matcher(const MatcherInterface<std::string>* impl)
376 : internal::MatcherBase<std::string>(impl) {}
377
378 // Allows the user to write str instead of Eq(str) sometimes, where
379 // str is a string object.
380 Matcher(const std::string& s); // NOLINT
381
382 // Allows the user to write "foo" instead of Eq("foo") sometimes.
383 Matcher(const char* s); // NOLINT
384 };
385
386 #if GTEST_HAS_ABSL
387 // The following two specializations allow the user to write str
388 // instead of Eq(str) and "foo" instead of Eq("foo") when a absl::string_view
389 // matcher is expected.
390 template <>
391 class GTEST_API_ Matcher<const absl::string_view&>
392 : public internal::MatcherBase<const absl::string_view&> {
393 public:
394 Matcher() {}
395
396 explicit Matcher(const MatcherInterface<const absl::string_view&>* impl)
397 : internal::MatcherBase<const absl::string_view&>(impl) {}
398
399 // Allows the user to write str instead of Eq(str) sometimes, where
400 // str is a std::string object.
401 Matcher(const std::string& s); // NOLINT
402
403 // Allows the user to write "foo" instead of Eq("foo") sometimes.
404 Matcher(const char* s); // NOLINT
405
406 // Allows the user to pass absl::string_views directly.
407 Matcher(absl::string_view s); // NOLINT
408 };
409
410 template <>
411 class GTEST_API_ Matcher<absl::string_view>
412 : public internal::MatcherBase<absl::string_view> {
413 public:
414 Matcher() {}
415
416 explicit Matcher(const MatcherInterface<const absl::string_view&>* impl)
417 : internal::MatcherBase<absl::string_view>(impl) {}
418 explicit Matcher(const MatcherInterface<absl::string_view>* impl)
419 : internal::MatcherBase<absl::string_view>(impl) {}
420
421 // Allows the user to write str instead of Eq(str) sometimes, where
422 // str is a std::string object.
423 Matcher(const std::string& s); // NOLINT
424
425 // Allows the user to write "foo" instead of Eq("foo") sometimes.
426 Matcher(const char* s); // NOLINT
427
428 // Allows the user to pass absl::string_views directly.
429 Matcher(absl::string_view s); // NOLINT
430 };
431 #endif // GTEST_HAS_ABSL
432
433 // Prints a matcher in a human-readable format.
434 template <typename T>
435 std::ostream& operator<<(std::ostream& os, const Matcher<T>& matcher) {
436 matcher.DescribeTo(&os);
437 return os;
438 }
439
440 // The PolymorphicMatcher class template makes it easy to implement a
441 // polymorphic matcher (i.e. a matcher that can match values of more
442 // than one type, e.g. Eq(n) and NotNull()).
443 //
444 // To define a polymorphic matcher, a user should provide an Impl
445 // class that has a DescribeTo() method and a DescribeNegationTo()
446 // method, and define a member function (or member function template)
447 //
448 // bool MatchAndExplain(const Value& value,
449 // MatchResultListener* listener) const;
450 //
451 // See the definition of NotNull() for a complete example.
452 template <class Impl>
453 class PolymorphicMatcher {
454 public:
455 explicit PolymorphicMatcher(const Impl& an_impl) : impl_(an_impl) {}
456
457 // Returns a mutable reference to the underlying matcher
458 // implementation object.
459 Impl& mutable_impl() { return impl_; }
460
461 // Returns an immutable reference to the underlying matcher
462 // implementation object.
463 const Impl& impl() const { return impl_; }
464
465 template <typename T>
466 operator Matcher<T>() const {
467 return Matcher<T>(new MonomorphicImpl<const T&>(impl_));
468 }
469
470 private:
471 template <typename T>
472 class MonomorphicImpl : public MatcherInterface<T> {
473 public:
474 explicit MonomorphicImpl(const Impl& impl) : impl_(impl) {}
475
476 virtual void DescribeTo(::std::ostream* os) const { impl_.DescribeTo(os); }
477
478 virtual void DescribeNegationTo(::std::ostream* os) const {
479 impl_.DescribeNegationTo(os);
480 }
481
482 virtual bool MatchAndExplain(T x, MatchResultListener* listener) const {
483 return impl_.MatchAndExplain(x, listener);
484 }
485
486 private:
487 const Impl impl_;
488 };
489
490 Impl impl_;
491 };
492
493 // Creates a matcher from its implementation.
494 // DEPRECATED: Especially in the generic code, prefer:
495 // Matcher<T>(new MyMatcherImpl<const T&>(...));
496 //
497 // MakeMatcher may create a Matcher that accepts its argument by value, which
498 // leads to unnecessary copies & lack of support for non-copyable types.
499 template <typename T>
500 inline Matcher<T> MakeMatcher(const MatcherInterface<T>* impl) {
501 return Matcher<T>(impl);
502 }
503
504 // Creates a polymorphic matcher from its implementation. This is
505 // easier to use than the PolymorphicMatcher<Impl> constructor as it
506 // doesn't require you to explicitly write the template argument, e.g.
507 //
508 // MakePolymorphicMatcher(foo);
509 // vs
510 // PolymorphicMatcher<TypeOfFoo>(foo);
511 template <class Impl>
512 inline PolymorphicMatcher<Impl> MakePolymorphicMatcher(const Impl& impl) {
513 return PolymorphicMatcher<Impl>(impl);
514 }
515
516 namespace internal {
517 // Implements a matcher that compares a given value with a
518 // pre-supplied value using one of the ==, <=, <, etc, operators. The
519 // two values being compared don't have to have the same type.
520 //
521 // The matcher defined here is polymorphic (for example, Eq(5) can be
522 // used to match an int, a short, a double, etc). Therefore we use
523 // a template type conversion operator in the implementation.
524 //
525 // The following template definition assumes that the Rhs parameter is
526 // a "bare" type (i.e. neither 'const T' nor 'T&').
527 template <typename D, typename Rhs, typename Op>
528 class ComparisonBase {
529 public:
530 explicit ComparisonBase(const Rhs& rhs) : rhs_(rhs) {}
531 template <typename Lhs>
532 operator Matcher<Lhs>() const {
533 return Matcher<Lhs>(new Impl<const Lhs&>(rhs_));
534 }
535
536 private:
537 template <typename T>
538 static const T& Unwrap(const T& v) { return v; }
539 template <typename T>
540 static const T& Unwrap(std::reference_wrapper<T> v) { return v; }
541
542 template <typename Lhs, typename = Rhs>
543 class Impl : public MatcherInterface<Lhs> {
544 public:
545 explicit Impl(const Rhs& rhs) : rhs_(rhs) {}
546 bool MatchAndExplain(Lhs lhs,
547 MatchResultListener* /* listener */) const override {
548 return Op()(lhs, Unwrap(rhs_));
549 }
550 void DescribeTo(::std::ostream* os) const override {
551 *os << D::Desc() << " ";
552 UniversalPrint(Unwrap(rhs_), os);
553 }
554 void DescribeNegationTo(::std::ostream* os) const override {
555 *os << D::NegatedDesc() << " ";
556 UniversalPrint(Unwrap(rhs_), os);
557 }
558
559 private:
560 Rhs rhs_;
561 };
562 Rhs rhs_;
563 };
564
565 template <typename Rhs>
566 class EqMatcher : public ComparisonBase<EqMatcher<Rhs>, Rhs, AnyEq> {
567 public:
568 explicit EqMatcher(const Rhs& rhs)
569 : ComparisonBase<EqMatcher<Rhs>, Rhs, AnyEq>(rhs) { }
570 static const char* Desc() { return "is equal to"; }
571 static const char* NegatedDesc() { return "isn't equal to"; }
572 };
573 template <typename Rhs>
574 class NeMatcher : public ComparisonBase<NeMatcher<Rhs>, Rhs, AnyNe> {
575 public:
576 explicit NeMatcher(const Rhs& rhs)
577 : ComparisonBase<NeMatcher<Rhs>, Rhs, AnyNe>(rhs) { }
578 static const char* Desc() { return "isn't equal to"; }
579 static const char* NegatedDesc() { return "is equal to"; }
580 };
581 template <typename Rhs>
582 class LtMatcher : public ComparisonBase<LtMatcher<Rhs>, Rhs, AnyLt> {
583 public:
584 explicit LtMatcher(const Rhs& rhs)
585 : ComparisonBase<LtMatcher<Rhs>, Rhs, AnyLt>(rhs) { }
586 static const char* Desc() { return "is <"; }
587 static const char* NegatedDesc() { return "isn't <"; }
588 };
589 template <typename Rhs>
590 class GtMatcher : public ComparisonBase<GtMatcher<Rhs>, Rhs, AnyGt> {
591 public:
592 explicit GtMatcher(const Rhs& rhs)
593 : ComparisonBase<GtMatcher<Rhs>, Rhs, AnyGt>(rhs) { }
594 static const char* Desc() { return "is >"; }
595 static const char* NegatedDesc() { return "isn't >"; }
596 };
597 template <typename Rhs>
598 class LeMatcher : public ComparisonBase<LeMatcher<Rhs>, Rhs, AnyLe> {
599 public:
600 explicit LeMatcher(const Rhs& rhs)
601 : ComparisonBase<LeMatcher<Rhs>, Rhs, AnyLe>(rhs) { }
602 static const char* Desc() { return "is <="; }
603 static const char* NegatedDesc() { return "isn't <="; }
604 };
605 template <typename Rhs>
606 class GeMatcher : public ComparisonBase<GeMatcher<Rhs>, Rhs, AnyGe> {
607 public:
608 explicit GeMatcher(const Rhs& rhs)
609 : ComparisonBase<GeMatcher<Rhs>, Rhs, AnyGe>(rhs) { }
610 static const char* Desc() { return "is >="; }
611 static const char* NegatedDesc() { return "isn't >="; }
612 };
613
614 // Implements polymorphic matchers MatchesRegex(regex) and
615 // ContainsRegex(regex), which can be used as a Matcher<T> as long as
616 // T can be converted to a string.
617 class MatchesRegexMatcher {
618 public:
619 MatchesRegexMatcher(const RE* regex, bool full_match)
620 : regex_(regex), full_match_(full_match) {}
621
622 #if GTEST_HAS_ABSL
623 bool MatchAndExplain(const absl::string_view& s,
624 MatchResultListener* listener) const {
625 return MatchAndExplain(std::string(s), listener);
626 }
627 #endif // GTEST_HAS_ABSL
628
629 // Accepts pointer types, particularly:
630 // const char*
631 // char*
632 // const wchar_t*
633 // wchar_t*
634 template <typename CharType>
635 bool MatchAndExplain(CharType* s, MatchResultListener* listener) const {
636 return s != nullptr && MatchAndExplain(std::string(s), listener);
637 }
638
639 // Matches anything that can convert to std::string.
640 //
641 // This is a template, not just a plain function with const std::string&,
642 // because absl::string_view has some interfering non-explicit constructors.
643 template <class MatcheeStringType>
644 bool MatchAndExplain(const MatcheeStringType& s,
645 MatchResultListener* /* listener */) const {
646 const std::string& s2(s);
647 return full_match_ ? RE::FullMatch(s2, *regex_)
648 : RE::PartialMatch(s2, *regex_);
649 }
650
651 void DescribeTo(::std::ostream* os) const {
652 *os << (full_match_ ? "matches" : "contains") << " regular expression ";
653 UniversalPrinter<std::string>::Print(regex_->pattern(), os);
654 }
655
656 void DescribeNegationTo(::std::ostream* os) const {
657 *os << "doesn't " << (full_match_ ? "match" : "contain")
658 << " regular expression ";
659 UniversalPrinter<std::string>::Print(regex_->pattern(), os);
660 }
661
662 private:
663 const std::shared_ptr<const RE> regex_;
664 const bool full_match_;
665 };
666 } // namespace internal
667
668 // Matches a string that fully matches regular expression 'regex'.
669 // The matcher takes ownership of 'regex'.
670 inline PolymorphicMatcher<internal::MatchesRegexMatcher> MatchesRegex(
671 const internal::RE* regex) {
672 return MakePolymorphicMatcher(internal::MatchesRegexMatcher(regex, true));
673 }
674 inline PolymorphicMatcher<internal::MatchesRegexMatcher> MatchesRegex(
675 const std::string& regex) {
676 return MatchesRegex(new internal::RE(regex));
677 }
678
679 // Matches a string that contains regular expression 'regex'.
680 // The matcher takes ownership of 'regex'.
681 inline PolymorphicMatcher<internal::MatchesRegexMatcher> ContainsRegex(
682 const internal::RE* regex) {
683 return MakePolymorphicMatcher(internal::MatchesRegexMatcher(regex, false));
684 }
685 inline PolymorphicMatcher<internal::MatchesRegexMatcher> ContainsRegex(
686 const std::string& regex) {
687 return ContainsRegex(new internal::RE(regex));
688 }
689
690 // Creates a polymorphic matcher that matches anything equal to x.
691 // Note: if the parameter of Eq() were declared as const T&, Eq("foo")
692 // wouldn't compile.
693 template <typename T>
694 inline internal::EqMatcher<T> Eq(T x) { return internal::EqMatcher<T>(x); }
695
696 // Constructs a Matcher<T> from a 'value' of type T. The constructed
697 // matcher matches any value that's equal to 'value'.
698 template <typename T>
699 Matcher<T>::Matcher(T value) { *this = Eq(value); }
700
701 // Creates a monomorphic matcher that matches anything with type Lhs
702 // and equal to rhs. A user may need to use this instead of Eq(...)
703 // in order to resolve an overloading ambiguity.
704 //
705 // TypedEq<T>(x) is just a convenient short-hand for Matcher<T>(Eq(x))
706 // or Matcher<T>(x), but more readable than the latter.
707 //
708 // We could define similar monomorphic matchers for other comparison
709 // operations (e.g. TypedLt, TypedGe, and etc), but decided not to do
710 // it yet as those are used much less than Eq() in practice. A user
711 // can always write Matcher<T>(Lt(5)) to be explicit about the type,
712 // for example.
713 template <typename Lhs, typename Rhs>
714 inline Matcher<Lhs> TypedEq(const Rhs& rhs) { return Eq(rhs); }
715
716 // Creates a polymorphic matcher that matches anything >= x.
717 template <typename Rhs>
718 inline internal::GeMatcher<Rhs> Ge(Rhs x) {
719 return internal::GeMatcher<Rhs>(x);
720 }
721
722 // Creates a polymorphic matcher that matches anything > x.
723 template <typename Rhs>
724 inline internal::GtMatcher<Rhs> Gt(Rhs x) {
725 return internal::GtMatcher<Rhs>(x);
726 }
727
728 // Creates a polymorphic matcher that matches anything <= x.
729 template <typename Rhs>
730 inline internal::LeMatcher<Rhs> Le(Rhs x) {
731 return internal::LeMatcher<Rhs>(x);
732 }
733
734 // Creates a polymorphic matcher that matches anything < x.
735 template <typename Rhs>
736 inline internal::LtMatcher<Rhs> Lt(Rhs x) {
737 return internal::LtMatcher<Rhs>(x);
738 }
739
740 // Creates a polymorphic matcher that matches anything != x.
741 template <typename Rhs>
742 inline internal::NeMatcher<Rhs> Ne(Rhs x) {
743 return internal::NeMatcher<Rhs>(x);
744 }
745 } // namespace testing
746
747 GTEST_DISABLE_MSC_WARNINGS_POP_() // 4251 5046
748
749 #endif // GTEST_INCLUDE_GTEST_GTEST_MATCHERS_H_
4747 #define GTEST_INCLUDE_GTEST_GTEST_MESSAGE_H_
4848
4949 #include <limits>
50 #include <memory>
5051
5152 #include "gtest/internal/gtest-port.h"
5253
105106 *ss_ << str;
106107 }
107108
108 #if GTEST_OS_SYMBIAN
109 // Streams a value (either a pointer or not) to this object.
110 template <typename T>
111 inline Message& operator <<(const T& value) {
112 StreamHelper(typename internal::is_pointer<T>::type(), value);
113 return *this;
114 }
115 #else
116109 // Streams a non-pointer value to this object.
117110 template <typename T>
118111 inline Message& operator <<(const T& val) {
150143 // as "(null)".
151144 template <typename T>
152145 inline Message& operator <<(T* const& pointer) { // NOLINT
153 if (pointer == NULL) {
146 if (pointer == nullptr) {
154147 *ss_ << "(null)";
155148 } else {
156149 *ss_ << pointer;
157150 }
158151 return *this;
159152 }
160 #endif // GTEST_OS_SYMBIAN
161153
162154 // Since the basic IO manipulators are overloaded for both narrow
163155 // and wide streams, we have to provide this specialized definition
186178 Message& operator <<(const ::std::wstring& wstr);
187179 #endif // GTEST_HAS_STD_WSTRING
188180
189 #if GTEST_HAS_GLOBAL_WSTRING
190 // Converts the given wide string to a narrow string using the UTF-8
191 // encoding, and streams the result to this Message object.
192 Message& operator <<(const ::wstring& wstr);
193 #endif // GTEST_HAS_GLOBAL_WSTRING
194
195181 // Gets the text streamed to this object so far as an std::string.
196182 // Each '\0' character in the buffer is replaced with "\\0".
197183 //
199185 std::string GetString() const;
200186
201187 private:
202 #if GTEST_OS_SYMBIAN
203 // These are needed as the Nokia Symbian Compiler cannot decide between
204 // const T& and const T* in a function template. The Nokia compiler _can_
205 // decide between class template specializations for T and T*, so a
206 // tr1::type_traits-like is_pointer works, and we can overload on that.
207 template <typename T>
208 inline void StreamHelper(internal::true_type /*is_pointer*/, T* pointer) {
209 if (pointer == NULL) {
210 *ss_ << "(null)";
211 } else {
212 *ss_ << pointer;
213 }
214 }
215 template <typename T>
216 inline void StreamHelper(internal::false_type /*is_pointer*/,
217 const T& value) {
218 // See the comments in Message& operator <<(const T&) above for why
219 // we need this using statement.
220 using ::operator <<;
221 *ss_ << value;
222 }
223 #endif // GTEST_OS_SYMBIAN
224
225188 // We'll hold the text streamed to this object here.
226 const internal::scoped_ptr< ::std::stringstream> ss_;
189 const std::unique_ptr< ::std::stringstream> ss_;
227190
228191 // We declare (but don't implement) this to prevent the compiler
229192 // from implementing the assignment operator.
0 // This file was GENERATED by command:
1 // pump.py gtest-param-test.h.pump
2 // DO NOT EDIT BY HAND!!!
3
40 // Copyright 2008, Google Inc.
51 // All rights reserved.
62 //
7470 ...
7571 }
7672
77 // Finally, you can use INSTANTIATE_TEST_CASE_P to instantiate the test
73 // Finally, you can use INSTANTIATE_TEST_SUITE_P to instantiate the test
7874 // case with any set of parameters you want. Google Test defines a number
7975 // of functions for generating test parameters. They return what we call
8076 // (surprise!) parameter generators. Here is a summary of them, which
9591 // For more details, see comments at the definitions of these functions below
9692 // in this file.
9793 //
98 // The following statement will instantiate tests from the FooTest test case
94 // The following statement will instantiate tests from the FooTest test suite
9995 // each with parameter values "meeny", "miny", and "moe".
10096
101 INSTANTIATE_TEST_CASE_P(InstantiationName,
102 FooTest,
103 Values("meeny", "miny", "moe"));
97 INSTANTIATE_TEST_SUITE_P(InstantiationName,
98 FooTest,
99 Values("meeny", "miny", "moe"));
104100
105101 // To distinguish different instances of the pattern, (yes, you
106 // can instantiate it more then once) the first argument to the
107 // INSTANTIATE_TEST_CASE_P macro is a prefix that will be added to the
108 // actual test case name. Remember to pick unique prefixes for different
102 // can instantiate it more than once) the first argument to the
103 // INSTANTIATE_TEST_SUITE_P macro is a prefix that will be added to the
104 // actual test suite name. Remember to pick unique prefixes for different
109105 // instantiations. The tests from the instantiation above will have
110106 // these names:
111107 //
122118 // with parameter values "cat" and "dog":
123119
124120 const char* pets[] = {"cat", "dog"};
125 INSTANTIATE_TEST_CASE_P(AnotherInstantiationName, FooTest, ValuesIn(pets));
121 INSTANTIATE_TEST_SUITE_P(AnotherInstantiationName, FooTest, ValuesIn(pets));
126122
127123 // The tests from the instantiation above will have these names:
128124 //
131127 // * AnotherInstantiationName/FooTest.HasBlahBlah/0 for "cat"
132128 // * AnotherInstantiationName/FooTest.HasBlahBlah/1 for "dog"
133129 //
134 // Please note that INSTANTIATE_TEST_CASE_P will instantiate all tests
135 // in the given test case, whether their definitions come before or
136 // AFTER the INSTANTIATE_TEST_CASE_P statement.
130 // Please note that INSTANTIATE_TEST_SUITE_P will instantiate all tests
131 // in the given test suite, whether their definitions come before or
132 // AFTER the INSTANTIATE_TEST_SUITE_P statement.
137133 //
138134 // Please also note that generator expressions (including parameters to the
139135 // generators) are evaluated in InitGoogleTest(), after main() has started.
177173
178174 #endif // 0
179175
180 #include "gtest/internal/gtest-port.h"
181
182 #if !GTEST_OS_SYMBIAN
183 # include <utility>
184 #endif
176 #include <iterator>
177 #include <utility>
185178
186179 #include "gtest/internal/gtest-internal.h"
187180 #include "gtest/internal/gtest-param-util.h"
188 #include "gtest/internal/gtest-param-util-generated.h"
181 #include "gtest/internal/gtest-port.h"
189182
190183 namespace testing {
191184
192185 // Functions producing parameter generators.
193186 //
194187 // Google Test uses these generators to produce parameters for value-
195 // parameterized tests. When a parameterized test case is instantiated
188 // parameterized tests. When a parameterized test suite is instantiated
196189 // with a particular generator, Google Test creates and runs tests
197190 // for each element in the sequence produced by the generator.
198191 //
199 // In the following sample, tests from test case FooTest are instantiated
192 // In the following sample, tests from test suite FooTest are instantiated
200193 // each three times with parameter values 3, 5, and 8:
201194 //
202195 // class FooTest : public TestWithParam<int> { ... };
205198 // }
206199 // TEST_P(FooTest, TestThat) {
207200 // }
208 // INSTANTIATE_TEST_CASE_P(TestSequence, FooTest, Values(3, 5, 8));
201 // INSTANTIATE_TEST_SUITE_P(TestSequence, FooTest, Values(3, 5, 8));
209202 //
210203
211204 // Range() returns generators providing sequences of values in a range.
262255 //
263256 // Examples:
264257 //
265 // This instantiates tests from test case StringTest
258 // This instantiates tests from test suite StringTest
266259 // each with C-string values of "foo", "bar", and "baz":
267260 //
268261 // const char* strings[] = {"foo", "bar", "baz"};
269 // INSTANTIATE_TEST_CASE_P(StringSequence, StringTest, ValuesIn(strings));
270 //
271 // This instantiates tests from test case StlStringTest
262 // INSTANTIATE_TEST_SUITE_P(StringSequence, StringTest, ValuesIn(strings));
263 //
264 // This instantiates tests from test suite StlStringTest
272265 // each with STL strings with values "a" and "b":
273266 //
274267 // ::std::vector< ::std::string> GetParameterStrings() {
278271 // return v;
279272 // }
280273 //
281 // INSTANTIATE_TEST_CASE_P(CharSequence,
282 // StlStringTest,
283 // ValuesIn(GetParameterStrings()));
274 // INSTANTIATE_TEST_SUITE_P(CharSequence,
275 // StlStringTest,
276 // ValuesIn(GetParameterStrings()));
284277 //
285278 //
286279 // This will also instantiate tests from CharTest
293286 // return list;
294287 // }
295288 // ::std::list<char> l = GetParameterChars();
296 // INSTANTIATE_TEST_CASE_P(CharSequence2,
297 // CharTest,
298 // ValuesIn(l.begin(), l.end()));
289 // INSTANTIATE_TEST_SUITE_P(CharSequence2,
290 // CharTest,
291 // ValuesIn(l.begin(), l.end()));
299292 //
300293 template <typename ForwardIterator>
301294 internal::ParamGenerator<
302 typename ::testing::internal::IteratorTraits<ForwardIterator>::value_type>
295 typename std::iterator_traits<ForwardIterator>::value_type>
303296 ValuesIn(ForwardIterator begin, ForwardIterator end) {
304 typedef typename ::testing::internal::IteratorTraits<ForwardIterator>
305 ::value_type ParamType;
297 typedef typename std::iterator_traits<ForwardIterator>::value_type ParamType;
306298 return internal::ParamGenerator<ParamType>(
307299 new internal::ValuesInIteratorRangeGenerator<ParamType>(begin, end));
308300 }
325317 // Values(T v1, T v2, ..., T vN)
326318 // - returns a generator producing sequences with elements v1, v2, ..., vN.
327319 //
328 // For example, this instantiates tests from test case BarTest each
320 // For example, this instantiates tests from test suite BarTest each
329321 // with values "one", "two", and "three":
330322 //
331 // INSTANTIATE_TEST_CASE_P(NumSequence, BarTest, Values("one", "two", "three"));
332 //
333 // This instantiates tests from test case BazTest each with values 1, 2, 3.5.
323 // INSTANTIATE_TEST_SUITE_P(NumSequence,
324 // BarTest,
325 // Values("one", "two", "three"));
326 //
327 // This instantiates tests from test suite BazTest each with values 1, 2, 3.5.
334328 // The exact type of values will depend on the type of parameter in BazTest.
335329 //
336 // INSTANTIATE_TEST_CASE_P(FloatingNumbers, BazTest, Values(1, 2, 3.5));
337 //
338 // Currently, Values() supports from 1 to 50 parameters.
339 //
340 template <typename T1>
341 internal::ValueArray1<T1> Values(T1 v1) {
342 return internal::ValueArray1<T1>(v1);
343 }
344
345 template <typename T1, typename T2>
346 internal::ValueArray2<T1, T2> Values(T1 v1, T2 v2) {
347 return internal::ValueArray2<T1, T2>(v1, v2);
348 }
349
350 template <typename T1, typename T2, typename T3>
351 internal::ValueArray3<T1, T2, T3> Values(T1 v1, T2 v2, T3 v3) {
352 return internal::ValueArray3<T1, T2, T3>(v1, v2, v3);
353 }
354
355 template <typename T1, typename T2, typename T3, typename T4>
356 internal::ValueArray4<T1, T2, T3, T4> Values(T1 v1, T2 v2, T3 v3, T4 v4) {
357 return internal::ValueArray4<T1, T2, T3, T4>(v1, v2, v3, v4);
358 }
359
360 template <typename T1, typename T2, typename T3, typename T4, typename T5>
361 internal::ValueArray5<T1, T2, T3, T4, T5> Values(T1 v1, T2 v2, T3 v3, T4 v4,
362 T5 v5) {
363 return internal::ValueArray5<T1, T2, T3, T4, T5>(v1, v2, v3, v4, v5);
364 }
365
366 template <typename T1, typename T2, typename T3, typename T4, typename T5,
367 typename T6>
368 internal::ValueArray6<T1, T2, T3, T4, T5, T6> Values(T1 v1, T2 v2, T3 v3,
369 T4 v4, T5 v5, T6 v6) {
370 return internal::ValueArray6<T1, T2, T3, T4, T5, T6>(v1, v2, v3, v4, v5, v6);
371 }
372
373 template <typename T1, typename T2, typename T3, typename T4, typename T5,
374 typename T6, typename T7>
375 internal::ValueArray7<T1, T2, T3, T4, T5, T6, T7> Values(T1 v1, T2 v2, T3 v3,
376 T4 v4, T5 v5, T6 v6, T7 v7) {
377 return internal::ValueArray7<T1, T2, T3, T4, T5, T6, T7>(v1, v2, v3, v4, v5,
378 v6, v7);
379 }
380
381 template <typename T1, typename T2, typename T3, typename T4, typename T5,
382 typename T6, typename T7, typename T8>
383 internal::ValueArray8<T1, T2, T3, T4, T5, T6, T7, T8> Values(T1 v1, T2 v2,
384 T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8) {
385 return internal::ValueArray8<T1, T2, T3, T4, T5, T6, T7, T8>(v1, v2, v3, v4,
386 v5, v6, v7, v8);
387 }
388
389 template <typename T1, typename T2, typename T3, typename T4, typename T5,
390 typename T6, typename T7, typename T8, typename T9>
391 internal::ValueArray9<T1, T2, T3, T4, T5, T6, T7, T8, T9> Values(T1 v1, T2 v2,
392 T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9) {
393 return internal::ValueArray9<T1, T2, T3, T4, T5, T6, T7, T8, T9>(v1, v2, v3,
394 v4, v5, v6, v7, v8, v9);
395 }
396
397 template <typename T1, typename T2, typename T3, typename T4, typename T5,
398 typename T6, typename T7, typename T8, typename T9, typename T10>
399 internal::ValueArray10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> Values(T1 v1,
400 T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10) {
401 return internal::ValueArray10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(v1,
402 v2, v3, v4, v5, v6, v7, v8, v9, v10);
403 }
404
405 template <typename T1, typename T2, typename T3, typename T4, typename T5,
406 typename T6, typename T7, typename T8, typename T9, typename T10,
407 typename T11>
408 internal::ValueArray11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10,
409 T11> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
410 T10 v10, T11 v11) {
411 return internal::ValueArray11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10,
412 T11>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11);
413 }
414
415 template <typename T1, typename T2, typename T3, typename T4, typename T5,
416 typename T6, typename T7, typename T8, typename T9, typename T10,
417 typename T11, typename T12>
418 internal::ValueArray12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
419 T12> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
420 T10 v10, T11 v11, T12 v12) {
421 return internal::ValueArray12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
422 T12>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12);
423 }
424
425 template <typename T1, typename T2, typename T3, typename T4, typename T5,
426 typename T6, typename T7, typename T8, typename T9, typename T10,
427 typename T11, typename T12, typename T13>
428 internal::ValueArray13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
429 T13> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
430 T10 v10, T11 v11, T12 v12, T13 v13) {
431 return internal::ValueArray13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
432 T12, T13>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13);
433 }
434
435 template <typename T1, typename T2, typename T3, typename T4, typename T5,
436 typename T6, typename T7, typename T8, typename T9, typename T10,
437 typename T11, typename T12, typename T13, typename T14>
438 internal::ValueArray14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
439 T14> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
440 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14) {
441 return internal::ValueArray14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
442 T12, T13, T14>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13,
443 v14);
444 }
445
446 template <typename T1, typename T2, typename T3, typename T4, typename T5,
447 typename T6, typename T7, typename T8, typename T9, typename T10,
448 typename T11, typename T12, typename T13, typename T14, typename T15>
449 internal::ValueArray15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
450 T14, T15> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8,
451 T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15) {
452 return internal::ValueArray15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
453 T12, T13, T14, T15>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12,
454 v13, v14, v15);
455 }
456
457 template <typename T1, typename T2, typename T3, typename T4, typename T5,
458 typename T6, typename T7, typename T8, typename T9, typename T10,
459 typename T11, typename T12, typename T13, typename T14, typename T15,
460 typename T16>
461 internal::ValueArray16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
462 T14, T15, T16> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
463 T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
464 T16 v16) {
465 return internal::ValueArray16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
466 T12, T13, T14, T15, T16>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11,
467 v12, v13, v14, v15, v16);
468 }
469
470 template <typename T1, typename T2, typename T3, typename T4, typename T5,
471 typename T6, typename T7, typename T8, typename T9, typename T10,
472 typename T11, typename T12, typename T13, typename T14, typename T15,
473 typename T16, typename T17>
474 internal::ValueArray17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
475 T14, T15, T16, T17> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
476 T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
477 T16 v16, T17 v17) {
478 return internal::ValueArray17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
479 T12, T13, T14, T15, T16, T17>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10,
480 v11, v12, v13, v14, v15, v16, v17);
481 }
482
483 template <typename T1, typename T2, typename T3, typename T4, typename T5,
484 typename T6, typename T7, typename T8, typename T9, typename T10,
485 typename T11, typename T12, typename T13, typename T14, typename T15,
486 typename T16, typename T17, typename T18>
487 internal::ValueArray18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
488 T14, T15, T16, T17, T18> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6,
489 T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
490 T16 v16, T17 v17, T18 v18) {
491 return internal::ValueArray18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
492 T12, T13, T14, T15, T16, T17, T18>(v1, v2, v3, v4, v5, v6, v7, v8, v9,
493 v10, v11, v12, v13, v14, v15, v16, v17, v18);
494 }
495
496 template <typename T1, typename T2, typename T3, typename T4, typename T5,
497 typename T6, typename T7, typename T8, typename T9, typename T10,
498 typename T11, typename T12, typename T13, typename T14, typename T15,
499 typename T16, typename T17, typename T18, typename T19>
500 internal::ValueArray19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
501 T14, T15, T16, T17, T18, T19> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5,
502 T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14,
503 T15 v15, T16 v16, T17 v17, T18 v18, T19 v19) {
504 return internal::ValueArray19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
505 T12, T13, T14, T15, T16, T17, T18, T19>(v1, v2, v3, v4, v5, v6, v7, v8,
506 v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19);
507 }
508
509 template <typename T1, typename T2, typename T3, typename T4, typename T5,
510 typename T6, typename T7, typename T8, typename T9, typename T10,
511 typename T11, typename T12, typename T13, typename T14, typename T15,
512 typename T16, typename T17, typename T18, typename T19, typename T20>
513 internal::ValueArray20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
514 T14, T15, T16, T17, T18, T19, T20> Values(T1 v1, T2 v2, T3 v3, T4 v4,
515 T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,
516 T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20) {
517 return internal::ValueArray20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
518 T12, T13, T14, T15, T16, T17, T18, T19, T20>(v1, v2, v3, v4, v5, v6, v7,
519 v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20);
520 }
521
522 template <typename T1, typename T2, typename T3, typename T4, typename T5,
523 typename T6, typename T7, typename T8, typename T9, typename T10,
524 typename T11, typename T12, typename T13, typename T14, typename T15,
525 typename T16, typename T17, typename T18, typename T19, typename T20,
526 typename T21>
527 internal::ValueArray21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
528 T14, T15, T16, T17, T18, T19, T20, T21> Values(T1 v1, T2 v2, T3 v3, T4 v4,
529 T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,
530 T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21) {
531 return internal::ValueArray21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
532 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21>(v1, v2, v3, v4, v5, v6,
533 v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21);
534 }
535
536 template <typename T1, typename T2, typename T3, typename T4, typename T5,
537 typename T6, typename T7, typename T8, typename T9, typename T10,
538 typename T11, typename T12, typename T13, typename T14, typename T15,
539 typename T16, typename T17, typename T18, typename T19, typename T20,
540 typename T21, typename T22>
541 internal::ValueArray22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
542 T14, T15, T16, T17, T18, T19, T20, T21, T22> Values(T1 v1, T2 v2, T3 v3,
543 T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
544 T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
545 T21 v21, T22 v22) {
546 return internal::ValueArray22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
547 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22>(v1, v2, v3, v4,
548 v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,
549 v20, v21, v22);
550 }
551
552 template <typename T1, typename T2, typename T3, typename T4, typename T5,
553 typename T6, typename T7, typename T8, typename T9, typename T10,
554 typename T11, typename T12, typename T13, typename T14, typename T15,
555 typename T16, typename T17, typename T18, typename T19, typename T20,
556 typename T21, typename T22, typename T23>
557 internal::ValueArray23<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
558 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23> Values(T1 v1, T2 v2,
559 T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
560 T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
561 T21 v21, T22 v22, T23 v23) {
562 return internal::ValueArray23<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
563 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23>(v1, v2, v3,
564 v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,
565 v20, v21, v22, v23);
566 }
567
568 template <typename T1, typename T2, typename T3, typename T4, typename T5,
569 typename T6, typename T7, typename T8, typename T9, typename T10,
570 typename T11, typename T12, typename T13, typename T14, typename T15,
571 typename T16, typename T17, typename T18, typename T19, typename T20,
572 typename T21, typename T22, typename T23, typename T24>
573 internal::ValueArray24<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
574 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24> Values(T1 v1, T2 v2,
575 T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
576 T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
577 T21 v21, T22 v22, T23 v23, T24 v24) {
578 return internal::ValueArray24<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
579 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24>(v1, v2,
580 v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18,
581 v19, v20, v21, v22, v23, v24);
582 }
583
584 template <typename T1, typename T2, typename T3, typename T4, typename T5,
585 typename T6, typename T7, typename T8, typename T9, typename T10,
586 typename T11, typename T12, typename T13, typename T14, typename T15,
587 typename T16, typename T17, typename T18, typename T19, typename T20,
588 typename T21, typename T22, typename T23, typename T24, typename T25>
589 internal::ValueArray25<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
590 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> Values(T1 v1,
591 T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11,
592 T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19,
593 T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25) {
594 return internal::ValueArray25<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
595 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25>(v1,
596 v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17,
597 v18, v19, v20, v21, v22, v23, v24, v25);
598 }
599
600 template <typename T1, typename T2, typename T3, typename T4, typename T5,
601 typename T6, typename T7, typename T8, typename T9, typename T10,
602 typename T11, typename T12, typename T13, typename T14, typename T15,
603 typename T16, typename T17, typename T18, typename T19, typename T20,
604 typename T21, typename T22, typename T23, typename T24, typename T25,
605 typename T26>
606 internal::ValueArray26<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
607 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
608 T26> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
609 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
610 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
611 T26 v26) {
612 return internal::ValueArray26<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
613 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
614 T26>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15,
615 v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26);
616 }
617
618 template <typename T1, typename T2, typename T3, typename T4, typename T5,
619 typename T6, typename T7, typename T8, typename T9, typename T10,
620 typename T11, typename T12, typename T13, typename T14, typename T15,
621 typename T16, typename T17, typename T18, typename T19, typename T20,
622 typename T21, typename T22, typename T23, typename T24, typename T25,
623 typename T26, typename T27>
624 internal::ValueArray27<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
625 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
626 T27> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
627 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
628 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
629 T26 v26, T27 v27) {
630 return internal::ValueArray27<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
631 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
632 T26, T27>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14,
633 v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27);
634 }
635
636 template <typename T1, typename T2, typename T3, typename T4, typename T5,
637 typename T6, typename T7, typename T8, typename T9, typename T10,
638 typename T11, typename T12, typename T13, typename T14, typename T15,
639 typename T16, typename T17, typename T18, typename T19, typename T20,
640 typename T21, typename T22, typename T23, typename T24, typename T25,
641 typename T26, typename T27, typename T28>
642 internal::ValueArray28<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
643 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
644 T28> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
645 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
646 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
647 T26 v26, T27 v27, T28 v28) {
648 return internal::ValueArray28<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
649 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
650 T26, T27, T28>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13,
651 v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27,
652 v28);
653 }
654
655 template <typename T1, typename T2, typename T3, typename T4, typename T5,
656 typename T6, typename T7, typename T8, typename T9, typename T10,
657 typename T11, typename T12, typename T13, typename T14, typename T15,
658 typename T16, typename T17, typename T18, typename T19, typename T20,
659 typename T21, typename T22, typename T23, typename T24, typename T25,
660 typename T26, typename T27, typename T28, typename T29>
661 internal::ValueArray29<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
662 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
663 T29> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
664 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
665 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
666 T26 v26, T27 v27, T28 v28, T29 v29) {
667 return internal::ValueArray29<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
668 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
669 T26, T27, T28, T29>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12,
670 v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26,
671 v27, v28, v29);
672 }
673
674 template <typename T1, typename T2, typename T3, typename T4, typename T5,
675 typename T6, typename T7, typename T8, typename T9, typename T10,
676 typename T11, typename T12, typename T13, typename T14, typename T15,
677 typename T16, typename T17, typename T18, typename T19, typename T20,
678 typename T21, typename T22, typename T23, typename T24, typename T25,
679 typename T26, typename T27, typename T28, typename T29, typename T30>
680 internal::ValueArray30<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
681 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
682 T29, T30> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8,
683 T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16,
684 T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24,
685 T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30) {
686 return internal::ValueArray30<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
687 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
688 T26, T27, T28, T29, T30>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11,
689 v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25,
690 v26, v27, v28, v29, v30);
691 }
692
693 template <typename T1, typename T2, typename T3, typename T4, typename T5,
694 typename T6, typename T7, typename T8, typename T9, typename T10,
695 typename T11, typename T12, typename T13, typename T14, typename T15,
696 typename T16, typename T17, typename T18, typename T19, typename T20,
697 typename T21, typename T22, typename T23, typename T24, typename T25,
698 typename T26, typename T27, typename T28, typename T29, typename T30,
699 typename T31>
700 internal::ValueArray31<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
701 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
702 T29, T30, T31> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
703 T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
704 T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
705 T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31) {
706 return internal::ValueArray31<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
707 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
708 T26, T27, T28, T29, T30, T31>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10,
709 v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24,
710 v25, v26, v27, v28, v29, v30, v31);
711 }
712
713 template <typename T1, typename T2, typename T3, typename T4, typename T5,
714 typename T6, typename T7, typename T8, typename T9, typename T10,
715 typename T11, typename T12, typename T13, typename T14, typename T15,
716 typename T16, typename T17, typename T18, typename T19, typename T20,
717 typename T21, typename T22, typename T23, typename T24, typename T25,
718 typename T26, typename T27, typename T28, typename T29, typename T30,
719 typename T31, typename T32>
720 internal::ValueArray32<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
721 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
722 T29, T30, T31, T32> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
723 T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
724 T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
725 T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,
726 T32 v32) {
727 return internal::ValueArray32<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
728 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
729 T26, T27, T28, T29, T30, T31, T32>(v1, v2, v3, v4, v5, v6, v7, v8, v9,
730 v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23,
731 v24, v25, v26, v27, v28, v29, v30, v31, v32);
732 }
733
734 template <typename T1, typename T2, typename T3, typename T4, typename T5,
735 typename T6, typename T7, typename T8, typename T9, typename T10,
736 typename T11, typename T12, typename T13, typename T14, typename T15,
737 typename T16, typename T17, typename T18, typename T19, typename T20,
738 typename T21, typename T22, typename T23, typename T24, typename T25,
739 typename T26, typename T27, typename T28, typename T29, typename T30,
740 typename T31, typename T32, typename T33>
741 internal::ValueArray33<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
742 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
743 T29, T30, T31, T32, T33> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6,
744 T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
745 T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
746 T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,
747 T32 v32, T33 v33) {
748 return internal::ValueArray33<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
749 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
750 T26, T27, T28, T29, T30, T31, T32, T33>(v1, v2, v3, v4, v5, v6, v7, v8,
751 v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23,
752 v24, v25, v26, v27, v28, v29, v30, v31, v32, v33);
753 }
754
755 template <typename T1, typename T2, typename T3, typename T4, typename T5,
756 typename T6, typename T7, typename T8, typename T9, typename T10,
757 typename T11, typename T12, typename T13, typename T14, typename T15,
758 typename T16, typename T17, typename T18, typename T19, typename T20,
759 typename T21, typename T22, typename T23, typename T24, typename T25,
760 typename T26, typename T27, typename T28, typename T29, typename T30,
761 typename T31, typename T32, typename T33, typename T34>
762 internal::ValueArray34<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
763 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
764 T29, T30, T31, T32, T33, T34> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5,
765 T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14,
766 T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22,
767 T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30,
768 T31 v31, T32 v32, T33 v33, T34 v34) {
769 return internal::ValueArray34<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
770 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
771 T26, T27, T28, T29, T30, T31, T32, T33, T34>(v1, v2, v3, v4, v5, v6, v7,
772 v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22,
773 v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34);
774 }
775
776 template <typename T1, typename T2, typename T3, typename T4, typename T5,
777 typename T6, typename T7, typename T8, typename T9, typename T10,
778 typename T11, typename T12, typename T13, typename T14, typename T15,
779 typename T16, typename T17, typename T18, typename T19, typename T20,
780 typename T21, typename T22, typename T23, typename T24, typename T25,
781 typename T26, typename T27, typename T28, typename T29, typename T30,
782 typename T31, typename T32, typename T33, typename T34, typename T35>
783 internal::ValueArray35<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
784 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
785 T29, T30, T31, T32, T33, T34, T35> Values(T1 v1, T2 v2, T3 v3, T4 v4,
786 T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,
787 T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21,
788 T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29,
789 T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35) {
790 return internal::ValueArray35<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
791 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
792 T26, T27, T28, T29, T30, T31, T32, T33, T34, T35>(v1, v2, v3, v4, v5, v6,
793 v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21,
794 v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35);
795 }
796
797 template <typename T1, typename T2, typename T3, typename T4, typename T5,
798 typename T6, typename T7, typename T8, typename T9, typename T10,
799 typename T11, typename T12, typename T13, typename T14, typename T15,
800 typename T16, typename T17, typename T18, typename T19, typename T20,
801 typename T21, typename T22, typename T23, typename T24, typename T25,
802 typename T26, typename T27, typename T28, typename T29, typename T30,
803 typename T31, typename T32, typename T33, typename T34, typename T35,
804 typename T36>
805 internal::ValueArray36<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
806 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
807 T29, T30, T31, T32, T33, T34, T35, T36> Values(T1 v1, T2 v2, T3 v3, T4 v4,
808 T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,
809 T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21,
810 T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29,
811 T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36) {
812 return internal::ValueArray36<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
813 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
814 T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36>(v1, v2, v3, v4,
815 v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,
816 v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33,
817 v34, v35, v36);
818 }
819
820 template <typename T1, typename T2, typename T3, typename T4, typename T5,
821 typename T6, typename T7, typename T8, typename T9, typename T10,
822 typename T11, typename T12, typename T13, typename T14, typename T15,
823 typename T16, typename T17, typename T18, typename T19, typename T20,
824 typename T21, typename T22, typename T23, typename T24, typename T25,
825 typename T26, typename T27, typename T28, typename T29, typename T30,
826 typename T31, typename T32, typename T33, typename T34, typename T35,
827 typename T36, typename T37>
828 internal::ValueArray37<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
829 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
830 T29, T30, T31, T32, T33, T34, T35, T36, T37> Values(T1 v1, T2 v2, T3 v3,
831 T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
832 T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
833 T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28,
834 T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36,
835 T37 v37) {
836 return internal::ValueArray37<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
837 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
838 T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37>(v1, v2, v3,
839 v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,
840 v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33,
841 v34, v35, v36, v37);
842 }
843
844 template <typename T1, typename T2, typename T3, typename T4, typename T5,
845 typename T6, typename T7, typename T8, typename T9, typename T10,
846 typename T11, typename T12, typename T13, typename T14, typename T15,
847 typename T16, typename T17, typename T18, typename T19, typename T20,
848 typename T21, typename T22, typename T23, typename T24, typename T25,
849 typename T26, typename T27, typename T28, typename T29, typename T30,
850 typename T31, typename T32, typename T33, typename T34, typename T35,
851 typename T36, typename T37, typename T38>
852 internal::ValueArray38<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
853 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
854 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38> Values(T1 v1, T2 v2,
855 T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
856 T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
857 T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28,
858 T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36,
859 T37 v37, T38 v38) {
860 return internal::ValueArray38<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
861 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
862 T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38>(v1, v2,
863 v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18,
864 v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32,
865 v33, v34, v35, v36, v37, v38);
866 }
867
868 template <typename T1, typename T2, typename T3, typename T4, typename T5,
869 typename T6, typename T7, typename T8, typename T9, typename T10,
870 typename T11, typename T12, typename T13, typename T14, typename T15,
871 typename T16, typename T17, typename T18, typename T19, typename T20,
872 typename T21, typename T22, typename T23, typename T24, typename T25,
873 typename T26, typename T27, typename T28, typename T29, typename T30,
874 typename T31, typename T32, typename T33, typename T34, typename T35,
875 typename T36, typename T37, typename T38, typename T39>
876 internal::ValueArray39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
877 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
878 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> Values(T1 v1, T2 v2,
879 T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
880 T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
881 T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28,
882 T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36,
883 T37 v37, T38 v38, T39 v39) {
884 return internal::ValueArray39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
885 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
886 T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39>(v1,
887 v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17,
888 v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31,
889 v32, v33, v34, v35, v36, v37, v38, v39);
890 }
891
892 template <typename T1, typename T2, typename T3, typename T4, typename T5,
893 typename T6, typename T7, typename T8, typename T9, typename T10,
894 typename T11, typename T12, typename T13, typename T14, typename T15,
895 typename T16, typename T17, typename T18, typename T19, typename T20,
896 typename T21, typename T22, typename T23, typename T24, typename T25,
897 typename T26, typename T27, typename T28, typename T29, typename T30,
898 typename T31, typename T32, typename T33, typename T34, typename T35,
899 typename T36, typename T37, typename T38, typename T39, typename T40>
900 internal::ValueArray40<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
901 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
902 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40> Values(T1 v1,
903 T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11,
904 T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19,
905 T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27,
906 T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35,
907 T36 v36, T37 v37, T38 v38, T39 v39, T40 v40) {
908 return internal::ValueArray40<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
909 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
910 T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
911 T40>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15,
912 v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29,
913 v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40);
914 }
915
916 template <typename T1, typename T2, typename T3, typename T4, typename T5,
917 typename T6, typename T7, typename T8, typename T9, typename T10,
918 typename T11, typename T12, typename T13, typename T14, typename T15,
919 typename T16, typename T17, typename T18, typename T19, typename T20,
920 typename T21, typename T22, typename T23, typename T24, typename T25,
921 typename T26, typename T27, typename T28, typename T29, typename T30,
922 typename T31, typename T32, typename T33, typename T34, typename T35,
923 typename T36, typename T37, typename T38, typename T39, typename T40,
924 typename T41>
925 internal::ValueArray41<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
926 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
927 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
928 T41> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
929 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
930 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
931 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
932 T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41) {
933 return internal::ValueArray41<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
934 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
935 T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
936 T40, T41>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14,
937 v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28,
938 v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41);
939 }
940
941 template <typename T1, typename T2, typename T3, typename T4, typename T5,
942 typename T6, typename T7, typename T8, typename T9, typename T10,
943 typename T11, typename T12, typename T13, typename T14, typename T15,
944 typename T16, typename T17, typename T18, typename T19, typename T20,
945 typename T21, typename T22, typename T23, typename T24, typename T25,
946 typename T26, typename T27, typename T28, typename T29, typename T30,
947 typename T31, typename T32, typename T33, typename T34, typename T35,
948 typename T36, typename T37, typename T38, typename T39, typename T40,
949 typename T41, typename T42>
950 internal::ValueArray42<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
951 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
952 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
953 T42> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
954 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
955 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
956 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
957 T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
958 T42 v42) {
959 return internal::ValueArray42<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
960 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
961 T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
962 T40, T41, T42>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13,
963 v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27,
964 v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41,
965 v42);
966 }
967
968 template <typename T1, typename T2, typename T3, typename T4, typename T5,
969 typename T6, typename T7, typename T8, typename T9, typename T10,
970 typename T11, typename T12, typename T13, typename T14, typename T15,
971 typename T16, typename T17, typename T18, typename T19, typename T20,
972 typename T21, typename T22, typename T23, typename T24, typename T25,
973 typename T26, typename T27, typename T28, typename T29, typename T30,
974 typename T31, typename T32, typename T33, typename T34, typename T35,
975 typename T36, typename T37, typename T38, typename T39, typename T40,
976 typename T41, typename T42, typename T43>
977 internal::ValueArray43<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
978 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
979 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
980 T43> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
981 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
982 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
983 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
984 T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
985 T42 v42, T43 v43) {
986 return internal::ValueArray43<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
987 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
988 T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
989 T40, T41, T42, T43>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12,
990 v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26,
991 v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40,
992 v41, v42, v43);
993 }
994
995 template <typename T1, typename T2, typename T3, typename T4, typename T5,
996 typename T6, typename T7, typename T8, typename T9, typename T10,
997 typename T11, typename T12, typename T13, typename T14, typename T15,
998 typename T16, typename T17, typename T18, typename T19, typename T20,
999 typename T21, typename T22, typename T23, typename T24, typename T25,
1000 typename T26, typename T27, typename T28, typename T29, typename T30,
1001 typename T31, typename T32, typename T33, typename T34, typename T35,
1002 typename T36, typename T37, typename T38, typename T39, typename T40,
1003 typename T41, typename T42, typename T43, typename T44>
1004 internal::ValueArray44<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
1005 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
1006 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
1007 T44> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
1008 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
1009 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
1010 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
1011 T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
1012 T42 v42, T43 v43, T44 v44) {
1013 return internal::ValueArray44<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
1014 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
1015 T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
1016 T40, T41, T42, T43, T44>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11,
1017 v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25,
1018 v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39,
1019 v40, v41, v42, v43, v44);
1020 }
1021
1022 template <typename T1, typename T2, typename T3, typename T4, typename T5,
1023 typename T6, typename T7, typename T8, typename T9, typename T10,
1024 typename T11, typename T12, typename T13, typename T14, typename T15,
1025 typename T16, typename T17, typename T18, typename T19, typename T20,
1026 typename T21, typename T22, typename T23, typename T24, typename T25,
1027 typename T26, typename T27, typename T28, typename T29, typename T30,
1028 typename T31, typename T32, typename T33, typename T34, typename T35,
1029 typename T36, typename T37, typename T38, typename T39, typename T40,
1030 typename T41, typename T42, typename T43, typename T44, typename T45>
1031 internal::ValueArray45<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
1032 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
1033 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
1034 T44, T45> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8,
1035 T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16,
1036 T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24,
1037 T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32,
1038 T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40,
1039 T41 v41, T42 v42, T43 v43, T44 v44, T45 v45) {
1040 return internal::ValueArray45<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
1041 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
1042 T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
1043 T40, T41, T42, T43, T44, T45>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10,
1044 v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24,
1045 v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38,
1046 v39, v40, v41, v42, v43, v44, v45);
1047 }
1048
1049 template <typename T1, typename T2, typename T3, typename T4, typename T5,
1050 typename T6, typename T7, typename T8, typename T9, typename T10,
1051 typename T11, typename T12, typename T13, typename T14, typename T15,
1052 typename T16, typename T17, typename T18, typename T19, typename T20,
1053 typename T21, typename T22, typename T23, typename T24, typename T25,
1054 typename T26, typename T27, typename T28, typename T29, typename T30,
1055 typename T31, typename T32, typename T33, typename T34, typename T35,
1056 typename T36, typename T37, typename T38, typename T39, typename T40,
1057 typename T41, typename T42, typename T43, typename T44, typename T45,
1058 typename T46>
1059 internal::ValueArray46<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
1060 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
1061 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
1062 T44, T45, T46> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
1063 T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
1064 T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
1065 T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,
1066 T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39,
1067 T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46) {
1068 return internal::ValueArray46<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
1069 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
1070 T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
1071 T40, T41, T42, T43, T44, T45, T46>(v1, v2, v3, v4, v5, v6, v7, v8, v9,
1072 v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23,
1073 v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37,
1074 v38, v39, v40, v41, v42, v43, v44, v45, v46);
1075 }
1076
1077 template <typename T1, typename T2, typename T3, typename T4, typename T5,
1078 typename T6, typename T7, typename T8, typename T9, typename T10,
1079 typename T11, typename T12, typename T13, typename T14, typename T15,
1080 typename T16, typename T17, typename T18, typename T19, typename T20,
1081 typename T21, typename T22, typename T23, typename T24, typename T25,
1082 typename T26, typename T27, typename T28, typename T29, typename T30,
1083 typename T31, typename T32, typename T33, typename T34, typename T35,
1084 typename T36, typename T37, typename T38, typename T39, typename T40,
1085 typename T41, typename T42, typename T43, typename T44, typename T45,
1086 typename T46, typename T47>
1087 internal::ValueArray47<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
1088 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
1089 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
1090 T44, T45, T46, T47> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
1091 T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
1092 T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
1093 T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,
1094 T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39,
1095 T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47) {
1096 return internal::ValueArray47<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
1097 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
1098 T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
1099 T40, T41, T42, T43, T44, T45, T46, T47>(v1, v2, v3, v4, v5, v6, v7, v8,
1100 v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23,
1101 v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37,
1102 v38, v39, v40, v41, v42, v43, v44, v45, v46, v47);
1103 }
1104
1105 template <typename T1, typename T2, typename T3, typename T4, typename T5,
1106 typename T6, typename T7, typename T8, typename T9, typename T10,
1107 typename T11, typename T12, typename T13, typename T14, typename T15,
1108 typename T16, typename T17, typename T18, typename T19, typename T20,
1109 typename T21, typename T22, typename T23, typename T24, typename T25,
1110 typename T26, typename T27, typename T28, typename T29, typename T30,
1111 typename T31, typename T32, typename T33, typename T34, typename T35,
1112 typename T36, typename T37, typename T38, typename T39, typename T40,
1113 typename T41, typename T42, typename T43, typename T44, typename T45,
1114 typename T46, typename T47, typename T48>
1115 internal::ValueArray48<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
1116 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
1117 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
1118 T44, T45, T46, T47, T48> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6,
1119 T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
1120 T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
1121 T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,
1122 T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39,
1123 T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47,
1124 T48 v48) {
1125 return internal::ValueArray48<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
1126 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
1127 T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
1128 T40, T41, T42, T43, T44, T45, T46, T47, T48>(v1, v2, v3, v4, v5, v6, v7,
1129 v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22,
1130 v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36,
1131 v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48);
1132 }
1133
1134 template <typename T1, typename T2, typename T3, typename T4, typename T5,
1135 typename T6, typename T7, typename T8, typename T9, typename T10,
1136 typename T11, typename T12, typename T13, typename T14, typename T15,
1137 typename T16, typename T17, typename T18, typename T19, typename T20,
1138 typename T21, typename T22, typename T23, typename T24, typename T25,
1139 typename T26, typename T27, typename T28, typename T29, typename T30,
1140 typename T31, typename T32, typename T33, typename T34, typename T35,
1141 typename T36, typename T37, typename T38, typename T39, typename T40,
1142 typename T41, typename T42, typename T43, typename T44, typename T45,
1143 typename T46, typename T47, typename T48, typename T49>
1144 internal::ValueArray49<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
1145 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
1146 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
1147 T44, T45, T46, T47, T48, T49> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5,
1148 T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14,
1149 T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22,
1150 T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30,
1151 T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38,
1152 T39 v39, T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46,
1153 T47 v47, T48 v48, T49 v49) {
1154 return internal::ValueArray49<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
1155 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
1156 T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
1157 T40, T41, T42, T43, T44, T45, T46, T47, T48, T49>(v1, v2, v3, v4, v5, v6,
1158 v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21,
1159 v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35,
1160 v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49);
1161 }
1162
1163 template <typename T1, typename T2, typename T3, typename T4, typename T5,
1164 typename T6, typename T7, typename T8, typename T9, typename T10,
1165 typename T11, typename T12, typename T13, typename T14, typename T15,
1166 typename T16, typename T17, typename T18, typename T19, typename T20,
1167 typename T21, typename T22, typename T23, typename T24, typename T25,
1168 typename T26, typename T27, typename T28, typename T29, typename T30,
1169 typename T31, typename T32, typename T33, typename T34, typename T35,
1170 typename T36, typename T37, typename T38, typename T39, typename T40,
1171 typename T41, typename T42, typename T43, typename T44, typename T45,
1172 typename T46, typename T47, typename T48, typename T49, typename T50>
1173 internal::ValueArray50<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
1174 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
1175 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
1176 T44, T45, T46, T47, T48, T49, T50> Values(T1 v1, T2 v2, T3 v3, T4 v4,
1177 T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,
1178 T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21,
1179 T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29,
1180 T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37,
1181 T38 v38, T39 v39, T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45,
1182 T46 v46, T47 v47, T48 v48, T49 v49, T50 v50) {
1183 return internal::ValueArray50<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
1184 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
1185 T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
1186 T40, T41, T42, T43, T44, T45, T46, T47, T48, T49, T50>(v1, v2, v3, v4,
1187 v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,
1188 v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33,
1189 v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47,
1190 v48, v49, v50);
330 // INSTANTIATE_TEST_SUITE_P(FloatingNumbers, BazTest, Values(1, 2, 3.5));
331 //
332 //
333 template <typename... T>
334 internal::ValueArray<T...> Values(T... v) {
335 return internal::ValueArray<T...>(std::move(v)...);
1191336 }
1192337
1193338 // Bool() allows generating tests with parameters in a set of (false, true).
1200345 // of multiple flags can be tested when several Bool()'s are combined using
1201346 // Combine() function.
1202347 //
1203 // In the following example all tests in the test case FlagDependentTest
348 // In the following example all tests in the test suite FlagDependentTest
1204349 // will be instantiated twice with parameters false and true.
1205350 //
1206351 // class FlagDependentTest : public testing::TestWithParam<bool> {
1208353 // external_flag = GetParam();
1209354 // }
1210355 // }
1211 // INSTANTIATE_TEST_CASE_P(BoolSequence, FlagDependentTest, Bool());
356 // INSTANTIATE_TEST_SUITE_P(BoolSequence, FlagDependentTest, Bool());
1212357 //
1213358 inline internal::ParamGenerator<bool> Bool() {
1214359 return Values(false, true);
1215360 }
1216361
1217 # if GTEST_HAS_COMBINE
1218362 // Combine() allows the user to combine two or more sequences to produce
1219363 // values of a Cartesian product of those sequences' elements.
1220364 //
1223367 // - returns a generator producing sequences with elements coming from
1224368 // the Cartesian product of elements from the sequences generated by
1225369 // gen1, gen2, ..., genN. The sequence elements will have a type of
1226 // tuple<T1, T2, ..., TN> where T1, T2, ..., TN are the types
370 // std::tuple<T1, T2, ..., TN> where T1, T2, ..., TN are the types
1227371 // of elements from sequences produces by gen1, gen2, ..., genN.
1228372 //
1229 // Combine can have up to 10 arguments. This number is currently limited
1230 // by the maximum number of elements in the tuple implementation used by Google
1231 // Test.
373 // Combine can have up to 10 arguments.
1232374 //
1233375 // Example:
1234376 //
1235 // This will instantiate tests in test case AnimalTest each one with
377 // This will instantiate tests in test suite AnimalTest each one with
1236378 // the parameter values tuple("cat", BLACK), tuple("cat", WHITE),
1237379 // tuple("dog", BLACK), and tuple("dog", WHITE):
1238380 //
1239381 // enum Color { BLACK, GRAY, WHITE };
1240382 // class AnimalTest
1241 // : public testing::TestWithParam<tuple<const char*, Color> > {...};
383 // : public testing::TestWithParam<std::tuple<const char*, Color> > {...};
1242384 //
1243385 // TEST_P(AnimalTest, AnimalLooksNice) {...}
1244386 //
1245 // INSTANTIATE_TEST_CASE_P(AnimalVariations, AnimalTest,
1246 // Combine(Values("cat", "dog"),
1247 // Values(BLACK, WHITE)));
387 // INSTANTIATE_TEST_SUITE_P(AnimalVariations, AnimalTest,
388 // Combine(Values("cat", "dog"),
389 // Values(BLACK, WHITE)));
1248390 //
1249391 // This will instantiate tests in FlagDependentTest with all variations of two
1250392 // Boolean flags:
1251393 //
1252394 // class FlagDependentTest
1253 // : public testing::TestWithParam<tuple<bool, bool> > {
395 // : public testing::TestWithParam<std::tuple<bool, bool> > {
1254396 // virtual void SetUp() {
1255397 // // Assigns external_flag_1 and external_flag_2 values from the tuple.
1256 // tie(external_flag_1, external_flag_2) = GetParam();
398 // std::tie(external_flag_1, external_flag_2) = GetParam();
1257399 // }
1258400 // };
1259401 //
1260402 // TEST_P(FlagDependentTest, TestFeature1) {
1261403 // // Test your code using external_flag_1 and external_flag_2 here.
1262404 // }
1263 // INSTANTIATE_TEST_CASE_P(TwoBoolSequence, FlagDependentTest,
1264 // Combine(Bool(), Bool()));
1265 //
1266 template <typename Generator1, typename Generator2>
1267 internal::CartesianProductHolder2<Generator1, Generator2> Combine(
1268 const Generator1& g1, const Generator2& g2) {
1269 return internal::CartesianProductHolder2<Generator1, Generator2>(
1270 g1, g2);
1271 }
1272
1273 template <typename Generator1, typename Generator2, typename Generator3>
1274 internal::CartesianProductHolder3<Generator1, Generator2, Generator3> Combine(
1275 const Generator1& g1, const Generator2& g2, const Generator3& g3) {
1276 return internal::CartesianProductHolder3<Generator1, Generator2, Generator3>(
1277 g1, g2, g3);
1278 }
1279
1280 template <typename Generator1, typename Generator2, typename Generator3,
1281 typename Generator4>
1282 internal::CartesianProductHolder4<Generator1, Generator2, Generator3,
1283 Generator4> Combine(
1284 const Generator1& g1, const Generator2& g2, const Generator3& g3,
1285 const Generator4& g4) {
1286 return internal::CartesianProductHolder4<Generator1, Generator2, Generator3,
1287 Generator4>(
1288 g1, g2, g3, g4);
1289 }
1290
1291 template <typename Generator1, typename Generator2, typename Generator3,
1292 typename Generator4, typename Generator5>
1293 internal::CartesianProductHolder5<Generator1, Generator2, Generator3,
1294 Generator4, Generator5> Combine(
1295 const Generator1& g1, const Generator2& g2, const Generator3& g3,
1296 const Generator4& g4, const Generator5& g5) {
1297 return internal::CartesianProductHolder5<Generator1, Generator2, Generator3,
1298 Generator4, Generator5>(
1299 g1, g2, g3, g4, g5);
1300 }
1301
1302 template <typename Generator1, typename Generator2, typename Generator3,
1303 typename Generator4, typename Generator5, typename Generator6>
1304 internal::CartesianProductHolder6<Generator1, Generator2, Generator3,
1305 Generator4, Generator5, Generator6> Combine(
1306 const Generator1& g1, const Generator2& g2, const Generator3& g3,
1307 const Generator4& g4, const Generator5& g5, const Generator6& g6) {
1308 return internal::CartesianProductHolder6<Generator1, Generator2, Generator3,
1309 Generator4, Generator5, Generator6>(
1310 g1, g2, g3, g4, g5, g6);
1311 }
1312
1313 template <typename Generator1, typename Generator2, typename Generator3,
1314 typename Generator4, typename Generator5, typename Generator6,
1315 typename Generator7>
1316 internal::CartesianProductHolder7<Generator1, Generator2, Generator3,
1317 Generator4, Generator5, Generator6, Generator7> Combine(
1318 const Generator1& g1, const Generator2& g2, const Generator3& g3,
1319 const Generator4& g4, const Generator5& g5, const Generator6& g6,
1320 const Generator7& g7) {
1321 return internal::CartesianProductHolder7<Generator1, Generator2, Generator3,
1322 Generator4, Generator5, Generator6, Generator7>(
1323 g1, g2, g3, g4, g5, g6, g7);
1324 }
1325
1326 template <typename Generator1, typename Generator2, typename Generator3,
1327 typename Generator4, typename Generator5, typename Generator6,
1328 typename Generator7, typename Generator8>
1329 internal::CartesianProductHolder8<Generator1, Generator2, Generator3,
1330 Generator4, Generator5, Generator6, Generator7, Generator8> Combine(
1331 const Generator1& g1, const Generator2& g2, const Generator3& g3,
1332 const Generator4& g4, const Generator5& g5, const Generator6& g6,
1333 const Generator7& g7, const Generator8& g8) {
1334 return internal::CartesianProductHolder8<Generator1, Generator2, Generator3,
1335 Generator4, Generator5, Generator6, Generator7, Generator8>(
1336 g1, g2, g3, g4, g5, g6, g7, g8);
1337 }
1338
1339 template <typename Generator1, typename Generator2, typename Generator3,
1340 typename Generator4, typename Generator5, typename Generator6,
1341 typename Generator7, typename Generator8, typename Generator9>
1342 internal::CartesianProductHolder9<Generator1, Generator2, Generator3,
1343 Generator4, Generator5, Generator6, Generator7, Generator8,
1344 Generator9> Combine(
1345 const Generator1& g1, const Generator2& g2, const Generator3& g3,
1346 const Generator4& g4, const Generator5& g5, const Generator6& g6,
1347 const Generator7& g7, const Generator8& g8, const Generator9& g9) {
1348 return internal::CartesianProductHolder9<Generator1, Generator2, Generator3,
1349 Generator4, Generator5, Generator6, Generator7, Generator8, Generator9>(
1350 g1, g2, g3, g4, g5, g6, g7, g8, g9);
1351 }
1352
1353 template <typename Generator1, typename Generator2, typename Generator3,
1354 typename Generator4, typename Generator5, typename Generator6,
1355 typename Generator7, typename Generator8, typename Generator9,
1356 typename Generator10>
1357 internal::CartesianProductHolder10<Generator1, Generator2, Generator3,
1358 Generator4, Generator5, Generator6, Generator7, Generator8, Generator9,
1359 Generator10> Combine(
1360 const Generator1& g1, const Generator2& g2, const Generator3& g3,
1361 const Generator4& g4, const Generator5& g5, const Generator6& g6,
1362 const Generator7& g7, const Generator8& g8, const Generator9& g9,
1363 const Generator10& g10) {
1364 return internal::CartesianProductHolder10<Generator1, Generator2, Generator3,
1365 Generator4, Generator5, Generator6, Generator7, Generator8, Generator9,
1366 Generator10>(
1367 g1, g2, g3, g4, g5, g6, g7, g8, g9, g10);
1368 }
1369 # endif // GTEST_HAS_COMBINE
1370
1371 # define TEST_P(test_case_name, test_name) \
1372 class GTEST_TEST_CLASS_NAME_(test_case_name, test_name) \
1373 : public test_case_name { \
1374 public: \
1375 GTEST_TEST_CLASS_NAME_(test_case_name, test_name)() {} \
1376 virtual void TestBody(); \
1377 private: \
1378 static int AddToRegistry() { \
1379 ::testing::UnitTest::GetInstance()->parameterized_test_registry(). \
1380 GetTestCasePatternHolder<test_case_name>(\
1381 #test_case_name, \
1382 ::testing::internal::CodeLocation(\
1383 __FILE__, __LINE__))->AddTestPattern(\
1384 GTEST_STRINGIFY_(test_case_name), \
1385 GTEST_STRINGIFY_(test_name), \
1386 new ::testing::internal::TestMetaFactory< \
1387 GTEST_TEST_CLASS_NAME_(\
1388 test_case_name, test_name)>()); \
1389 return 0; \
1390 } \
1391 static int gtest_registering_dummy_ GTEST_ATTRIBUTE_UNUSED_; \
1392 GTEST_DISALLOW_COPY_AND_ASSIGN_(\
1393 GTEST_TEST_CLASS_NAME_(test_case_name, test_name)); \
1394 }; \
1395 int GTEST_TEST_CLASS_NAME_(test_case_name, \
1396 test_name)::gtest_registering_dummy_ = \
1397 GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::AddToRegistry(); \
1398 void GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::TestBody()
1399
1400 // The optional last argument to INSTANTIATE_TEST_CASE_P allows the user
1401 // to specify a function or functor that generates custom test name suffixes
1402 // based on the test parameters. The function should accept one argument of
1403 // type testing::TestParamInfo<class ParamType>, and return std::string.
405 // INSTANTIATE_TEST_SUITE_P(TwoBoolSequence, FlagDependentTest,
406 // Combine(Bool(), Bool()));
407 //
408 template <typename... Generator>
409 internal::CartesianProductHolder<Generator...> Combine(const Generator&... g) {
410 return internal::CartesianProductHolder<Generator...>(g...);
411 }
412
413 #define TEST_P(test_suite_name, test_name) \
414 class GTEST_TEST_CLASS_NAME_(test_suite_name, test_name) \
415 : public test_suite_name { \
416 public: \
417 GTEST_TEST_CLASS_NAME_(test_suite_name, test_name)() {} \
418 virtual void TestBody(); \
419 \
420 private: \
421 static int AddToRegistry() { \
422 ::testing::UnitTest::GetInstance() \
423 ->parameterized_test_registry() \
424 .GetTestSuitePatternHolder<test_suite_name>( \
425 #test_suite_name, \
426 ::testing::internal::CodeLocation(__FILE__, __LINE__)) \
427 ->AddTestPattern( \
428 GTEST_STRINGIFY_(test_suite_name), GTEST_STRINGIFY_(test_name), \
429 new ::testing::internal::TestMetaFactory<GTEST_TEST_CLASS_NAME_( \
430 test_suite_name, test_name)>()); \
431 return 0; \
432 } \
433 static int gtest_registering_dummy_ GTEST_ATTRIBUTE_UNUSED_; \
434 GTEST_DISALLOW_COPY_AND_ASSIGN_(GTEST_TEST_CLASS_NAME_(test_suite_name, \
435 test_name)); \
436 }; \
437 int GTEST_TEST_CLASS_NAME_(test_suite_name, \
438 test_name)::gtest_registering_dummy_ = \
439 GTEST_TEST_CLASS_NAME_(test_suite_name, test_name)::AddToRegistry(); \
440 void GTEST_TEST_CLASS_NAME_(test_suite_name, test_name)::TestBody()
441
442 // The last argument to INSTANTIATE_TEST_SUITE_P allows the user to specify
443 // generator and an optional function or functor that generates custom test name
444 // suffixes based on the test parameters. Such a function or functor should
445 // accept one argument of type testing::TestParamInfo<class ParamType>, and
446 // return std::string.
1404447 //
1405448 // testing::PrintToStringParamName is a builtin test suffix generator that
1406449 // returns the value of testing::PrintToString(GetParam()).
1409452 // alphanumeric characters or underscore. Because PrintToString adds quotes
1410453 // to std::string and C strings, it won't work for these types.
1411454
1412 # define INSTANTIATE_TEST_CASE_P(prefix, test_case_name, generator, ...) \
1413 static ::testing::internal::ParamGenerator<test_case_name::ParamType> \
1414 gtest_##prefix##test_case_name##_EvalGenerator_() { return generator; } \
1415 static ::std::string gtest_##prefix##test_case_name##_EvalGenerateName_( \
1416 const ::testing::TestParamInfo<test_case_name::ParamType>& info) { \
1417 return ::testing::internal::GetParamNameGen<test_case_name::ParamType> \
1418 (__VA_ARGS__)(info); \
1419 } \
1420 static int gtest_##prefix##test_case_name##_dummy_ GTEST_ATTRIBUTE_UNUSED_ = \
1421 ::testing::UnitTest::GetInstance()->parameterized_test_registry(). \
1422 GetTestCasePatternHolder<test_case_name>(\
1423 #test_case_name, \
1424 ::testing::internal::CodeLocation(\
1425 __FILE__, __LINE__))->AddTestCaseInstantiation(\
1426 #prefix, \
1427 &gtest_##prefix##test_case_name##_EvalGenerator_, \
1428 &gtest_##prefix##test_case_name##_EvalGenerateName_, \
1429 __FILE__, __LINE__)
455 #define GTEST_EXPAND_(arg) arg
456 #define GTEST_GET_FIRST_(first, ...) first
457 #define GTEST_GET_SECOND_(first, second, ...) second
458
459 #define INSTANTIATE_TEST_SUITE_P(prefix, test_suite_name, ...) \
460 static ::testing::internal::ParamGenerator<test_suite_name::ParamType> \
461 gtest_##prefix##test_suite_name##_EvalGenerator_() { \
462 return GTEST_EXPAND_(GTEST_GET_FIRST_(__VA_ARGS__, DUMMY_PARAM_)); \
463 } \
464 static ::std::string gtest_##prefix##test_suite_name##_EvalGenerateName_( \
465 const ::testing::TestParamInfo<test_suite_name::ParamType>& info) { \
466 if (::testing::internal::AlwaysFalse()) { \
467 ::testing::internal::TestNotEmpty(GTEST_EXPAND_(GTEST_GET_SECOND_( \
468 __VA_ARGS__, \
469 ::testing::internal::DefaultParamName<test_suite_name::ParamType>, \
470 DUMMY_PARAM_))); \
471 auto t = std::make_tuple(__VA_ARGS__); \
472 static_assert(std::tuple_size<decltype(t)>::value <= 2, \
473 "Too Many Args!"); \
474 } \
475 return ((GTEST_EXPAND_(GTEST_GET_SECOND_( \
476 __VA_ARGS__, \
477 ::testing::internal::DefaultParamName<test_suite_name::ParamType>, \
478 DUMMY_PARAM_))))(info); \
479 } \
480 static int gtest_##prefix##test_suite_name##_dummy_ \
481 GTEST_ATTRIBUTE_UNUSED_ = \
482 ::testing::UnitTest::GetInstance() \
483 ->parameterized_test_registry() \
484 .GetTestSuitePatternHolder<test_suite_name>( \
485 #test_suite_name, \
486 ::testing::internal::CodeLocation(__FILE__, __LINE__)) \
487 ->AddTestSuiteInstantiation( \
488 #prefix, &gtest_##prefix##test_suite_name##_EvalGenerator_, \
489 &gtest_##prefix##test_suite_name##_EvalGenerateName_, \
490 __FILE__, __LINE__)
491
492 // Legacy API is deprecated but still available
493 #ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_
494 #define INSTANTIATE_TEST_CASE_P \
495 static_assert(::testing::internal::InstantiateTestCase_P_IsDeprecated(), \
496 ""); \
497 INSTANTIATE_TEST_SUITE_P
498 #endif // GTEST_REMOVE_LEGACY_TEST_CASEAPI_
1430499
1431500 } // namespace testing
1432501
9999 #ifndef GTEST_INCLUDE_GTEST_GTEST_PRINTERS_H_
100100 #define GTEST_INCLUDE_GTEST_GTEST_PRINTERS_H_
101101
102 #include <functional>
102103 #include <ostream> // NOLINT
103104 #include <sstream>
104105 #include <string>
106 #include <tuple>
107 #include <type_traits>
105108 #include <utility>
106109 #include <vector>
110 #include "gtest/internal/gtest-internal.h"
107111 #include "gtest/internal/gtest-port.h"
108 #include "gtest/internal/gtest-internal.h"
109
110 #if GTEST_HAS_STD_TUPLE_
111 # include <tuple>
112 #endif
113112
114113 #if GTEST_HAS_ABSL
115114 #include "absl/strings/string_view.h"
151150 public:
152151 // This default version is called when kTypeKind is kOtherType.
153152 static void PrintValue(const T& value, ::std::ostream* os) {
154 PrintBytesInObjectTo(static_cast<const unsigned char*>(
155 reinterpret_cast<const void*>(&value)),
156 sizeof(value), os);
153 PrintBytesInObjectTo(
154 static_cast<const unsigned char*>(
155 reinterpret_cast<const void*>(std::addressof(value))),
156 sizeof(value), os);
157157 }
158158 };
159159
232232 ::std::basic_ostream<Char, CharTraits>& os, const T& x) {
233233 TypeWithoutFormatter<T, (internal::IsAProtocolMessage<T>::value
234234 ? kProtobuf
235 : internal::ImplicitlyConvertible<
235 : std::is_convertible<
236236 const T&, internal::BiggestInt>::value
237237 ? kConvertibleToInteger
238238 :
239239 #if GTEST_HAS_ABSL
240 internal::ImplicitlyConvertible<
240 std::is_convertible<
241241 const T&, absl::string_view>::value
242242 ? kConvertibleToStringView
243243 :
356356
357357 GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(char, ::std::string);
358358 GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(const char, ::std::string);
359
360 #if GTEST_HAS_GLOBAL_STRING
361 GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(char, ::string);
362 GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(const char, ::string);
363 #endif
364
365 #if GTEST_HAS_GLOBAL_WSTRING
366 GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(wchar_t, ::wstring);
367 GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(const wchar_t, ::wstring);
368 #endif
369359
370360 #if GTEST_HAS_STD_WSTRING
371361 GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(wchar_t, ::std::wstring);
447437 template <typename T>
448438 void DefaultPrintTo(WrapPrinterType<kPrintPointer> /* dummy */,
449439 T* p, ::std::ostream* os) {
450 if (p == NULL) {
440 if (p == nullptr) {
451441 *os << "NULL";
452442 } else {
453443 // T is not a function type. We just call << to print p,
459449 template <typename T>
460450 void DefaultPrintTo(WrapPrinterType<kPrintFunctionPointer> /* dummy */,
461451 T* p, ::std::ostream* os) {
462 if (p == NULL) {
452 if (p == nullptr) {
463453 *os << "NULL";
464454 } else {
465455 // T is a function type, so '*os << p' doesn't do what we want
514504 (sizeof(IsContainerTest<T>(0)) == sizeof(IsContainer)) &&
515505 !IsRecursiveContainer<T>::value
516506 ? kPrintContainer
517 : !is_pointer<T>::value
507 : !std::is_pointer<T>::value
518508 ? kPrintOther
519 #if GTEST_LANG_CXX11
520509 : std::is_function<typename std::remove_pointer<T>::type>::value
521 #else
522 : !internal::ImplicitlyConvertible<T, const void*>::value
523 #endif
524510 ? kPrintFunctionPointer
525511 : kPrintPointer > (),
526512 value, os);
602588 }
603589 }
604590
605 // Overloads for ::string and ::std::string.
606 #if GTEST_HAS_GLOBAL_STRING
607 GTEST_API_ void PrintStringTo(const ::string&s, ::std::ostream* os);
608 inline void PrintTo(const ::string& s, ::std::ostream* os) {
609 PrintStringTo(s, os);
610 }
611 #endif // GTEST_HAS_GLOBAL_STRING
612
591 // Overloads for ::std::string.
613592 GTEST_API_ void PrintStringTo(const ::std::string&s, ::std::ostream* os);
614593 inline void PrintTo(const ::std::string& s, ::std::ostream* os) {
615594 PrintStringTo(s, os);
616595 }
617596
618 // Overloads for ::wstring and ::std::wstring.
619 #if GTEST_HAS_GLOBAL_WSTRING
620 GTEST_API_ void PrintWideStringTo(const ::wstring&s, ::std::ostream* os);
621 inline void PrintTo(const ::wstring& s, ::std::ostream* os) {
622 PrintWideStringTo(s, os);
623 }
624 #endif // GTEST_HAS_GLOBAL_WSTRING
625
597 // Overloads for ::std::wstring.
626598 #if GTEST_HAS_STD_WSTRING
627599 GTEST_API_ void PrintWideStringTo(const ::std::wstring&s, ::std::ostream* os);
628600 inline void PrintTo(const ::std::wstring& s, ::std::ostream* os) {
637609 }
638610 #endif // GTEST_HAS_ABSL
639611
640 #if GTEST_LANG_CXX11
641612 inline void PrintTo(std::nullptr_t, ::std::ostream* os) { *os << "(nullptr)"; }
642 #endif // GTEST_LANG_CXX11
643
644 #if GTEST_HAS_TR1_TUPLE || GTEST_HAS_STD_TUPLE_
613
614 template <typename T>
615 void PrintTo(std::reference_wrapper<T> ref, ::std::ostream* os) {
616 UniversalPrinter<T&>::Print(ref.get(), os);
617 }
618
645619 // Helper function for printing a tuple. T must be instantiated with
646620 // a tuple type.
647621 template <typename T>
648 void PrintTupleTo(const T& t, ::std::ostream* os);
649 #endif // GTEST_HAS_TR1_TUPLE || GTEST_HAS_STD_TUPLE_
650
651 #if GTEST_HAS_TR1_TUPLE
652 // Overload for ::std::tr1::tuple. Needed for printing function arguments,
653 // which are packed as tuples.
654
655 // Overloaded PrintTo() for tuples of various arities. We support
656 // tuples of up-to 10 fields. The following implementation works
657 // regardless of whether tr1::tuple is implemented using the
658 // non-standard variadic template feature or not.
659
660 inline void PrintTo(const ::std::tr1::tuple<>& t, ::std::ostream* os) {
661 PrintTupleTo(t, os);
662 }
663
664 template <typename T1>
665 void PrintTo(const ::std::tr1::tuple<T1>& t, ::std::ostream* os) {
666 PrintTupleTo(t, os);
667 }
668
669 template <typename T1, typename T2>
670 void PrintTo(const ::std::tr1::tuple<T1, T2>& t, ::std::ostream* os) {
671 PrintTupleTo(t, os);
672 }
673
674 template <typename T1, typename T2, typename T3>
675 void PrintTo(const ::std::tr1::tuple<T1, T2, T3>& t, ::std::ostream* os) {
676 PrintTupleTo(t, os);
677 }
678
679 template <typename T1, typename T2, typename T3, typename T4>
680 void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4>& t, ::std::ostream* os) {
681 PrintTupleTo(t, os);
682 }
683
684 template <typename T1, typename T2, typename T3, typename T4, typename T5>
685 void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5>& t,
686 ::std::ostream* os) {
687 PrintTupleTo(t, os);
688 }
689
690 template <typename T1, typename T2, typename T3, typename T4, typename T5,
691 typename T6>
692 void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6>& t,
693 ::std::ostream* os) {
694 PrintTupleTo(t, os);
695 }
696
697 template <typename T1, typename T2, typename T3, typename T4, typename T5,
698 typename T6, typename T7>
699 void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7>& t,
700 ::std::ostream* os) {
701 PrintTupleTo(t, os);
702 }
703
704 template <typename T1, typename T2, typename T3, typename T4, typename T5,
705 typename T6, typename T7, typename T8>
706 void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8>& t,
707 ::std::ostream* os) {
708 PrintTupleTo(t, os);
709 }
710
711 template <typename T1, typename T2, typename T3, typename T4, typename T5,
712 typename T6, typename T7, typename T8, typename T9>
713 void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9>& t,
714 ::std::ostream* os) {
715 PrintTupleTo(t, os);
716 }
717
718 template <typename T1, typename T2, typename T3, typename T4, typename T5,
719 typename T6, typename T7, typename T8, typename T9, typename T10>
720 void PrintTo(
721 const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>& t,
722 ::std::ostream* os) {
723 PrintTupleTo(t, os);
724 }
725 #endif // GTEST_HAS_TR1_TUPLE
726
727 #if GTEST_HAS_STD_TUPLE_
622 void PrintTupleTo(const T&, std::integral_constant<size_t, 0>,
623 ::std::ostream*) {}
624
625 template <typename T, size_t I>
626 void PrintTupleTo(const T& t, std::integral_constant<size_t, I>,
627 ::std::ostream* os) {
628 PrintTupleTo(t, std::integral_constant<size_t, I - 1>(), os);
629 GTEST_INTENTIONAL_CONST_COND_PUSH_()
630 if (I > 1) {
631 GTEST_INTENTIONAL_CONST_COND_POP_()
632 *os << ", ";
633 }
634 UniversalPrinter<typename std::tuple_element<I - 1, T>::type>::Print(
635 std::get<I - 1>(t), os);
636 }
637
728638 template <typename... Types>
729639 void PrintTo(const ::std::tuple<Types...>& t, ::std::ostream* os) {
730 PrintTupleTo(t, os);
731 }
732 #endif // GTEST_HAS_STD_TUPLE_
640 *os << "(";
641 PrintTupleTo(t, std::integral_constant<size_t, sizeof...(Types)>(), os);
642 *os << ")";
643 }
733644
734645 // Overload for std::pair.
735646 template <typename T1, typename T2>
825736 // If the array has more than kThreshold elements, we'll have to
826737 // omit some details by printing only the first and the last
827738 // kChunkSize elements.
828 // FIXME: let the user control the threshold using a flag.
829739 if (len <= kThreshold) {
830740 PrintRawArrayTo(begin, len, os);
831741 } else {
904814 class UniversalTersePrinter<const char*> {
905815 public:
906816 static void Print(const char* str, ::std::ostream* os) {
907 if (str == NULL) {
817 if (str == nullptr) {
908818 *os << "NULL";
909819 } else {
910820 UniversalPrint(std::string(str), os);
924834 class UniversalTersePrinter<const wchar_t*> {
925835 public:
926836 static void Print(const wchar_t* str, ::std::ostream* os) {
927 if (str == NULL) {
837 if (str == nullptr) {
928838 *os << "NULL";
929839 } else {
930840 UniversalPrint(::std::wstring(str), os);
960870
961871 typedef ::std::vector< ::std::string> Strings;
962872
963 // TuplePolicy<TupleT> must provide:
964 // - tuple_size
965 // size of tuple TupleT.
966 // - get<size_t I>(const TupleT& t)
967 // static function extracting element I of tuple TupleT.
968 // - tuple_element<size_t I>::type
969 // type of element I of tuple TupleT.
970 template <typename TupleT>
971 struct TuplePolicy;
972
973 #if GTEST_HAS_TR1_TUPLE
974 template <typename TupleT>
975 struct TuplePolicy {
976 typedef TupleT Tuple;
977 static const size_t tuple_size = ::std::tr1::tuple_size<Tuple>::value;
978
979 template <size_t I>
980 struct tuple_element : ::std::tr1::tuple_element<static_cast<int>(I), Tuple> {
981 };
982
983 template <size_t I>
984 static typename AddReference<const typename ::std::tr1::tuple_element<
985 static_cast<int>(I), Tuple>::type>::type
986 get(const Tuple& tuple) {
987 return ::std::tr1::get<I>(tuple);
988 }
989 };
990 template <typename TupleT>
991 const size_t TuplePolicy<TupleT>::tuple_size;
992 #endif // GTEST_HAS_TR1_TUPLE
993
994 #if GTEST_HAS_STD_TUPLE_
995 template <typename... Types>
996 struct TuplePolicy< ::std::tuple<Types...> > {
997 typedef ::std::tuple<Types...> Tuple;
998 static const size_t tuple_size = ::std::tuple_size<Tuple>::value;
999
1000 template <size_t I>
1001 struct tuple_element : ::std::tuple_element<I, Tuple> {};
1002
1003 template <size_t I>
1004 static const typename ::std::tuple_element<I, Tuple>::type& get(
1005 const Tuple& tuple) {
1006 return ::std::get<I>(tuple);
1007 }
1008 };
1009 template <typename... Types>
1010 const size_t TuplePolicy< ::std::tuple<Types...> >::tuple_size;
1011 #endif // GTEST_HAS_STD_TUPLE_
1012
1013 #if GTEST_HAS_TR1_TUPLE || GTEST_HAS_STD_TUPLE_
1014 // This helper template allows PrintTo() for tuples and
1015 // UniversalTersePrintTupleFieldsToStrings() to be defined by
1016 // induction on the number of tuple fields. The idea is that
1017 // TuplePrefixPrinter<N>::PrintPrefixTo(t, os) prints the first N
1018 // fields in tuple t, and can be defined in terms of
1019 // TuplePrefixPrinter<N - 1>.
1020 //
1021 // The inductive case.
1022 template <size_t N>
1023 struct TuplePrefixPrinter {
1024 // Prints the first N fields of a tuple.
1025 template <typename Tuple>
1026 static void PrintPrefixTo(const Tuple& t, ::std::ostream* os) {
1027 TuplePrefixPrinter<N - 1>::PrintPrefixTo(t, os);
1028 GTEST_INTENTIONAL_CONST_COND_PUSH_()
1029 if (N > 1) {
1030 GTEST_INTENTIONAL_CONST_COND_POP_()
1031 *os << ", ";
1032 }
1033 UniversalPrinter<
1034 typename TuplePolicy<Tuple>::template tuple_element<N - 1>::type>
1035 ::Print(TuplePolicy<Tuple>::template get<N - 1>(t), os);
1036 }
1037
1038873 // Tersely prints the first N fields of a tuple to a string vector,
1039874 // one element for each field.
1040 template <typename Tuple>
1041 static void TersePrintPrefixToStrings(const Tuple& t, Strings* strings) {
1042 TuplePrefixPrinter<N - 1>::TersePrintPrefixToStrings(t, strings);
1043 ::std::stringstream ss;
1044 UniversalTersePrint(TuplePolicy<Tuple>::template get<N - 1>(t), &ss);
1045 strings->push_back(ss.str());
1046 }
1047 };
1048
1049 // Base case.
1050 template <>
1051 struct TuplePrefixPrinter<0> {
1052 template <typename Tuple>
1053 static void PrintPrefixTo(const Tuple&, ::std::ostream*) {}
1054
1055 template <typename Tuple>
1056 static void TersePrintPrefixToStrings(const Tuple&, Strings*) {}
1057 };
1058
1059 // Helper function for printing a tuple.
1060 // Tuple must be either std::tr1::tuple or std::tuple type.
1061875 template <typename Tuple>
1062 void PrintTupleTo(const Tuple& t, ::std::ostream* os) {
1063 *os << "(";
1064 TuplePrefixPrinter<TuplePolicy<Tuple>::tuple_size>::PrintPrefixTo(t, os);
1065 *os << ")";
876 void TersePrintPrefixToStrings(const Tuple&, std::integral_constant<size_t, 0>,
877 Strings*) {}
878 template <typename Tuple, size_t I>
879 void TersePrintPrefixToStrings(const Tuple& t,
880 std::integral_constant<size_t, I>,
881 Strings* strings) {
882 TersePrintPrefixToStrings(t, std::integral_constant<size_t, I - 1>(),
883 strings);
884 ::std::stringstream ss;
885 UniversalTersePrint(std::get<I - 1>(t), &ss);
886 strings->push_back(ss.str());
1066887 }
1067888
1068889 // Prints the fields of a tuple tersely to a string vector, one
1071892 template <typename Tuple>
1072893 Strings UniversalTersePrintTupleFieldsToStrings(const Tuple& value) {
1073894 Strings result;
1074 TuplePrefixPrinter<TuplePolicy<Tuple>::tuple_size>::
1075 TersePrintPrefixToStrings(value, &result);
895 TersePrintPrefixToStrings(
896 value, std::integral_constant<size_t, std::tuple_size<Tuple>::value>(),
897 &result);
1076898 return result;
1077899 }
1078 #endif // GTEST_HAS_TR1_TUPLE || GTEST_HAS_STD_TUPLE_
1079900
1080901 } // namespace internal
1081902
7171 TestPartResultArray* result);
7272
7373 // The d'tor restores the previous test part result reporter.
74 virtual ~ScopedFakeTestPartResultReporter();
74 ~ScopedFakeTestPartResultReporter() override;
7575
7676 // Appends the TestPartResult object to the TestPartResultArray
7777 // received in the constructor.
7878 //
7979 // This method is from the TestPartResultReporterInterface
8080 // interface.
81 virtual void ReportTestPartResult(const TestPartResult& result);
81 void ReportTestPartResult(const TestPartResult& result) override;
82
8283 private:
8384 void Init();
8485
5252 enum Type {
5353 kSuccess, // Succeeded.
5454 kNonFatalFailure, // Failed but the test can continue.
55 kFatalFailure // Failed and the test should be terminated.
55 kFatalFailure, // Failed and the test should be terminated.
56 kSkip // Skipped.
5657 };
5758
5859 // C'tor. TestPartResult does NOT have a default constructor.
5960 // Always use this constructor (with parameters) to create a
6061 // TestPartResult object.
61 TestPartResult(Type a_type,
62 const char* a_file_name,
63 int a_line_number,
62 TestPartResult(Type a_type, const char* a_file_name, int a_line_number,
6463 const char* a_message)
6564 : type_(a_type),
66 file_name_(a_file_name == NULL ? "" : a_file_name),
65 file_name_(a_file_name == nullptr ? "" : a_file_name),
6766 line_number_(a_line_number),
6867 summary_(ExtractSummary(a_message)),
69 message_(a_message) {
70 }
68 message_(a_message) {}
7169
7270 // Gets the outcome of the test part.
7371 Type type() const { return type_; }
7573 // Gets the name of the source file where the test part took place, or
7674 // NULL if it's unknown.
7775 const char* file_name() const {
78 return file_name_.empty() ? NULL : file_name_.c_str();
76 return file_name_.empty() ? nullptr : file_name_.c_str();
7977 }
8078
8179 // Gets the line in the source file where the test part took place,
8886 // Gets the message associated with the test part.
8987 const char* message() const { return message_.c_str(); }
9088
91 // Returns true iff the test part passed.
89 // Returns true if and only if the test part was skipped.
90 bool skipped() const { return type_ == kSkip; }
91
92 // Returns true if and only if the test part passed.
9293 bool passed() const { return type_ == kSuccess; }
9394
94 // Returns true iff the test part failed.
95 bool failed() const { return type_ != kSuccess; }
96
97 // Returns true iff the test part non-fatally failed.
95 // Returns true if and only if the test part non-fatally failed.
9896 bool nonfatally_failed() const { return type_ == kNonFatalFailure; }
9997
100 // Returns true iff the test part fatally failed.
98 // Returns true if and only if the test part fatally failed.
10199 bool fatally_failed() const { return type_ == kFatalFailure; }
100
101 // Returns true if and only if the test part failed.
102 bool failed() const { return fatally_failed() || nonfatally_failed(); }
102103
103104 private:
104105 Type type_;
163164 : public TestPartResultReporterInterface {
164165 public:
165166 HasNewFatalFailureHelper();
166 virtual ~HasNewFatalFailureHelper();
167 virtual void ReportTestPartResult(const TestPartResult& result);
167 ~HasNewFatalFailureHelper() override;
168 void ReportTestPartResult(const TestPartResult& result) override;
168169 bool has_new_fatal_failure() const { return has_new_fatal_failure_; }
169170 private:
170171 bool has_new_fatal_failure_;
5151 T value_;
5252 };
5353
54 // Next, associate a list of types with the test case, which will be
54 // Next, associate a list of types with the test suite, which will be
5555 // repeated for each type in the list. The typedef is necessary for
5656 // the macro to parse correctly.
5757 typedef testing::Types<char, int, unsigned int> MyTypes;
58 TYPED_TEST_CASE(FooTest, MyTypes);
58 TYPED_TEST_SUITE(FooTest, MyTypes);
5959
6060 // If the type list contains only one type, you can write that type
6161 // directly without Types<...>:
62 // TYPED_TEST_CASE(FooTest, int);
62 // TYPED_TEST_SUITE(FooTest, int);
6363
6464 // Then, use TYPED_TEST() instead of TEST_F() to define as many typed
65 // tests for this test case as you want.
65 // tests for this test suite as you want.
6666 TYPED_TEST(FooTest, DoesBlah) {
67 // Inside a test, refer to TypeParam to get the type parameter.
68 // Since we are inside a derived class template, C++ requires use to
69 // visit the members of FooTest via 'this'.
67 // Inside a test, refer to the special name TypeParam to get the type
68 // parameter. Since we are inside a derived class template, C++ requires
69 // us to visit the members of FooTest via 'this'.
7070 TypeParam n = this->value_;
7171
7272 // To visit static members of the fixture, add the TestFixture::
8282
8383 TYPED_TEST(FooTest, HasPropertyA) { ... }
8484
85 // TYPED_TEST_CASE takes an optional third argument which allows to specify a
85 // TYPED_TEST_SUITE takes an optional third argument which allows to specify a
8686 // class that generates custom test name suffixes based on the type. This should
8787 // be a class which has a static template function GetName(int index) returning
8888 // a string for each type. The provided integer index equals the index of the
9898 // if (std::is_same<T, unsigned int>()) return "unsignedInt";
9999 // }
100100 // };
101 // TYPED_TEST_CASE(FooTest, MyTypes, MyTypeNames);
101 // TYPED_TEST_SUITE(FooTest, MyTypes, MyTypeNames);
102102
103103 #endif // 0
104104
125125 ...
126126 };
127127
128 // Next, declare that you will define a type-parameterized test case
128 // Next, declare that you will define a type-parameterized test suite
129129 // (the _P suffix is for "parameterized" or "pattern", whichever you
130130 // prefer):
131 TYPED_TEST_CASE_P(FooTest);
131 TYPED_TEST_SUITE_P(FooTest);
132132
133133 // Then, use TYPED_TEST_P() to define as many type-parameterized tests
134 // for this type-parameterized test case as you want.
134 // for this type-parameterized test suite as you want.
135135 TYPED_TEST_P(FooTest, DoesBlah) {
136136 // Inside a test, refer to TypeParam to get the type parameter.
137137 TypeParam n = 0;
142142
143143 // Now the tricky part: you need to register all test patterns before
144144 // you can instantiate them. The first argument of the macro is the
145 // test case name; the rest are the names of the tests in this test
145 // test suite name; the rest are the names of the tests in this test
146146 // case.
147 REGISTER_TYPED_TEST_CASE_P(FooTest,
148 DoesBlah, HasPropertyA);
147 REGISTER_TYPED_TEST_SUITE_P(FooTest,
148 DoesBlah, HasPropertyA);
149149
150150 // Finally, you are free to instantiate the pattern with the types you
151151 // want. If you put the above code in a header file, you can #include
153153 //
154154 // To distinguish different instances of the pattern, the first
155155 // argument to the INSTANTIATE_* macro is a prefix that will be added
156 // to the actual test case name. Remember to pick unique prefixes for
156 // to the actual test suite name. Remember to pick unique prefixes for
157157 // different instances.
158158 typedef testing::Types<char, int, unsigned int> MyTypes;
159 INSTANTIATE_TYPED_TEST_CASE_P(My, FooTest, MyTypes);
159 INSTANTIATE_TYPED_TEST_SUITE_P(My, FooTest, MyTypes);
160160
161161 // If the type list contains only one type, you can write that type
162162 // directly without Types<...>:
163 // INSTANTIATE_TYPED_TEST_CASE_P(My, FooTest, int);
164 //
165 // Similar to the optional argument of TYPED_TEST_CASE above,
166 // INSTANTIATE_TEST_CASE_P takes an optional fourth argument which allows to
163 // INSTANTIATE_TYPED_TEST_SUITE_P(My, FooTest, int);
164 //
165 // Similar to the optional argument of TYPED_TEST_SUITE above,
166 // INSTANTIATE_TEST_SUITE_P takes an optional fourth argument which allows to
167167 // generate custom names.
168 // INSTANTIATE_TYPED_TEST_CASE_P(My, FooTest, MyTypes, MyTypeNames);
168 // INSTANTIATE_TYPED_TEST_SUITE_P(My, FooTest, MyTypes, MyTypeNames);
169169
170170 #endif // 0
171171
179179 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
180180 //
181181 // Expands to the name of the typedef for the type parameters of the
182 // given test case.
183 # define GTEST_TYPE_PARAMS_(TestCaseName) gtest_type_params_##TestCaseName##_
182 // given test suite.
183 #define GTEST_TYPE_PARAMS_(TestSuiteName) gtest_type_params_##TestSuiteName##_
184184
185185 // Expands to the name of the typedef for the NameGenerator, responsible for
186186 // creating the suffixes of the name.
187 #define GTEST_NAME_GENERATOR_(TestCaseName) \
188 gtest_type_params_##TestCaseName##_NameGenerator
189
190 // The 'Types' template argument below must have spaces around it
191 // since some compilers may choke on '>>' when passing a template
192 // instance (e.g. Types<int>)
193 # define TYPED_TEST_CASE(CaseName, Types, ...) \
194 typedef ::testing::internal::TypeList< Types >::type GTEST_TYPE_PARAMS_( \
195 CaseName); \
196 typedef ::testing::internal::NameGeneratorSelector<__VA_ARGS__>::type \
187 #define GTEST_NAME_GENERATOR_(TestSuiteName) \
188 gtest_type_params_##TestSuiteName##_NameGenerator
189
190 #define TYPED_TEST_SUITE(CaseName, Types, ...) \
191 typedef ::testing::internal::TypeList<Types>::type GTEST_TYPE_PARAMS_( \
192 CaseName); \
193 typedef ::testing::internal::NameGeneratorSelector<__VA_ARGS__>::type \
197194 GTEST_NAME_GENERATOR_(CaseName)
198195
199196 # define TYPED_TEST(CaseName, TestName) \
223220 void GTEST_TEST_CLASS_NAME_(CaseName, \
224221 TestName)<gtest_TypeParam_>::TestBody()
225222
223 // Legacy API is deprecated but still available
224 #ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_
225 #define TYPED_TEST_CASE \
226 static_assert(::testing::internal::TypedTestCaseIsDeprecated(), ""); \
227 TYPED_TEST_SUITE
228 #endif // GTEST_REMOVE_LEGACY_TEST_CASEAPI_
229
226230 #endif // GTEST_HAS_TYPED_TEST
227231
228232 // Implements type-parameterized tests.
232236 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
233237 //
234238 // Expands to the namespace name that the type-parameterized tests for
235 // the given type-parameterized test case are defined in. The exact
239 // the given type-parameterized test suite are defined in. The exact
236240 // name of the namespace is subject to change without notice.
237 # define GTEST_CASE_NAMESPACE_(TestCaseName) \
238 gtest_case_##TestCaseName##_
241 #define GTEST_SUITE_NAMESPACE_(TestSuiteName) gtest_suite_##TestSuiteName##_
239242
240243 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
241244 //
242245 // Expands to the name of the variable used to remember the names of
243 // the defined tests in the given test case.
244 # define GTEST_TYPED_TEST_CASE_P_STATE_(TestCaseName) \
245 gtest_typed_test_case_p_state_##TestCaseName##_
246 // the defined tests in the given test suite.
247 #define GTEST_TYPED_TEST_SUITE_P_STATE_(TestSuiteName) \
248 gtest_typed_test_suite_p_state_##TestSuiteName##_
246249
247250 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE DIRECTLY.
248251 //
249252 // Expands to the name of the variable used to remember the names of
250 // the registered tests in the given test case.
251 # define GTEST_REGISTERED_TEST_NAMES_(TestCaseName) \
252 gtest_registered_test_names_##TestCaseName##_
253 // the registered tests in the given test suite.
254 #define GTEST_REGISTERED_TEST_NAMES_(TestSuiteName) \
255 gtest_registered_test_names_##TestSuiteName##_
253256
254257 // The variables defined in the type-parameterized test macros are
255258 // static as typically these macros are used in a .h file that can be
256259 // #included in multiple translation units linked together.
257 # define TYPED_TEST_CASE_P(CaseName) \
258 static ::testing::internal::TypedTestCasePState \
259 GTEST_TYPED_TEST_CASE_P_STATE_(CaseName)
260
261 # define TYPED_TEST_P(CaseName, TestName) \
262 namespace GTEST_CASE_NAMESPACE_(CaseName) { \
263 template <typename gtest_TypeParam_> \
264 class TestName : public CaseName<gtest_TypeParam_> { \
265 private: \
266 typedef CaseName<gtest_TypeParam_> TestFixture; \
267 typedef gtest_TypeParam_ TypeParam; \
268 virtual void TestBody(); \
269 }; \
270 static bool gtest_##TestName##_defined_ GTEST_ATTRIBUTE_UNUSED_ = \
271 GTEST_TYPED_TEST_CASE_P_STATE_(CaseName).AddTestName(\
272 __FILE__, __LINE__, #CaseName, #TestName); \
273 } \
274 template <typename gtest_TypeParam_> \
275 void GTEST_CASE_NAMESPACE_(CaseName)::TestName<gtest_TypeParam_>::TestBody()
276
277 # define REGISTER_TYPED_TEST_CASE_P(CaseName, ...) \
278 namespace GTEST_CASE_NAMESPACE_(CaseName) { \
279 typedef ::testing::internal::Templates<__VA_ARGS__>::type gtest_AllTests_; \
280 } \
281 static const char* const GTEST_REGISTERED_TEST_NAMES_(CaseName) \
282 GTEST_ATTRIBUTE_UNUSED_ = \
283 GTEST_TYPED_TEST_CASE_P_STATE_(CaseName).VerifyRegisteredTestNames( \
284 __FILE__, __LINE__, #__VA_ARGS__)
285
286 // The 'Types' template argument below must have spaces around it
287 // since some compilers may choke on '>>' when passing a template
288 // instance (e.g. Types<int>)
289 # define INSTANTIATE_TYPED_TEST_CASE_P(Prefix, CaseName, Types, ...) \
290 static bool gtest_##Prefix##_##CaseName GTEST_ATTRIBUTE_UNUSED_ = \
291 ::testing::internal::TypeParameterizedTestCase< \
292 CaseName, GTEST_CASE_NAMESPACE_(CaseName)::gtest_AllTests_, \
293 ::testing::internal::TypeList< Types >::type>:: \
294 Register(#Prefix, \
295 ::testing::internal::CodeLocation(__FILE__, __LINE__), \
296 &GTEST_TYPED_TEST_CASE_P_STATE_(CaseName), #CaseName, \
297 GTEST_REGISTERED_TEST_NAMES_(CaseName), \
298 ::testing::internal::GenerateNames< \
299 ::testing::internal::NameGeneratorSelector< \
300 __VA_ARGS__>::type, \
301 ::testing::internal::TypeList< Types >::type>())
260 #define TYPED_TEST_SUITE_P(SuiteName) \
261 static ::testing::internal::TypedTestSuitePState \
262 GTEST_TYPED_TEST_SUITE_P_STATE_(SuiteName)
263
264 // Legacy API is deprecated but still available
265 #ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_
266 #define TYPED_TEST_CASE_P \
267 static_assert(::testing::internal::TypedTestCase_P_IsDeprecated(), ""); \
268 TYPED_TEST_SUITE_P
269 #endif // GTEST_REMOVE_LEGACY_TEST_CASEAPI_
270
271 #define TYPED_TEST_P(SuiteName, TestName) \
272 namespace GTEST_SUITE_NAMESPACE_(SuiteName) { \
273 template <typename gtest_TypeParam_> \
274 class TestName : public SuiteName<gtest_TypeParam_> { \
275 private: \
276 typedef SuiteName<gtest_TypeParam_> TestFixture; \
277 typedef gtest_TypeParam_ TypeParam; \
278 virtual void TestBody(); \
279 }; \
280 static bool gtest_##TestName##_defined_ GTEST_ATTRIBUTE_UNUSED_ = \
281 GTEST_TYPED_TEST_SUITE_P_STATE_(SuiteName).AddTestName( \
282 __FILE__, __LINE__, #SuiteName, #TestName); \
283 } \
284 template <typename gtest_TypeParam_> \
285 void GTEST_SUITE_NAMESPACE_( \
286 SuiteName)::TestName<gtest_TypeParam_>::TestBody()
287
288 #define REGISTER_TYPED_TEST_SUITE_P(SuiteName, ...) \
289 namespace GTEST_SUITE_NAMESPACE_(SuiteName) { \
290 typedef ::testing::internal::Templates<__VA_ARGS__>::type gtest_AllTests_; \
291 } \
292 static const char* const GTEST_REGISTERED_TEST_NAMES_( \
293 SuiteName) GTEST_ATTRIBUTE_UNUSED_ = \
294 GTEST_TYPED_TEST_SUITE_P_STATE_(SuiteName).VerifyRegisteredTestNames( \
295 __FILE__, __LINE__, #__VA_ARGS__)
296
297 // Legacy API is deprecated but still available
298 #ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_
299 #define REGISTER_TYPED_TEST_CASE_P \
300 static_assert(::testing::internal::RegisterTypedTestCase_P_IsDeprecated(), \
301 ""); \
302 REGISTER_TYPED_TEST_SUITE_P
303 #endif // GTEST_REMOVE_LEGACY_TEST_CASEAPI_
304
305 #define INSTANTIATE_TYPED_TEST_SUITE_P(Prefix, SuiteName, Types, ...) \
306 static bool gtest_##Prefix##_##SuiteName GTEST_ATTRIBUTE_UNUSED_ = \
307 ::testing::internal::TypeParameterizedTestSuite< \
308 SuiteName, GTEST_SUITE_NAMESPACE_(SuiteName)::gtest_AllTests_, \
309 ::testing::internal::TypeList<Types>::type>:: \
310 Register(#Prefix, \
311 ::testing::internal::CodeLocation(__FILE__, __LINE__), \
312 &GTEST_TYPED_TEST_SUITE_P_STATE_(SuiteName), #SuiteName, \
313 GTEST_REGISTERED_TEST_NAMES_(SuiteName), \
314 ::testing::internal::GenerateNames< \
315 ::testing::internal::NameGeneratorSelector< \
316 __VA_ARGS__>::type, \
317 ::testing::internal::TypeList<Types>::type>())
318
319 // Legacy API is deprecated but still available
320 #ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_
321 #define INSTANTIATE_TYPED_TEST_CASE_P \
322 static_assert( \
323 ::testing::internal::InstantiateTypedTestCase_P_IsDeprecated(), ""); \
324 INSTANTIATE_TYPED_TEST_SUITE_P
325 #endif // GTEST_REMOVE_LEGACY_TEST_CASEAPI_
302326
303327 #endif // GTEST_HAS_TYPED_TEST_P
304328
5151 #ifndef GTEST_INCLUDE_GTEST_GTEST_H_
5252 #define GTEST_INCLUDE_GTEST_GTEST_H_
5353
54 #include <cstddef>
5455 #include <limits>
56 #include <memory>
5557 #include <ostream>
58 #include <type_traits>
5659 #include <vector>
5760
5861 #include "gtest/internal/gtest-internal.h"
5962 #include "gtest/internal/gtest-string.h"
6063 #include "gtest/gtest-death-test.h"
64 #include "gtest/gtest-matchers.h"
6165 #include "gtest/gtest-message.h"
6266 #include "gtest/gtest-param-test.h"
6367 #include "gtest/gtest-printers.h"
6771
6872 GTEST_DISABLE_MSC_WARNINGS_PUSH_(4251 \
6973 /* class A needs to have dll-interface to be used by clients of class B */)
70
71 // Depending on the platform, different string classes are available.
72 // On Linux, in addition to ::std::string, Google also makes use of
73 // class ::string, which has the same interface as ::std::string, but
74 // has a different implementation.
75 //
76 // You can define GTEST_HAS_GLOBAL_STRING to 1 to indicate that
77 // ::string is available AND is a distinct type to ::std::string, or
78 // define it to 0 to indicate otherwise.
79 //
80 // If ::std::string and ::string are the same class on your platform
81 // due to aliasing, you should define GTEST_HAS_GLOBAL_STRING to 0.
82 //
83 // If you do not define GTEST_HAS_GLOBAL_STRING, it is defined
84 // heuristically.
8574
8675 namespace testing {
8776
194183 // If we don't forward declare them the compiler might confuse the classes
195184 // in friendship clauses with same named classes on the scope.
196185 class Test;
197 class TestCase;
186 class TestSuite;
187
188 // Old API is still available but deprecated
189 #ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_
190 using TestCase = TestSuite;
191 #endif
198192 class TestInfo;
199193 class UnitTest;
200194
297291 template <typename T>
298292 explicit AssertionResult(
299293 const T& success,
300 typename internal::EnableIf<
301 !internal::ImplicitlyConvertible<T, AssertionResult>::value>::type*
302 /*enabler*/ = NULL)
294 typename std::enable_if<
295 !std::is_convertible<T, AssertionResult>::value>::type*
296 /*enabler*/
297 = nullptr)
303298 : success_(success) {}
304299
305300 #if defined(_MSC_VER) && _MSC_VER < 1910
312307 return *this;
313308 }
314309
315 // Returns true iff the assertion succeeded.
310 // Returns true if and only if the assertion succeeded.
316311 operator bool() const { return success_; } // NOLINT
317312
318313 // Returns the assertion's negation. Used with EXPECT/ASSERT_FALSE.
323318 // assertion's expectation). When nothing has been streamed into the
324319 // object, returns an empty string.
325320 const char* message() const {
326 return message_.get() != NULL ? message_->c_str() : "";
327 }
328 // FIXME: Remove this after making sure no clients use it.
321 return message_.get() != nullptr ? message_->c_str() : "";
322 }
329323 // Deprecated; please use message() instead.
330324 const char* failure_message() const { return message(); }
331325
346340 private:
347341 // Appends the contents of message to message_.
348342 void AppendMessage(const Message& a_message) {
349 if (message_.get() == NULL)
350 message_.reset(new ::std::string);
343 if (message_.get() == nullptr) message_.reset(new ::std::string);
351344 message_->append(a_message.GetString().c_str());
352345 }
353346
360353 // construct is not satisfied with the predicate's outcome.
361354 // Referenced via a pointer to avoid taking too much stack frame space
362355 // with test assertions.
363 internal::scoped_ptr< ::std::string> message_;
356 std::unique_ptr< ::std::string> message_;
364357 };
365358
366359 // Makes a successful assertion result.
384377
385378 // The abstract class that all tests inherit from.
386379 //
387 // In Google Test, a unit test program contains one or many TestCases, and
388 // each TestCase contains one or many Tests.
380 // In Google Test, a unit test program contains one or many TestSuites, and
381 // each TestSuite contains one or many Tests.
389382 //
390383 // When you define a test using the TEST macro, you don't need to
391384 // explicitly derive from Test - the TEST macro automatically does
409402 public:
410403 friend class TestInfo;
411404
412 // Defines types for pointers to functions that set up and tear down
413 // a test case.
414 typedef internal::SetUpTestCaseFunc SetUpTestCaseFunc;
415 typedef internal::TearDownTestCaseFunc TearDownTestCaseFunc;
416
417405 // The d'tor is virtual as we intend to inherit from Test.
418406 virtual ~Test();
419407
420408 // Sets up the stuff shared by all tests in this test case.
421409 //
422 // Google Test will call Foo::SetUpTestCase() before running the first
410 // Google Test will call Foo::SetUpTestSuite() before running the first
423411 // test in test case Foo. Hence a sub-class can define its own
424 // SetUpTestCase() method to shadow the one defined in the super
412 // SetUpTestSuite() method to shadow the one defined in the super
425413 // class.
414 // Failures that happen during SetUpTestSuite are logged but otherwise
415 // ignored.
416 static void SetUpTestSuite() {}
417
418 // Tears down the stuff shared by all tests in this test suite.
419 //
420 // Google Test will call Foo::TearDownTestSuite() after running the last
421 // test in test case Foo. Hence a sub-class can define its own
422 // TearDownTestSuite() method to shadow the one defined in the super
423 // class.
424 // Failures that happen during TearDownTestSuite are logged but otherwise
425 // ignored.
426 static void TearDownTestSuite() {}
427
428 // Legacy API is deprecated but still available
429 #ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_
430 static void TearDownTestCase() {}
426431 static void SetUpTestCase() {}
427
428 // Tears down the stuff shared by all tests in this test case.
429 //
430 // Google Test will call Foo::TearDownTestCase() after running the last
431 // test in test case Foo. Hence a sub-class can define its own
432 // TearDownTestCase() method to shadow the one defined in the super
433 // class.
434 static void TearDownTestCase() {}
435
436 // Returns true iff the current test has a fatal failure.
432 #endif // GTEST_REMOVE_LEGACY_TEST_CASEAPI_
433
434 // Returns true if and only if the current test has a fatal failure.
437435 static bool HasFatalFailure();
438436
439 // Returns true iff the current test has a non-fatal failure.
437 // Returns true if and only if the current test has a non-fatal failure.
440438 static bool HasNonfatalFailure();
441439
442 // Returns true iff the current test has a (either fatal or
440 // Returns true if and only if the current test was skipped.
441 static bool IsSkipped();
442
443 // Returns true if and only if the current test has a (either fatal or
443444 // non-fatal) failure.
444445 static bool HasFailure() { return HasFatalFailure() || HasNonfatalFailure(); }
445446
446 // Logs a property for the current test, test case, or for the entire
447 // Logs a property for the current test, test suite, or for the entire
447448 // invocation of the test program when used outside of the context of a
448 // test case. Only the last value for a given key is remembered. These
449 // test suite. Only the last value for a given key is remembered. These
449450 // are public static so they can be called from utility functions that are
450451 // not members of the test fixture. Calls to RecordProperty made during
451452 // lifespan of the test (from the moment its constructor starts to the
452453 // moment its destructor finishes) will be output in XML as attributes of
453454 // the <testcase> element. Properties recorded from fixture's
454 // SetUpTestCase or TearDownTestCase are logged as attributes of the
455 // SetUpTestSuite or TearDownTestSuite are logged as attributes of the
455456 // corresponding <testsuite> element. Calls to RecordProperty made in the
456457 // global context (before or after invocation of RUN_ALL_TESTS and from
457458 // SetUp/TearDown method of Environment objects registered with Google
470471 virtual void TearDown();
471472
472473 private:
473 // Returns true iff the current test has the same fixture class as
474 // the first test in the current test case.
474 // Returns true if and only if the current test has the same fixture class
475 // as the first test in the current test suite.
475476 static bool HasSameFixtureClass();
476477
477478 // Runs the test after the test fixture has been set up.
489490 // internal method to avoid clashing with names used in user TESTs.
490491 void DeleteSelf_() { delete this; }
491492
492 const internal::scoped_ptr< GTEST_FLAG_SAVER_ > gtest_flag_saver_;
493 const std::unique_ptr<GTEST_FLAG_SAVER_> gtest_flag_saver_;
493494
494495 // Often a user misspells SetUp() as Setup() and spends a long time
495496 // wondering why it is never called by Google Test. The declaration of
508509 // If you see an error about overriding the following function or
509510 // about it being private, you have mis-spelled SetUp() as Setup().
510511 struct Setup_should_be_spelled_SetUp {};
511 virtual Setup_should_be_spelled_SetUp* Setup() { return NULL; }
512 virtual Setup_should_be_spelled_SetUp* Setup() { return nullptr; }
512513
513514 // We disallow copying Tests.
514515 GTEST_DISALLOW_COPY_AND_ASSIGN_(Test);
572573 // Returns the number of the test properties.
573574 int test_property_count() const;
574575
575 // Returns true iff the test passed (i.e. no test part failed).
576 bool Passed() const { return !Failed(); }
577
578 // Returns true iff the test failed.
576 // Returns true if and only if the test passed (i.e. no test part failed).
577 bool Passed() const { return !Skipped() && !Failed(); }
578
579 // Returns true if and only if the test was skipped.
580 bool Skipped() const;
581
582 // Returns true if and only if the test failed.
579583 bool Failed() const;
580584
581 // Returns true iff the test fatally failed.
585 // Returns true if and only if the test fatally failed.
582586 bool HasFatalFailure() const;
583587
584 // Returns true iff the test has a non-fatal failure.
588 // Returns true if and only if the test has a non-fatal failure.
585589 bool HasNonfatalFailure() const;
586590
587591 // Returns the elapsed time, in milliseconds.
588592 TimeInMillis elapsed_time() const { return elapsed_time_; }
593
594 // Gets the time of the test case start, in ms from the start of the
595 // UNIX epoch.
596 TimeInMillis start_timestamp() const { return start_timestamp_; }
589597
590598 // Returns the i-th test part result among all the results. i can range from 0
591599 // to total_part_count() - 1. If i is not in that range, aborts the program.
598606
599607 private:
600608 friend class TestInfo;
601 friend class TestCase;
609 friend class TestSuite;
602610 friend class UnitTest;
603611 friend class internal::DefaultGlobalTestPartResultReporter;
604612 friend class internal::ExecDeathTest;
616624 const std::vector<TestProperty>& test_properties() const {
617625 return test_properties_;
618626 }
627
628 // Sets the start time.
629 void set_start_timestamp(TimeInMillis start) { start_timestamp_ = start; }
619630
620631 // Sets the elapsed time.
621632 void set_elapsed_time(TimeInMillis elapsed) { elapsed_time_ = elapsed; }
630641 const TestProperty& test_property);
631642
632643 // Adds a failure if the key is a reserved attribute of Google Test
633 // testcase tags. Returns true if the property is valid.
644 // testsuite tags. Returns true if the property is valid.
634645 // FIXME: Validate attribute names are legal and human readable.
635646 static bool ValidateTestProperty(const std::string& xml_element,
636647 const TestProperty& test_property);
660671 std::vector<TestProperty> test_properties_;
661672 // Running count of death tests.
662673 int death_test_count_;
674 // The start time, in milliseconds since UNIX Epoch.
675 TimeInMillis start_timestamp_;
663676 // The elapsed time, in milliseconds.
664677 TimeInMillis elapsed_time_;
665678
669682
670683 // A TestInfo object stores the following information about a test:
671684 //
672 // Test case name
685 // Test suite name
673686 // Test name
674687 // Whether the test should be run
675688 // A function pointer that creates the test object when invoked
684697 // don't inherit from TestInfo.
685698 ~TestInfo();
686699
687 // Returns the test case name.
688 const char* test_case_name() const { return test_case_name_.c_str(); }
700 // Returns the test suite name.
701 const char* test_suite_name() const { return test_suite_name_.c_str(); }
702
703 // Legacy API is deprecated but still available
704 #ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_
705 const char* test_case_name() const { return test_suite_name(); }
706 #endif // GTEST_REMOVE_LEGACY_TEST_CASEAPI_
689707
690708 // Returns the test name.
691709 const char* name() const { return name_.c_str(); }
693711 // Returns the name of the parameter type, or NULL if this is not a typed
694712 // or a type-parameterized test.
695713 const char* type_param() const {
696 if (type_param_.get() != NULL)
697 return type_param_->c_str();
698 return NULL;
714 if (type_param_.get() != nullptr) return type_param_->c_str();
715 return nullptr;
699716 }
700717
701718 // Returns the text representation of the value parameter, or NULL if this
702719 // is not a value-parameterized test.
703720 const char* value_param() const {
704 if (value_param_.get() != NULL)
705 return value_param_->c_str();
706 return NULL;
721 if (value_param_.get() != nullptr) return value_param_->c_str();
722 return nullptr;
707723 }
708724
709725 // Returns the file name where this test is defined.
720736 // been specified) and its full name matches the user-specified filter.
721737 //
722738 // Google Test allows the user to filter the tests by their full names.
723 // The full name of a test Bar in test case Foo is defined as
739 // The full name of a test Bar in test suite Foo is defined as
724740 // "Foo.Bar". Only the tests that match the filter will run.
725741 //
726742 // A filter is a colon-separated list of glob (not regex) patterns,
733749 // contains the character 'A' or starts with "Foo.".
734750 bool should_run() const { return should_run_; }
735751
736 // Returns true iff this test will appear in the XML report.
752 // Returns true if and only if this test will appear in the XML report.
737753 bool is_reportable() const {
738754 // The XML report includes tests matching the filter, excluding those
739755 // run in other shards.
748764 friend class internal::DefaultDeathTestFactory;
749765 #endif // GTEST_HAS_DEATH_TEST
750766 friend class Test;
751 friend class TestCase;
767 friend class TestSuite;
752768 friend class internal::UnitTestImpl;
753769 friend class internal::StreamingListenerTest;
754770 friend TestInfo* internal::MakeAndRegisterTestInfo(
755 const char* test_case_name,
756 const char* name,
757 const char* type_param,
758 const char* value_param,
759 internal::CodeLocation code_location,
760 internal::TypeId fixture_class_id,
761 Test::SetUpTestCaseFunc set_up_tc,
762 Test::TearDownTestCaseFunc tear_down_tc,
771 const char* test_suite_name, const char* name, const char* type_param,
772 const char* value_param, internal::CodeLocation code_location,
773 internal::TypeId fixture_class_id, internal::SetUpTestSuiteFunc set_up_tc,
774 internal::TearDownTestSuiteFunc tear_down_tc,
763775 internal::TestFactoryBase* factory);
764776
765777 // Constructs a TestInfo object. The newly constructed instance assumes
766778 // ownership of the factory object.
767 TestInfo(const std::string& test_case_name,
768 const std::string& name,
779 TestInfo(const std::string& test_suite_name, const std::string& name,
769780 const char* a_type_param, // NULL if not a type-parameterized test
770781 const char* a_value_param, // NULL if not a value-parameterized test
771782 internal::CodeLocation a_code_location,
787798 }
788799
789800 // These fields are immutable properties of the test.
790 const std::string test_case_name_; // Test case name
801 const std::string test_suite_name_; // test suite name
791802 const std::string name_; // Test name
792803 // Name of the parameter type, or NULL if this is not a typed or a
793804 // type-parameterized test.
794 const internal::scoped_ptr<const ::std::string> type_param_;
805 const std::unique_ptr<const ::std::string> type_param_;
795806 // Text representation of the value parameter, or NULL if this is not a
796807 // value-parameterized test.
797 const internal::scoped_ptr<const ::std::string> value_param_;
808 const std::unique_ptr<const ::std::string> value_param_;
798809 internal::CodeLocation location_;
799 const internal::TypeId fixture_class_id_; // ID of the test fixture class
800 bool should_run_; // True iff this test should run
801 bool is_disabled_; // True iff this test is disabled
802 bool matches_filter_; // True if this test matches the
803 // user-specified filter.
804 bool is_in_another_shard_; // Will be run in another shard.
810 const internal::TypeId fixture_class_id_; // ID of the test fixture class
811 bool should_run_; // True if and only if this test should run
812 bool is_disabled_; // True if and only if this test is disabled
813 bool matches_filter_; // True if this test matches the
814 // user-specified filter.
815 bool is_in_another_shard_; // Will be run in another shard.
805816 internal::TestFactoryBase* const factory_; // The factory that creates
806817 // the test object
807818
812823 GTEST_DISALLOW_COPY_AND_ASSIGN_(TestInfo);
813824 };
814825
815 // A test case, which consists of a vector of TestInfos.
816 //
817 // TestCase is not copyable.
818 class GTEST_API_ TestCase {
826 // A test suite, which consists of a vector of TestInfos.
827 //
828 // TestSuite is not copyable.
829 class GTEST_API_ TestSuite {
819830 public:
820 // Creates a TestCase with the given name.
831 // Creates a TestSuite with the given name.
821832 //
822 // TestCase does NOT have a default constructor. Always use this
823 // constructor to create a TestCase object.
833 // TestSuite does NOT have a default constructor. Always use this
834 // constructor to create a TestSuite object.
824835 //
825836 // Arguments:
826837 //
827 // name: name of the test case
838 // name: name of the test suite
828839 // a_type_param: the name of the test's type parameter, or NULL if
829840 // this is not a type-parameterized test.
830 // set_up_tc: pointer to the function that sets up the test case
831 // tear_down_tc: pointer to the function that tears down the test case
832 TestCase(const char* name, const char* a_type_param,
833 Test::SetUpTestCaseFunc set_up_tc,
834 Test::TearDownTestCaseFunc tear_down_tc);
835
836 // Destructor of TestCase.
837 virtual ~TestCase();
838
839 // Gets the name of the TestCase.
841 // set_up_tc: pointer to the function that sets up the test suite
842 // tear_down_tc: pointer to the function that tears down the test suite
843 TestSuite(const char* name, const char* a_type_param,
844 internal::SetUpTestSuiteFunc set_up_tc,
845 internal::TearDownTestSuiteFunc tear_down_tc);
846
847 // Destructor of TestSuite.
848 virtual ~TestSuite();
849
850 // Gets the name of the TestSuite.
840851 const char* name() const { return name_.c_str(); }
841852
842853 // Returns the name of the parameter type, or NULL if this is not a
843 // type-parameterized test case.
854 // type-parameterized test suite.
844855 const char* type_param() const {
845 if (type_param_.get() != NULL)
846 return type_param_->c_str();
847 return NULL;
848 }
849
850 // Returns true if any test in this test case should run.
856 if (type_param_.get() != nullptr) return type_param_->c_str();
857 return nullptr;
858 }
859
860 // Returns true if any test in this test suite should run.
851861 bool should_run() const { return should_run_; }
852862
853 // Gets the number of successful tests in this test case.
863 // Gets the number of successful tests in this test suite.
854864 int successful_test_count() const;
855865
856 // Gets the number of failed tests in this test case.
866 // Gets the number of skipped tests in this test suite.
867 int skipped_test_count() const;
868
869 // Gets the number of failed tests in this test suite.
857870 int failed_test_count() const;
858871
859872 // Gets the number of disabled tests that will be reported in the XML report.
860873 int reportable_disabled_test_count() const;
861874
862 // Gets the number of disabled tests in this test case.
875 // Gets the number of disabled tests in this test suite.
863876 int disabled_test_count() const;
864877
865878 // Gets the number of tests to be printed in the XML report.
866879 int reportable_test_count() const;
867880
868 // Get the number of tests in this test case that should run.
881 // Get the number of tests in this test suite that should run.
869882 int test_to_run_count() const;
870883
871 // Gets the number of all tests in this test case.
884 // Gets the number of all tests in this test suite.
872885 int total_test_count() const;
873886
874 // Returns true iff the test case passed.
887 // Returns true if and only if the test suite passed.
875888 bool Passed() const { return !Failed(); }
876889
877 // Returns true iff the test case failed.
890 // Returns true if and only if the test suite failed.
878891 bool Failed() const { return failed_test_count() > 0; }
879892
880893 // Returns the elapsed time, in milliseconds.
881894 TimeInMillis elapsed_time() const { return elapsed_time_; }
895
896 // Gets the time of the test suite start, in ms from the start of the
897 // UNIX epoch.
898 TimeInMillis start_timestamp() const { return start_timestamp_; }
882899
883900 // Returns the i-th test among all the tests. i can range from 0 to
884901 // total_test_count() - 1. If i is not in that range, returns NULL.
885902 const TestInfo* GetTestInfo(int i) const;
886903
887904 // Returns the TestResult that holds test properties recorded during
888 // execution of SetUpTestCase and TearDownTestCase.
905 // execution of SetUpTestSuite and TearDownTestSuite.
889906 const TestResult& ad_hoc_test_result() const { return ad_hoc_test_result_; }
890907
891908 private:
892909 friend class Test;
893910 friend class internal::UnitTestImpl;
894911
895 // Gets the (mutable) vector of TestInfos in this TestCase.
912 // Gets the (mutable) vector of TestInfos in this TestSuite.
896913 std::vector<TestInfo*>& test_info_list() { return test_info_list_; }
897914
898 // Gets the (immutable) vector of TestInfos in this TestCase.
915 // Gets the (immutable) vector of TestInfos in this TestSuite.
899916 const std::vector<TestInfo*>& test_info_list() const {
900917 return test_info_list_;
901918 }
907924 // Sets the should_run member.
908925 void set_should_run(bool should) { should_run_ = should; }
909926
910 // Adds a TestInfo to this test case. Will delete the TestInfo upon
911 // destruction of the TestCase object.
927 // Adds a TestInfo to this test suite. Will delete the TestInfo upon
928 // destruction of the TestSuite object.
912929 void AddTestInfo(TestInfo * test_info);
913930
914 // Clears the results of all tests in this test case.
931 // Clears the results of all tests in this test suite.
915932 void ClearResult();
916933
917 // Clears the results of all tests in the given test case.
918 static void ClearTestCaseResult(TestCase* test_case) {
919 test_case->ClearResult();
920 }
921
922 // Runs every test in this TestCase.
934 // Clears the results of all tests in the given test suite.
935 static void ClearTestSuiteResult(TestSuite* test_suite) {
936 test_suite->ClearResult();
937 }
938
939 // Runs every test in this TestSuite.
923940 void Run();
924941
925 // Runs SetUpTestCase() for this TestCase. This wrapper is needed
926 // for catching exceptions thrown from SetUpTestCase().
927 void RunSetUpTestCase() { (*set_up_tc_)(); }
928
929 // Runs TearDownTestCase() for this TestCase. This wrapper is
930 // needed for catching exceptions thrown from TearDownTestCase().
931 void RunTearDownTestCase() { (*tear_down_tc_)(); }
932
933 // Returns true iff test passed.
942 // Runs SetUpTestSuite() for this TestSuite. This wrapper is needed
943 // for catching exceptions thrown from SetUpTestSuite().
944 void RunSetUpTestSuite() {
945 if (set_up_tc_ != nullptr) {
946 (*set_up_tc_)();
947 }
948 }
949
950 // Runs TearDownTestSuite() for this TestSuite. This wrapper is
951 // needed for catching exceptions thrown from TearDownTestSuite().
952 void RunTearDownTestSuite() {
953 if (tear_down_tc_ != nullptr) {
954 (*tear_down_tc_)();
955 }
956 }
957
958 // Returns true if and only if test passed.
934959 static bool TestPassed(const TestInfo* test_info) {
935960 return test_info->should_run() && test_info->result()->Passed();
936961 }
937962
938 // Returns true iff test failed.
963 // Returns true if and only if test skipped.
964 static bool TestSkipped(const TestInfo* test_info) {
965 return test_info->should_run() && test_info->result()->Skipped();
966 }
967
968 // Returns true if and only if test failed.
939969 static bool TestFailed(const TestInfo* test_info) {
940970 return test_info->should_run() && test_info->result()->Failed();
941971 }
942972
943 // Returns true iff the test is disabled and will be reported in the XML
944 // report.
973 // Returns true if and only if the test is disabled and will be reported in
974 // the XML report.
945975 static bool TestReportableDisabled(const TestInfo* test_info) {
946976 return test_info->is_reportable() && test_info->is_disabled_;
947977 }
948978
949 // Returns true iff test is disabled.
979 // Returns true if and only if test is disabled.
950980 static bool TestDisabled(const TestInfo* test_info) {
951981 return test_info->is_disabled_;
952982 }
953983
954 // Returns true iff this test will appear in the XML report.
984 // Returns true if and only if this test will appear in the XML report.
955985 static bool TestReportable(const TestInfo* test_info) {
956986 return test_info->is_reportable();
957987 }
961991 return test_info->should_run();
962992 }
963993
964 // Shuffles the tests in this test case.
994 // Shuffles the tests in this test suite.
965995 void ShuffleTests(internal::Random* random);
966996
967997 // Restores the test order to before the first shuffle.
968998 void UnshuffleTests();
969999
970 // Name of the test case.
1000 // Name of the test suite.
9711001 std::string name_;
9721002 // Name of the parameter type, or NULL if this is not a typed or a
9731003 // type-parameterized test.
974 const internal::scoped_ptr<const ::std::string> type_param_;
1004 const std::unique_ptr<const ::std::string> type_param_;
9751005 // The vector of TestInfos in their original order. It owns the
9761006 // elements in the vector.
9771007 std::vector<TestInfo*> test_info_list_;
9791009 // shuffling and restoring the test order. The i-th element in this
9801010 // vector is the index of the i-th test in the shuffled test list.
9811011 std::vector<int> test_indices_;
982 // Pointer to the function that sets up the test case.
983 Test::SetUpTestCaseFunc set_up_tc_;
984 // Pointer to the function that tears down the test case.
985 Test::TearDownTestCaseFunc tear_down_tc_;
986 // True iff any test in this test case should run.
1012 // Pointer to the function that sets up the test suite.
1013 internal::SetUpTestSuiteFunc set_up_tc_;
1014 // Pointer to the function that tears down the test suite.
1015 internal::TearDownTestSuiteFunc tear_down_tc_;
1016 // True if and only if any test in this test suite should run.
9871017 bool should_run_;
1018 // The start time, in milliseconds since UNIX Epoch.
1019 TimeInMillis start_timestamp_;
9881020 // Elapsed time, in milliseconds.
9891021 TimeInMillis elapsed_time_;
990 // Holds test properties recorded during execution of SetUpTestCase and
991 // TearDownTestCase.
1022 // Holds test properties recorded during execution of SetUpTestSuite and
1023 // TearDownTestSuite.
9921024 TestResult ad_hoc_test_result_;
9931025
994 // We disallow copying TestCases.
995 GTEST_DISALLOW_COPY_AND_ASSIGN_(TestCase);
1026 // We disallow copying TestSuites.
1027 GTEST_DISALLOW_COPY_AND_ASSIGN_(TestSuite);
9961028 };
9971029
9981030 // An Environment object is capable of setting up and tearing down an
10231055 // If you see an error about overriding the following function or
10241056 // about it being private, you have mis-spelled SetUp() as Setup().
10251057 struct Setup_should_be_spelled_SetUp {};
1026 virtual Setup_should_be_spelled_SetUp* Setup() { return NULL; }
1058 virtual Setup_should_be_spelled_SetUp* Setup() { return nullptr; }
10271059 };
10281060
10291061 #if GTEST_HAS_EXCEPTIONS
10591091 // Fired after environment set-up for each iteration of tests ends.
10601092 virtual void OnEnvironmentsSetUpEnd(const UnitTest& unit_test) = 0;
10611093
1062 // Fired before the test case starts.
1063 virtual void OnTestCaseStart(const TestCase& test_case) = 0;
1094 // Fired before the test suite starts.
1095 virtual void OnTestSuiteStart(const TestSuite& /*test_suite*/) {}
1096
1097 // Legacy API is deprecated but still available
1098 #ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_
1099 virtual void OnTestCaseStart(const TestCase& /*test_case*/) {}
1100 #endif // GTEST_REMOVE_LEGACY_TEST_CASEAPI_
10641101
10651102 // Fired before the test starts.
10661103 virtual void OnTestStart(const TestInfo& test_info) = 0;
10731110 // Fired after the test ends.
10741111 virtual void OnTestEnd(const TestInfo& test_info) = 0;
10751112
1076 // Fired after the test case ends.
1077 virtual void OnTestCaseEnd(const TestCase& test_case) = 0;
1113 // Fired after the test suite ends.
1114 virtual void OnTestSuiteEnd(const TestSuite& /*test_suite*/) {}
1115
1116 // Legacy API is deprecated but still available
1117 #ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_
1118 virtual void OnTestCaseEnd(const TestCase& /*test_case*/) {}
1119 #endif // GTEST_REMOVE_LEGACY_TEST_CASEAPI_
10781120
10791121 // Fired before environment tear-down for each iteration of tests starts.
10801122 virtual void OnEnvironmentsTearDownStart(const UnitTest& unit_test) = 0;
10971139 // above.
10981140 class EmptyTestEventListener : public TestEventListener {
10991141 public:
1100 virtual void OnTestProgramStart(const UnitTest& /*unit_test*/) {}
1101 virtual void OnTestIterationStart(const UnitTest& /*unit_test*/,
1102 int /*iteration*/) {}
1103 virtual void OnEnvironmentsSetUpStart(const UnitTest& /*unit_test*/) {}
1104 virtual void OnEnvironmentsSetUpEnd(const UnitTest& /*unit_test*/) {}
1105 virtual void OnTestCaseStart(const TestCase& /*test_case*/) {}
1106 virtual void OnTestStart(const TestInfo& /*test_info*/) {}
1107 virtual void OnTestPartResult(const TestPartResult& /*test_part_result*/) {}
1108 virtual void OnTestEnd(const TestInfo& /*test_info*/) {}
1109 virtual void OnTestCaseEnd(const TestCase& /*test_case*/) {}
1110 virtual void OnEnvironmentsTearDownStart(const UnitTest& /*unit_test*/) {}
1111 virtual void OnEnvironmentsTearDownEnd(const UnitTest& /*unit_test*/) {}
1112 virtual void OnTestIterationEnd(const UnitTest& /*unit_test*/,
1113 int /*iteration*/) {}
1114 virtual void OnTestProgramEnd(const UnitTest& /*unit_test*/) {}
1142 void OnTestProgramStart(const UnitTest& /*unit_test*/) override {}
1143 void OnTestIterationStart(const UnitTest& /*unit_test*/,
1144 int /*iteration*/) override {}
1145 void OnEnvironmentsSetUpStart(const UnitTest& /*unit_test*/) override {}
1146 void OnEnvironmentsSetUpEnd(const UnitTest& /*unit_test*/) override {}
1147 void OnTestSuiteStart(const TestSuite& /*test_suite*/) override {}
1148 // Legacy API is deprecated but still available
1149 #ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_
1150 void OnTestCaseStart(const TestCase& /*test_case*/) override {}
1151 #endif // GTEST_REMOVE_LEGACY_TEST_CASEAPI_
1152
1153 void OnTestStart(const TestInfo& /*test_info*/) override {}
1154 void OnTestPartResult(const TestPartResult& /*test_part_result*/) override {}
1155 void OnTestEnd(const TestInfo& /*test_info*/) override {}
1156 void OnTestSuiteEnd(const TestSuite& /*test_suite*/) override {}
1157 #ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_
1158 void OnTestCaseEnd(const TestCase& /*test_case*/) override {}
1159 #endif // GTEST_REMOVE_LEGACY_TEST_CASEAPI_
1160
1161 void OnEnvironmentsTearDownStart(const UnitTest& /*unit_test*/) override {}
1162 void OnEnvironmentsTearDownEnd(const UnitTest& /*unit_test*/) override {}
1163 void OnTestIterationEnd(const UnitTest& /*unit_test*/,
1164 int /*iteration*/) override {}
1165 void OnTestProgramEnd(const UnitTest& /*unit_test*/) override {}
11151166 };
11161167
11171168 // TestEventListeners lets users add listeners to track events in Google Test.
11511202 }
11521203
11531204 private:
1154 friend class TestCase;
1205 friend class TestSuite;
11551206 friend class TestInfo;
11561207 friend class internal::DefaultGlobalTestPartResultReporter;
11571208 friend class internal::NoExecDeathTest;
11921243 GTEST_DISALLOW_COPY_AND_ASSIGN_(TestEventListeners);
11931244 };
11941245
1195 // A UnitTest consists of a vector of TestCases.
1246 // A UnitTest consists of a vector of TestSuites.
11961247 //
11971248 // This is a singleton class. The only instance of UnitTest is
11981249 // created when UnitTest::GetInstance() is first called. This
12211272 // was executed. The UnitTest object owns the string.
12221273 const char* original_working_dir() const;
12231274
1224 // Returns the TestCase object for the test that's currently running,
1275 // Returns the TestSuite object for the test that's currently running,
12251276 // or NULL if no test is running.
1226 const TestCase* current_test_case() const
1227 GTEST_LOCK_EXCLUDED_(mutex_);
1277 const TestSuite* current_test_suite() const GTEST_LOCK_EXCLUDED_(mutex_);
1278
1279 // Legacy API is still available but deprecated
1280 #ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_
1281 const TestCase* current_test_case() const GTEST_LOCK_EXCLUDED_(mutex_);
1282 #endif
12281283
12291284 // Returns the TestInfo object for the test that's currently running,
12301285 // or NULL if no test is running.
12341289 // Returns the random seed used at the start of the current test run.
12351290 int random_seed() const;
12361291
1237 // Returns the ParameterizedTestCaseRegistry object used to keep track of
1292 // Returns the ParameterizedTestSuiteRegistry object used to keep track of
12381293 // value-parameterized tests and instantiate and register them.
12391294 //
12401295 // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
1241 internal::ParameterizedTestCaseRegistry& parameterized_test_registry()
1296 internal::ParameterizedTestSuiteRegistry& parameterized_test_registry()
12421297 GTEST_LOCK_EXCLUDED_(mutex_);
12431298
1244 // Gets the number of successful test cases.
1299 // Gets the number of successful test suites.
1300 int successful_test_suite_count() const;
1301
1302 // Gets the number of failed test suites.
1303 int failed_test_suite_count() const;
1304
1305 // Gets the number of all test suites.
1306 int total_test_suite_count() const;
1307
1308 // Gets the number of all test suites that contain at least one test
1309 // that should run.
1310 int test_suite_to_run_count() const;
1311
1312 // Legacy API is deprecated but still available
1313 #ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_
12451314 int successful_test_case_count() const;
1246
1247 // Gets the number of failed test cases.
12481315 int failed_test_case_count() const;
1249
1250 // Gets the number of all test cases.
12511316 int total_test_case_count() const;
1252
1253 // Gets the number of all test cases that contain at least one test
1254 // that should run.
12551317 int test_case_to_run_count() const;
1318 #endif // GTEST_REMOVE_LEGACY_TEST_CASEAPI_
12561319
12571320 // Gets the number of successful tests.
12581321 int successful_test_count() const;
1322
1323 // Gets the number of skipped tests.
1324 int skipped_test_count() const;
12591325
12601326 // Gets the number of failed tests.
12611327 int failed_test_count() const;
12821348 // Gets the elapsed time, in milliseconds.
12831349 TimeInMillis elapsed_time() const;
12841350
1285 // Returns true iff the unit test passed (i.e. all test cases passed).
1351 // Returns true if and only if the unit test passed (i.e. all test suites
1352 // passed).
12861353 bool Passed() const;
12871354
1288 // Returns true iff the unit test failed (i.e. some test case failed
1289 // or something outside of all tests failed).
1355 // Returns true if and only if the unit test failed (i.e. some test suite
1356 // failed or something outside of all tests failed).
12901357 bool Failed() const;
12911358
1292 // Gets the i-th test case among all the test cases. i can range from 0 to
1293 // total_test_case_count() - 1. If i is not in that range, returns NULL.
1359 // Gets the i-th test suite among all the test suites. i can range from 0 to
1360 // total_test_suite_count() - 1. If i is not in that range, returns NULL.
1361 const TestSuite* GetTestSuite(int i) const;
1362
1363 // Legacy API is deprecated but still available
1364 #ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_
12941365 const TestCase* GetTestCase(int i) const;
1366 #endif // GTEST_REMOVE_LEGACY_TEST_CASEAPI_
12951367
12961368 // Returns the TestResult containing information on test failures and
1297 // properties logged outside of individual test cases.
1369 // properties logged outside of individual test suites.
12981370 const TestResult& ad_hoc_test_result() const;
12991371
13001372 // Returns the list of event listeners that can be used to track events
13251397 GTEST_LOCK_EXCLUDED_(mutex_);
13261398
13271399 // Adds a TestProperty to the current TestResult object when invoked from
1328 // inside a test, to current TestCase's ad_hoc_test_result_ when invoked
1329 // from SetUpTestCase or TearDownTestCase, or to the global property set
1400 // inside a test, to current TestSuite's ad_hoc_test_result_ when invoked
1401 // from SetUpTestSuite or TearDownTestSuite, or to the global property set
13301402 // when invoked elsewhere. If the result already contains a property with
13311403 // the same key, the value will be updated.
13321404 void RecordProperty(const std::string& key, const std::string& value);
13331405
1334 // Gets the i-th test case among all the test cases. i can range from 0 to
1335 // total_test_case_count() - 1. If i is not in that range, returns NULL.
1336 TestCase* GetMutableTestCase(int i);
1406 // Gets the i-th test suite among all the test suites. i can range from 0 to
1407 // total_test_suite_count() - 1. If i is not in that range, returns NULL.
1408 TestSuite* GetMutableTestSuite(int i);
13371409
13381410 // Accessors for the implementation object.
13391411 internal::UnitTestImpl* impl() { return impl_; }
14171489 // This overloaded version can be used in Windows programs compiled in
14181490 // UNICODE mode.
14191491 GTEST_API_ void InitGoogleTest(int* argc, wchar_t** argv);
1492
1493 // This overloaded version can be used on Arduino/embedded platforms where
1494 // there is no argc/argv.
1495 GTEST_API_ void InitGoogleTest();
14201496
14211497 namespace internal {
14221498
14341510 false);
14351511 }
14361512
1513 // This block of code defines operator==/!=
1514 // to block lexical scope lookup.
1515 // It prevents using invalid operator==/!= defined at namespace scope.
1516 struct faketype {};
1517 inline bool operator==(faketype, faketype) { return true; }
1518 inline bool operator!=(faketype, faketype) { return false; }
1519
14371520 // The helper function for {ASSERT|EXPECT}_EQ.
14381521 template <typename T1, typename T2>
14391522 AssertionResult CmpHelperEQ(const char* lhs_expression,
14551538 BiggestInt lhs,
14561539 BiggestInt rhs);
14571540
1458 // The helper class for {ASSERT|EXPECT}_EQ. The template argument
1459 // lhs_is_null_literal is true iff the first argument to ASSERT_EQ()
1460 // is a null pointer literal. The following default implementation is
1461 // for lhs_is_null_literal being false.
1462 template <bool lhs_is_null_literal>
14631541 class EqHelper {
14641542 public:
14651543 // This templatized version is for the general case.
1466 template <typename T1, typename T2>
1544 template <
1545 typename T1, typename T2,
1546 // Disable this overload for cases where one argument is a pointer
1547 // and the other is the null pointer constant.
1548 typename std::enable_if<!std::is_integral<T1>::value ||
1549 !std::is_pointer<T2>::value>::type* = nullptr>
14671550 static AssertionResult Compare(const char* lhs_expression,
1468 const char* rhs_expression,
1469 const T1& lhs,
1551 const char* rhs_expression, const T1& lhs,
14701552 const T2& rhs) {
14711553 return CmpHelperEQ(lhs_expression, rhs_expression, lhs, rhs);
14721554 }
14831565 BiggestInt rhs) {
14841566 return CmpHelperEQ(lhs_expression, rhs_expression, lhs, rhs);
14851567 }
1486 };
1487
1488 // This specialization is used when the first argument to ASSERT_EQ()
1489 // is a null pointer literal, like NULL, false, or 0.
1490 template <>
1491 class EqHelper<true> {
1492 public:
1493 // We define two overloaded versions of Compare(). The first
1494 // version will be picked when the second argument to ASSERT_EQ() is
1495 // NOT a pointer, e.g. ASSERT_EQ(0, AnIntFunction()) or
1496 // EXPECT_EQ(false, a_bool).
1497 template <typename T1, typename T2>
1498 static AssertionResult Compare(
1499 const char* lhs_expression,
1500 const char* rhs_expression,
1501 const T1& lhs,
1502 const T2& rhs,
1503 // The following line prevents this overload from being considered if T2
1504 // is not a pointer type. We need this because ASSERT_EQ(NULL, my_ptr)
1505 // expands to Compare("", "", NULL, my_ptr), which requires a conversion
1506 // to match the Secret* in the other overload, which would otherwise make
1507 // this template match better.
1508 typename EnableIf<!is_pointer<T2>::value>::type* = 0) {
1509 return CmpHelperEQ(lhs_expression, rhs_expression, lhs, rhs);
1510 }
1511
1512 // This version will be picked when the second argument to ASSERT_EQ() is a
1513 // pointer, e.g. ASSERT_EQ(NULL, a_pointer).
1568
15141569 template <typename T>
15151570 static AssertionResult Compare(
1516 const char* lhs_expression,
1517 const char* rhs_expression,
1518 // We used to have a second template parameter instead of Secret*. That
1519 // template parameter would deduce to 'long', making this a better match
1520 // than the first overload even without the first overload's EnableIf.
1521 // Unfortunately, gcc with -Wconversion-null warns when "passing NULL to
1522 // non-pointer argument" (even a deduced integral argument), so the old
1523 // implementation caused warnings in user code.
1524 Secret* /* lhs (NULL) */,
1525 T* rhs) {
1571 const char* lhs_expression, const char* rhs_expression,
1572 // Handle cases where '0' is used as a null pointer literal.
1573 std::nullptr_t /* lhs */, T* rhs) {
15261574 // We already know that 'lhs' is a null pointer.
1527 return CmpHelperEQ(lhs_expression, rhs_expression,
1528 static_cast<T*>(NULL), rhs);
1575 return CmpHelperEQ(lhs_expression, rhs_expression, static_cast<T*>(nullptr),
1576 rhs);
15291577 }
15301578 };
15311579
17541802 GTEST_DISALLOW_COPY_AND_ASSIGN_(AssertHelper);
17551803 };
17561804
1805 enum GTestColor { COLOR_DEFAULT, COLOR_RED, COLOR_GREEN, COLOR_YELLOW };
1806
1807 GTEST_API_ GTEST_ATTRIBUTE_PRINTF_(2, 3) void ColoredPrintf(GTestColor color,
1808 const char* fmt,
1809 ...);
1810
17571811 } // namespace internal
17581812
17591813 // The pure interface class that all value-parameterized tests inherit from.
17731827 // FooTest() {
17741828 // // Can use GetParam() here.
17751829 // }
1776 // virtual ~FooTest() {
1830 // ~FooTest() override {
17771831 // // Can use GetParam() here.
17781832 // }
1779 // virtual void SetUp() {
1833 // void SetUp() override {
17801834 // // Can use GetParam() here.
17811835 // }
1782 // virtual void TearDown {
1836 // void TearDown override {
17831837 // // Can use GetParam() here.
17841838 // }
17851839 // };
17881842 // Foo foo;
17891843 // ASSERT_TRUE(foo.DoesBar(GetParam()));
17901844 // }
1791 // INSTANTIATE_TEST_CASE_P(OneToTenRange, FooTest, ::testing::Range(1, 10));
1845 // INSTANTIATE_TEST_SUITE_P(OneToTenRange, FooTest, ::testing::Range(1, 10));
17921846
17931847 template <typename T>
17941848 class WithParamInterface {
17971851 virtual ~WithParamInterface() {}
17981852
17991853 // The current parameter value. Is also available in the test fixture's
1800 // constructor. This member function is non-static, even though it only
1801 // references static data, to reduce the opportunity for incorrect uses
1802 // like writing 'WithParamInterface<bool>::GetParam()' for a test that
1803 // uses a fixture whose parameter type is int.
1804 const ParamType& GetParam() const {
1805 GTEST_CHECK_(parameter_ != NULL)
1854 // constructor.
1855 static const ParamType& GetParam() {
1856 GTEST_CHECK_(parameter_ != nullptr)
18061857 << "GetParam() can only be called inside a value-parameterized test "
18071858 << "-- did you intend to write TEST_P instead of TEST_F?";
18081859 return *parameter_;
18231874 };
18241875
18251876 template <typename T>
1826 const T* WithParamInterface<T>::parameter_ = NULL;
1877 const T* WithParamInterface<T>::parameter_ = nullptr;
18271878
18281879 // Most value-parameterized classes can ignore the existence of
18291880 // WithParamInterface, and can just inherit from ::testing::TestWithParam.
18331884 };
18341885
18351886 // Macros for indicating success/failure in test code.
1887
1888 // Skips test in runtime.
1889 // Skipping test aborts current function.
1890 // Skipped tests are neither successful nor failed.
1891 #define GTEST_SKIP() GTEST_SKIP_("Skipped")
18361892
18371893 // ADD_FAILURE unconditionally adds a failure to the current test.
18381894 // SUCCEED generates a success - it doesn't automatically make the
18621918
18631919 // Generates a fatal failure with a generic message.
18641920 #define GTEST_FAIL() GTEST_FATAL_FAILURE_("Failed")
1921
1922 // Like GTEST_FAIL(), but at the given source file location.
1923 #define GTEST_FAIL_AT(file, line) \
1924 GTEST_MESSAGE_AT_(file, line, "Failed", \
1925 ::testing::TestPartResult::kFatalFailure)
18651926
18661927 // Define this macro to 1 to omit the definition of FAIL(), which is a
18671928 // generic name and clashes with some other libraries.
19632024 // ASSERT_GT(records.size(), 0) << "There is no record left.";
19642025
19652026 #define EXPECT_EQ(val1, val2) \
1966 EXPECT_PRED_FORMAT2(::testing::internal:: \
1967 EqHelper<GTEST_IS_NULL_LITERAL_(val1)>::Compare, \
1968 val1, val2)
2027 EXPECT_PRED_FORMAT2(::testing::internal::EqHelper::Compare, val1, val2)
19692028 #define EXPECT_NE(val1, val2) \
19702029 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperNE, val1, val2)
19712030 #define EXPECT_LE(val1, val2) \
19782037 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperGT, val1, val2)
19792038
19802039 #define GTEST_ASSERT_EQ(val1, val2) \
1981 ASSERT_PRED_FORMAT2(::testing::internal:: \
1982 EqHelper<GTEST_IS_NULL_LITERAL_(val1)>::Compare, \
1983 val1, val2)
2040 ASSERT_PRED_FORMAT2(::testing::internal::EqHelper::Compare, val1, val2)
19842041 #define GTEST_ASSERT_NE(val1, val2) \
19852042 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperNE, val1, val2)
19862043 #define GTEST_ASSERT_LE(val1, val2) \
21712228 PushTrace(file, line, message ? message : "(null)");
21722229 }
21732230
2174 #if GTEST_HAS_GLOBAL_STRING
2175 ScopedTrace(const char* file, int line, const ::string& message) {
2176 PushTrace(file, line, message);
2177 }
2178 #endif
2179
21802231 ScopedTrace(const char* file, int line, const std::string& message) {
21812232 PushTrace(file, line, message);
21822233 }
22142265 ::testing::ScopedTrace GTEST_CONCAT_TOKEN_(gtest_trace_, __LINE__)(\
22152266 __FILE__, __LINE__, (message))
22162267
2217
22182268 // Compile-time assertion for type equality.
2219 // StaticAssertTypeEq<type1, type2>() compiles iff type1 and type2 are
2220 // the same type. The value it returns is not interesting.
2269 // StaticAssertTypeEq<type1, type2>() compiles if and only if type1 and type2
2270 // are the same type. The value it returns is not interesting.
22212271 //
22222272 // Instead of making StaticAssertTypeEq a class template, we make it a
22232273 // function template that invokes a helper class template. This
22462296 //
22472297 // to cause a compiler error.
22482298 template <typename T1, typename T2>
2249 bool StaticAssertTypeEq() {
2250 (void)internal::StaticAssertTypeEqHelper<T1, T2>();
2299 constexpr bool StaticAssertTypeEq() noexcept {
2300 static_assert(std::is_same<T1, T2>::value,
2301 "type1 and type2 are not the same type");
22512302 return true;
22522303 }
22532304
22542305 // Defines a test.
22552306 //
2256 // The first parameter is the name of the test case, and the second
2257 // parameter is the name of the test within the test case.
2258 //
2259 // The convention is to end the test case name with "Test". For
2260 // example, a test case for the Foo class can be named FooTest.
2307 // The first parameter is the name of the test suite, and the second
2308 // parameter is the name of the test within the test suite.
2309 //
2310 // The convention is to end the test suite name with "Test". For
2311 // example, a test suite for the Foo class can be named FooTest.
22612312 //
22622313 // Test code should appear between braces after an invocation of
22632314 // this macro. Example:
22762327 // code. GetTestTypeId() is guaranteed to always return the same
22772328 // value, as it always calls GetTypeId<>() from the Google Test
22782329 // framework.
2279 #define GTEST_TEST(test_case_name, test_name)\
2280 GTEST_TEST_(test_case_name, test_name, \
2281 ::testing::Test, ::testing::internal::GetTestTypeId())
2330 #define GTEST_TEST(test_suite_name, test_name) \
2331 GTEST_TEST_(test_suite_name, test_name, ::testing::Test, \
2332 ::testing::internal::GetTestTypeId())
22822333
22832334 // Define this macro to 1 to omit the definition of TEST(), which
22842335 // is a generic name and clashes with some other libraries.
22852336 #if !GTEST_DONT_DEFINE_TEST
2286 # define TEST(test_case_name, test_name) GTEST_TEST(test_case_name, test_name)
2337 #define TEST(test_suite_name, test_name) GTEST_TEST(test_suite_name, test_name)
22872338 #endif
22882339
22892340 // Defines a test that uses a test fixture.
22902341 //
22912342 // The first parameter is the name of the test fixture class, which
2292 // also doubles as the test case name. The second parameter is the
2293 // name of the test within the test case.
2343 // also doubles as the test suite name. The second parameter is the
2344 // name of the test within the test suite.
22942345 //
22952346 // A test fixture class must be declared earlier. The user should put
22962347 // the test code between braces after using this macro. Example:
22972348 //
22982349 // class FooTest : public testing::Test {
22992350 // protected:
2300 // virtual void SetUp() { b_.AddElement(3); }
2351 // void SetUp() override { b_.AddElement(3); }
23012352 //
23022353 // Foo a_;
23032354 // Foo b_;
23112362 // EXPECT_EQ(a_.size(), 0);
23122363 // EXPECT_EQ(b_.size(), 1);
23132364 // }
2314
2365 //
2366 // GOOGLETEST_CM0011 DO NOT DELETE
23152367 #define TEST_F(test_fixture, test_name)\
23162368 GTEST_TEST_(test_fixture, test_name, test_fixture, \
23172369 ::testing::internal::GetTypeId<test_fixture>())
23242376 # pragma warning(pop)
23252377 #endif
23262378
2379 // Dynamically registers a test with the framework.
2380 //
2381 // This is an advanced API only to be used when the `TEST` macros are
2382 // insufficient. The macros should be preferred when possible, as they avoid
2383 // most of the complexity of calling this function.
2384 //
2385 // The `factory` argument is a factory callable (move-constructible) object or
2386 // function pointer that creates a new instance of the Test object. It
2387 // handles ownership to the caller. The signature of the callable is
2388 // `Fixture*()`, where `Fixture` is the test fixture class for the test. All
2389 // tests registered with the same `test_suite_name` must return the same
2390 // fixture type. This is checked at runtime.
2391 //
2392 // The framework will infer the fixture class from the factory and will call
2393 // the `SetUpTestSuite` and `TearDownTestSuite` for it.
2394 //
2395 // Must be called before `RUN_ALL_TESTS()` is invoked, otherwise behavior is
2396 // undefined.
2397 //
2398 // Use case example:
2399 //
2400 // class MyFixture : public ::testing::Test {
2401 // public:
2402 // // All of these optional, just like in regular macro usage.
2403 // static void SetUpTestSuite() { ... }
2404 // static void TearDownTestSuite() { ... }
2405 // void SetUp() override { ... }
2406 // void TearDown() override { ... }
2407 // };
2408 //
2409 // class MyTest : public MyFixture {
2410 // public:
2411 // explicit MyTest(int data) : data_(data) {}
2412 // void TestBody() override { ... }
2413 //
2414 // private:
2415 // int data_;
2416 // };
2417 //
2418 // void RegisterMyTests(const std::vector<int>& values) {
2419 // for (int v : values) {
2420 // ::testing::RegisterTest(
2421 // "MyFixture", ("Test" + std::to_string(v)).c_str(), nullptr,
2422 // std::to_string(v).c_str(),
2423 // __FILE__, __LINE__,
2424 // // Important to use the fixture type as the return type here.
2425 // [=]() -> MyFixture* { return new MyTest(v); });
2426 // }
2427 // }
2428 // ...
2429 // int main(int argc, char** argv) {
2430 // std::vector<int> values_to_test = LoadValuesFromConfig();
2431 // RegisterMyTests(values_to_test);
2432 // ...
2433 // return RUN_ALL_TESTS();
2434 // }
2435 //
2436 template <int&... ExplicitParameterBarrier, typename Factory>
2437 TestInfo* RegisterTest(const char* test_suite_name, const char* test_name,
2438 const char* type_param, const char* value_param,
2439 const char* file, int line, Factory factory) {
2440 using TestT = typename std::remove_pointer<decltype(factory())>::type;
2441
2442 class FactoryImpl : public internal::TestFactoryBase {
2443 public:
2444 explicit FactoryImpl(Factory f) : factory_(std::move(f)) {}
2445 Test* CreateTest() override { return factory_(); }
2446
2447 private:
2448 Factory factory_;
2449 };
2450
2451 return internal::MakeAndRegisterTestInfo(
2452 test_suite_name, test_name, type_param, value_param,
2453 internal::CodeLocation(file, line), internal::GetTypeId<TestT>(),
2454 internal::SuiteApiResolver<TestT>::GetSetUpCaseOrSuite(file, line),
2455 internal::SuiteApiResolver<TestT>::GetTearDownCaseOrSuite(file, line),
2456 new FactoryImpl{std::move(factory)});
2457 }
2458
23272459 } // namespace testing
23282460
23292461 // Use this function in main() to run all tests. It returns 0 if all
2626 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
2727 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2828
29 // This file is AUTOMATICALLY GENERATED on 01/02/2018 by command
29 // This file is AUTOMATICALLY GENERATED on 01/02/2019 by command
3030 // 'gen_gtest_pred_impl.py 5'. DO NOT EDIT BY HAND!
3131 //
3232 // Implements a family of generic predicate assertion macros.
33
3433 // GOOGLETEST_CM0001 DO NOT DELETE
3534
3635 #ifndef GTEST_INCLUDE_GTEST_GTEST_PRED_IMPL_H_
6665 // We also define the EXPECT_* variations.
6766 //
6867 // For now we only support predicates whose arity is at most 5.
68 // Please email googletestframework@googlegroups.com if you need
69 // support for higher arities.
6970
7071 // GTEST_ASSERT_ is the basic statement to which all of the assertions
7172 // in this file reduce. Don't use this in your code.
8889 const T1& v1) {
8990 if (pred(v1)) return AssertionSuccess();
9091
91 return AssertionFailure() << pred_text << "("
92 << e1 << ") evaluates to false, where"
93 << "\n" << e1 << " evaluates to " << v1;
92 return AssertionFailure()
93 << pred_text << "(" << e1 << ") evaluates to false, where"
94 << "\n"
95 << e1 << " evaluates to " << ::testing::PrintToString(v1);
9496 }
9597
9698 // Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT1.
132134 const T2& v2) {
133135 if (pred(v1, v2)) return AssertionSuccess();
134136
135 return AssertionFailure() << pred_text << "("
136 << e1 << ", "
137 << e2 << ") evaluates to false, where"
138 << "\n" << e1 << " evaluates to " << v1
139 << "\n" << e2 << " evaluates to " << v2;
137 return AssertionFailure()
138 << pred_text << "(" << e1 << ", " << e2
139 << ") evaluates to false, where"
140 << "\n"
141 << e1 << " evaluates to " << ::testing::PrintToString(v1) << "\n"
142 << e2 << " evaluates to " << ::testing::PrintToString(v2);
140143 }
141144
142145 // Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT2.
183186 const T3& v3) {
184187 if (pred(v1, v2, v3)) return AssertionSuccess();
185188
186 return AssertionFailure() << pred_text << "("
187 << e1 << ", "
188 << e2 << ", "
189 << e3 << ") evaluates to false, where"
190 << "\n" << e1 << " evaluates to " << v1
191 << "\n" << e2 << " evaluates to " << v2
192 << "\n" << e3 << " evaluates to " << v3;
189 return AssertionFailure()
190 << pred_text << "(" << e1 << ", " << e2 << ", " << e3
191 << ") evaluates to false, where"
192 << "\n"
193 << e1 << " evaluates to " << ::testing::PrintToString(v1) << "\n"
194 << e2 << " evaluates to " << ::testing::PrintToString(v2) << "\n"
195 << e3 << " evaluates to " << ::testing::PrintToString(v3);
193196 }
194197
195198 // Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT3.
241244 const T4& v4) {
242245 if (pred(v1, v2, v3, v4)) return AssertionSuccess();
243246
244 return AssertionFailure() << pred_text << "("
245 << e1 << ", "
246 << e2 << ", "
247 << e3 << ", "
248 << e4 << ") evaluates to false, where"
249 << "\n" << e1 << " evaluates to " << v1
250 << "\n" << e2 << " evaluates to " << v2
251 << "\n" << e3 << " evaluates to " << v3
252 << "\n" << e4 << " evaluates to " << v4;
247 return AssertionFailure()
248 << pred_text << "(" << e1 << ", " << e2 << ", " << e3 << ", " << e4
249 << ") evaluates to false, where"
250 << "\n"
251 << e1 << " evaluates to " << ::testing::PrintToString(v1) << "\n"
252 << e2 << " evaluates to " << ::testing::PrintToString(v2) << "\n"
253 << e3 << " evaluates to " << ::testing::PrintToString(v3) << "\n"
254 << e4 << " evaluates to " << ::testing::PrintToString(v4);
253255 }
254256
255257 // Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT4.
306308 const T5& v5) {
307309 if (pred(v1, v2, v3, v4, v5)) return AssertionSuccess();
308310
309 return AssertionFailure() << pred_text << "("
310 << e1 << ", "
311 << e2 << ", "
312 << e3 << ", "
313 << e4 << ", "
314 << e5 << ") evaluates to false, where"
315 << "\n" << e1 << " evaluates to " << v1
316 << "\n" << e2 << " evaluates to " << v2
317 << "\n" << e3 << " evaluates to " << v3
318 << "\n" << e4 << " evaluates to " << v4
319 << "\n" << e5 << " evaluates to " << v5;
311 return AssertionFailure()
312 << pred_text << "(" << e1 << ", " << e2 << ", " << e3 << ", " << e4
313 << ", " << e5 << ") evaluates to false, where"
314 << "\n"
315 << e1 << " evaluates to " << ::testing::PrintToString(v1) << "\n"
316 << e2 << " evaluates to " << ::testing::PrintToString(v2) << "\n"
317 << e3 << " evaluates to " << ::testing::PrintToString(v3) << "\n"
318 << e4 << " evaluates to " << ::testing::PrintToString(v4) << "\n"
319 << e5 << " evaluates to " << ::testing::PrintToString(v5);
320320 }
321321
322322 // Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT5.
3535 #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_DEATH_TEST_INTERNAL_H_
3636 #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_DEATH_TEST_INTERNAL_H_
3737
38 #include "gtest/gtest-matchers.h"
3839 #include "gtest/internal/gtest-internal.h"
3940
4041 #include <stdio.h>
42 #include <memory>
4143
4244 namespace testing {
4345 namespace internal {
7779 // argument is set. If the death test should be skipped, the pointer
7880 // is set to NULL; otherwise, it is set to the address of a new concrete
7981 // DeathTest object that controls the execution of the current test.
80 static bool Create(const char* statement, const RE* regex,
82 static bool Create(const char* statement, Matcher<const std::string&> matcher,
8183 const char* file, int line, DeathTest** test);
8284 DeathTest();
8385 virtual ~DeathTest() { }
143145 class DeathTestFactory {
144146 public:
145147 virtual ~DeathTestFactory() { }
146 virtual bool Create(const char* statement, const RE* regex,
147 const char* file, int line, DeathTest** test) = 0;
148 virtual bool Create(const char* statement,
149 Matcher<const std::string&> matcher, const char* file,
150 int line, DeathTest** test) = 0;
148151 };
149152
150153 // A concrete DeathTestFactory implementation for normal use.
151154 class DefaultDeathTestFactory : public DeathTestFactory {
152155 public:
153 virtual bool Create(const char* statement, const RE* regex,
154 const char* file, int line, DeathTest** test);
156 bool Create(const char* statement, Matcher<const std::string&> matcher,
157 const char* file, int line, DeathTest** test) override;
155158 };
156159
157160 // Returns true if exit_status describes a process that was terminated
158161 // by a signal, or exited normally with a nonzero exit code.
159162 GTEST_API_ bool ExitedUnsuccessfully(int exit_status);
163
164 // A string passed to EXPECT_DEATH (etc.) is caught by one of these overloads
165 // and interpreted as a regex (rather than an Eq matcher) for legacy
166 // compatibility.
167 inline Matcher<const ::std::string&> MakeDeathTestMatcher(
168 ::testing::internal::RE regex) {
169 return ContainsRegex(regex.pattern());
170 }
171 inline Matcher<const ::std::string&> MakeDeathTestMatcher(const char* regex) {
172 return ContainsRegex(regex);
173 }
174 inline Matcher<const ::std::string&> MakeDeathTestMatcher(
175 const ::std::string& regex) {
176 return ContainsRegex(regex);
177 }
178
179 // If a Matcher<const ::std::string&> is passed to EXPECT_DEATH (etc.), it's
180 // used directly.
181 inline Matcher<const ::std::string&> MakeDeathTestMatcher(
182 Matcher<const ::std::string&> matcher) {
183 return matcher;
184 }
160185
161186 // Traps C++ exceptions escaping statement and reports them as test
162187 // failures. Note that trapping SEH exceptions is not implemented here.
185210
186211 // This macro is for implementing ASSERT_DEATH*, EXPECT_DEATH*,
187212 // ASSERT_EXIT*, and EXPECT_EXIT*.
188 # define GTEST_DEATH_TEST_(statement, predicate, regex, fail) \
189 GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
190 if (::testing::internal::AlwaysTrue()) { \
191 const ::testing::internal::RE& gtest_regex = (regex); \
192 ::testing::internal::DeathTest* gtest_dt; \
193 if (!::testing::internal::DeathTest::Create(#statement, &gtest_regex, \
194 __FILE__, __LINE__, &gtest_dt)) { \
195 goto GTEST_CONCAT_TOKEN_(gtest_label_, __LINE__); \
196 } \
197 if (gtest_dt != NULL) { \
198 ::testing::internal::scoped_ptr< ::testing::internal::DeathTest> \
199 gtest_dt_ptr(gtest_dt); \
200 switch (gtest_dt->AssumeRole()) { \
201 case ::testing::internal::DeathTest::OVERSEE_TEST: \
202 if (!gtest_dt->Passed(predicate(gtest_dt->Wait()))) { \
203 goto GTEST_CONCAT_TOKEN_(gtest_label_, __LINE__); \
204 } \
205 break; \
206 case ::testing::internal::DeathTest::EXECUTE_TEST: { \
207 ::testing::internal::DeathTest::ReturnSentinel \
208 gtest_sentinel(gtest_dt); \
209 GTEST_EXECUTE_DEATH_TEST_STATEMENT_(statement, gtest_dt); \
210 gtest_dt->Abort(::testing::internal::DeathTest::TEST_DID_NOT_DIE); \
211 break; \
212 } \
213 default: \
214 break; \
215 } \
216 } \
217 } else \
218 GTEST_CONCAT_TOKEN_(gtest_label_, __LINE__): \
219 fail(::testing::internal::DeathTest::LastMessage())
213 #define GTEST_DEATH_TEST_(statement, predicate, regex_or_matcher, fail) \
214 GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
215 if (::testing::internal::AlwaysTrue()) { \
216 ::testing::internal::DeathTest* gtest_dt; \
217 if (!::testing::internal::DeathTest::Create( \
218 #statement, \
219 ::testing::internal::MakeDeathTestMatcher(regex_or_matcher), \
220 __FILE__, __LINE__, &gtest_dt)) { \
221 goto GTEST_CONCAT_TOKEN_(gtest_label_, __LINE__); \
222 } \
223 if (gtest_dt != nullptr) { \
224 std::unique_ptr< ::testing::internal::DeathTest> gtest_dt_ptr(gtest_dt); \
225 switch (gtest_dt->AssumeRole()) { \
226 case ::testing::internal::DeathTest::OVERSEE_TEST: \
227 if (!gtest_dt->Passed(predicate(gtest_dt->Wait()))) { \
228 goto GTEST_CONCAT_TOKEN_(gtest_label_, __LINE__); \
229 } \
230 break; \
231 case ::testing::internal::DeathTest::EXECUTE_TEST: { \
232 ::testing::internal::DeathTest::ReturnSentinel gtest_sentinel( \
233 gtest_dt); \
234 GTEST_EXECUTE_DEATH_TEST_STATEMENT_(statement, gtest_dt); \
235 gtest_dt->Abort(::testing::internal::DeathTest::TEST_DID_NOT_DIE); \
236 break; \
237 } \
238 default: \
239 break; \
240 } \
241 } \
242 } else \
243 GTEST_CONCAT_TOKEN_(gtest_label_, __LINE__) \
244 : fail(::testing::internal::DeathTest::LastMessage())
220245 // The symbol "fail" here expands to something into which a message
221246 // can be streamed.
222247
225250 // must accept a streamed message even though the message is never printed.
226251 // The regex object is not evaluated, but it is used to prevent "unused"
227252 // warnings and to avoid an expression that doesn't compile in debug mode.
228 #define GTEST_EXECUTE_STATEMENT_(statement, regex) \
229 GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
230 if (::testing::internal::AlwaysTrue()) { \
231 GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
232 } else if (!::testing::internal::AlwaysTrue()) { \
233 const ::testing::internal::RE& gtest_regex = (regex); \
234 static_cast<void>(gtest_regex); \
235 } else \
253 #define GTEST_EXECUTE_STATEMENT_(statement, regex_or_matcher) \
254 GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
255 if (::testing::internal::AlwaysTrue()) { \
256 GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
257 } else if (!::testing::internal::AlwaysTrue()) { \
258 ::testing::internal::MakeDeathTestMatcher(regex_or_matcher); \
259 } else \
236260 ::testing::Message()
237261
238262 // A class representing the parsed contents of the
109109 const FilePath& base_name,
110110 const char* extension);
111111
112 // Returns true iff the path is "".
112 // Returns true if and only if the path is "".
113113 bool IsEmpty() const { return pathname_.empty(); }
114114
115115 // If input name has a trailing separator character, removes it and returns
5757 #include <map>
5858 #include <set>
5959 #include <string>
60 #include <type_traits>
6061 #include <vector>
6162
6263 #include "gtest/gtest-message.h"
7879 // Stringifies its argument.
7980 #define GTEST_STRINGIFY_(name) #name
8081
81 class ProtocolMessage;
8282 namespace proto2 { class Message; }
8383
8484 namespace testing {
9090 class Test; // Represents a test.
9191 class TestInfo; // Information about a test.
9292 class TestPartResult; // Result of a test part.
93 class UnitTest; // A collection of test cases.
93 class UnitTest; // A collection of test suites.
9494
9595 template <typename T>
9696 ::std::string PrintToString(const T& value);
105105 // stack trace.
106106 GTEST_API_ extern const char kStackTraceMarker[];
107107
108 // Two overloaded helpers for checking at compile time whether an
109 // expression is a null pointer literal (i.e. NULL or any 0-valued
110 // compile-time integral constant). Their return values have
111 // different sizes, so we can use sizeof() to test which version is
112 // picked by the compiler. These helpers have no implementations, as
113 // we only need their signatures.
114 //
115 // Given IsNullLiteralHelper(x), the compiler will pick the first
116 // version if x can be implicitly converted to Secret*, and pick the
117 // second version otherwise. Since Secret is a secret and incomplete
118 // type, the only expression a user can write that has type Secret* is
119 // a null pointer literal. Therefore, we know that x is a null
120 // pointer literal if and only if the first version is picked by the
121 // compiler.
122 char IsNullLiteralHelper(Secret* p);
123 char (&IsNullLiteralHelper(...))[2]; // NOLINT
124
125 // A compile-time bool constant that is true if and only if x is a
126 // null pointer literal (i.e. NULL or any 0-valued compile-time
127 // integral constant).
128 #ifdef GTEST_ELLIPSIS_NEEDS_POD_
129 // We lose support for NULL detection where the compiler doesn't like
130 // passing non-POD classes through ellipsis (...).
131 # define GTEST_IS_NULL_LITERAL_(x) false
132 #else
133 # define GTEST_IS_NULL_LITERAL_(x) \
134 (sizeof(::testing::internal::IsNullLiteralHelper(x)) == 1)
135 #endif // GTEST_ELLIPSIS_NEEDS_POD_
108 // An IgnoredValue object can be implicitly constructed from ANY value.
109 class IgnoredValue {
110 struct Sink {};
111 public:
112 // This constructor template allows any value to be implicitly
113 // converted to IgnoredValue. The object has no data member and
114 // doesn't try to remember anything about the argument. We
115 // deliberately omit the 'explicit' keyword in order to allow the
116 // conversion to be implicit.
117 // Disable the conversion if T already has a magical conversion operator.
118 // Otherwise we get ambiguity.
119 template <typename T,
120 typename std::enable_if<!std::is_convertible<T, Sink>::value,
121 int>::type = 0>
122 IgnoredValue(const T& /* ignored */) {} // NOLINT(runtime/explicit)
123 };
136124
137125 // Appends the user-supplied message to the Google-Test-generated message.
138126 GTEST_API_ std::string AppendUserMessage(
200188 // expected_value: "5"
201189 // actual_value: "6"
202190 //
203 // The ignoring_case parameter is true iff the assertion is a
191 // The ignoring_case parameter is true if and only if the assertion is a
204192 // *_STRCASEEQ*. When it's true, the string " (ignoring case)" will
205193 // be inserted into the message.
206194 GTEST_API_ AssertionResult EqFailure(const char* expected_expression,
329317 // Returns the sign bit of this number.
330318 Bits sign_bit() const { return kSignBitMask & u_.bits_; }
331319
332 // Returns true iff this is NAN (not a number).
320 // Returns true if and only if this is NAN (not a number).
333321 bool is_nan() const {
334322 // It's a NAN if the exponent bits are all ones and the fraction
335323 // bits are not entirely zeros.
336324 return (exponent_bits() == kExponentBitMask) && (fraction_bits() != 0);
337325 }
338326
339 // Returns true iff this number is at most kMaxUlps ULP's away from
340 // rhs. In particular, this function:
327 // Returns true if and only if this number is at most kMaxUlps ULP's away
328 // from rhs. In particular, this function:
341329 //
342330 // - returns false if either number is (or both are) NAN.
343331 // - treats really large numbers as almost equal to infinity.
408396 typedef FloatingPoint<double> Double;
409397
410398 // In order to catch the mistake of putting tests that use different
411 // test fixture classes in the same test case, we need to assign
399 // test fixture classes in the same test suite, we need to assign
412400 // unique IDs to fixture classes and compare them. The TypeId type is
413401 // used to hold such IDs. The user should treat TypeId as an opaque
414402 // type: the only operation allowed on TypeId values is to compare
468456 template <class TestClass>
469457 class TestFactoryImpl : public TestFactoryBase {
470458 public:
471 virtual Test* CreateTest() { return new TestClass; }
459 Test* CreateTest() override { return new TestClass; }
472460 };
473461
474462 #if GTEST_OS_WINDOWS
484472
485473 #endif // GTEST_OS_WINDOWS
486474
487 // Types of SetUpTestCase() and TearDownTestCase() functions.
488 typedef void (*SetUpTestCaseFunc)();
489 typedef void (*TearDownTestCaseFunc)();
475 // Types of SetUpTestSuite() and TearDownTestSuite() functions.
476 using SetUpTestSuiteFunc = void (*)();
477 using TearDownTestSuiteFunc = void (*)();
490478
491479 struct CodeLocation {
492480 CodeLocation(const std::string& a_file, int a_line)
496484 int line;
497485 };
498486
487 // Helper to identify which setup function for TestCase / TestSuite to call.
488 // Only one function is allowed, either TestCase or TestSute but not both.
489
490 // Utility functions to help SuiteApiResolver
491 using SetUpTearDownSuiteFuncType = void (*)();
492
493 inline SetUpTearDownSuiteFuncType GetNotDefaultOrNull(
494 SetUpTearDownSuiteFuncType a, SetUpTearDownSuiteFuncType def) {
495 return a == def ? nullptr : a;
496 }
497
498 template <typename T>
499 // Note that SuiteApiResolver inherits from T because
500 // SetUpTestSuite()/TearDownTestSuite() could be protected. Ths way
501 // SuiteApiResolver can access them.
502 struct SuiteApiResolver : T {
503 // testing::Test is only forward declared at this point. So we make it a
504 // dependend class for the compiler to be OK with it.
505 using Test =
506 typename std::conditional<sizeof(T) != 0, ::testing::Test, void>::type;
507
508 static SetUpTearDownSuiteFuncType GetSetUpCaseOrSuite(const char* filename,
509 int line_num) {
510 SetUpTearDownSuiteFuncType test_case_fp =
511 GetNotDefaultOrNull(&T::SetUpTestCase, &Test::SetUpTestCase);
512 SetUpTearDownSuiteFuncType test_suite_fp =
513 GetNotDefaultOrNull(&T::SetUpTestSuite, &Test::SetUpTestSuite);
514
515 GTEST_CHECK_(!test_case_fp || !test_suite_fp)
516 << "Test can not provide both SetUpTestSuite and SetUpTestCase, please "
517 "make sure there is only one present at "
518 << filename << ":" << line_num;
519
520 return test_case_fp != nullptr ? test_case_fp : test_suite_fp;
521 }
522
523 static SetUpTearDownSuiteFuncType GetTearDownCaseOrSuite(const char* filename,
524 int line_num) {
525 SetUpTearDownSuiteFuncType test_case_fp =
526 GetNotDefaultOrNull(&T::TearDownTestCase, &Test::TearDownTestCase);
527 SetUpTearDownSuiteFuncType test_suite_fp =
528 GetNotDefaultOrNull(&T::TearDownTestSuite, &Test::TearDownTestSuite);
529
530 GTEST_CHECK_(!test_case_fp || !test_suite_fp)
531 << "Test can not provide both TearDownTestSuite and TearDownTestCase,"
532 " please make sure there is only one present at"
533 << filename << ":" << line_num;
534
535 return test_case_fp != nullptr ? test_case_fp : test_suite_fp;
536 }
537 };
538
499539 // Creates a new TestInfo object and registers it with Google Test;
500540 // returns the created object.
501541 //
502542 // Arguments:
503543 //
504 // test_case_name: name of the test case
544 // test_suite_name: name of the test suite
505545 // name: name of the test
506546 // type_param the name of the test's type parameter, or NULL if
507547 // this is not a typed or a type-parameterized test.
509549 // or NULL if this is not a type-parameterized test.
510550 // code_location: code location where the test is defined
511551 // fixture_class_id: ID of the test fixture class
512 // set_up_tc: pointer to the function that sets up the test case
513 // tear_down_tc: pointer to the function that tears down the test case
552 // set_up_tc: pointer to the function that sets up the test suite
553 // tear_down_tc: pointer to the function that tears down the test suite
514554 // factory: pointer to the factory that creates a test object.
515555 // The newly created TestInfo instance will assume
516556 // ownership of the factory object.
517557 GTEST_API_ TestInfo* MakeAndRegisterTestInfo(
518 const char* test_case_name,
519 const char* name,
520 const char* type_param,
521 const char* value_param,
522 CodeLocation code_location,
523 TypeId fixture_class_id,
524 SetUpTestCaseFunc set_up_tc,
525 TearDownTestCaseFunc tear_down_tc,
526 TestFactoryBase* factory);
558 const char* test_suite_name, const char* name, const char* type_param,
559 const char* value_param, CodeLocation code_location,
560 TypeId fixture_class_id, SetUpTestSuiteFunc set_up_tc,
561 TearDownTestSuiteFunc tear_down_tc, TestFactoryBase* factory);
527562
528563 // If *pstr starts with the given prefix, modifies *pstr to be right
529564 // past the prefix and returns true; otherwise leaves *pstr unchanged
535570 GTEST_DISABLE_MSC_WARNINGS_PUSH_(4251 \
536571 /* class A needs to have dll-interface to be used by clients of class B */)
537572
538 // State of the definition of a type-parameterized test case.
539 class GTEST_API_ TypedTestCasePState {
540 public:
541 TypedTestCasePState() : registered_(false) {}
573 // State of the definition of a type-parameterized test suite.
574 class GTEST_API_ TypedTestSuitePState {
575 public:
576 TypedTestSuitePState() : registered_(false) {}
542577
543578 // Adds the given test name to defined_test_names_ and return true
544 // if the test case hasn't been registered; otherwise aborts the
579 // if the test suite hasn't been registered; otherwise aborts the
545580 // program.
546581 bool AddTestName(const char* file, int line, const char* case_name,
547582 const char* test_name) {
548583 if (registered_) {
549 fprintf(stderr, "%s Test %s must be defined before "
550 "REGISTER_TYPED_TEST_CASE_P(%s, ...).\n",
584 fprintf(stderr,
585 "%s Test %s must be defined before "
586 "REGISTER_TYPED_TEST_SUITE_P(%s, ...).\n",
551587 FormatFileLocation(file, line).c_str(), test_name, case_name);
552588 fflush(stderr);
553589 posix::Abort();
580616 RegisteredTestsMap registered_tests_;
581617 };
582618
619 // Legacy API is deprecated but still available
620 #ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_
621 using TypedTestCasePState = TypedTestSuitePState;
622 #endif // GTEST_REMOVE_LEGACY_TEST_CASEAPI_
623
583624 GTEST_DISABLE_MSC_WARNINGS_POP_() // 4251
584625
585626 // Skips to the first non-space char after the first comma in 'str';
586627 // returns NULL if no comma is found in 'str'.
587628 inline const char* SkipComma(const char* str) {
588629 const char* comma = strchr(str, ',');
589 if (comma == NULL) {
590 return NULL;
630 if (comma == nullptr) {
631 return nullptr;
591632 }
592633 while (IsSpace(*(++comma))) {}
593634 return comma;
597638 // the entire string if it contains no comma.
598639 inline std::string GetPrefixUntilComma(const char* str) {
599640 const char* comma = strchr(str, ',');
600 return comma == NULL ? str : std::string(str, comma);
641 return comma == nullptr ? str : std::string(str, comma);
601642 }
602643
603644 // Splits a given string on a given delimiter, populating a given
647688 class TypeParameterizedTest {
648689 public:
649690 // 'index' is the index of the test in the type list 'Types'
650 // specified in INSTANTIATE_TYPED_TEST_CASE_P(Prefix, TestCase,
691 // specified in INSTANTIATE_TYPED_TEST_SUITE_P(Prefix, TestSuite,
651692 // Types). Valid values for 'index' are [0, N - 1] where N is the
652693 // length of Types.
653694 static bool Register(const char* prefix, const CodeLocation& code_location,
662703 // list.
663704 MakeAndRegisterTestInfo(
664705 (std::string(prefix) + (prefix[0] == '\0' ? "" : "/") + case_name +
665 "/" + type_names[index])
706 "/" + type_names[static_cast<size_t>(index)])
666707 .c_str(),
667708 StripTrailingSpaces(GetPrefixUntilComma(test_names)).c_str(),
668709 GetTypeName<Type>().c_str(),
669 NULL, // No value parameter.
670 code_location, GetTypeId<FixtureClass>(), TestClass::SetUpTestCase,
671 TestClass::TearDownTestCase, new TestFactoryImpl<TestClass>);
710 nullptr, // No value parameter.
711 code_location, GetTypeId<FixtureClass>(),
712 SuiteApiResolver<TestClass>::GetSetUpCaseOrSuite(
713 code_location.file.c_str(), code_location.line),
714 SuiteApiResolver<TestClass>::GetTearDownCaseOrSuite(
715 code_location.file.c_str(), code_location.line),
716 new TestFactoryImpl<TestClass>);
672717
673718 // Next, recurses (at compile time) with the tail of the type list.
674719 return TypeParameterizedTest<Fixture, TestSel,
694739 }
695740 };
696741
697 // TypeParameterizedTestCase<Fixture, Tests, Types>::Register()
742 // TypeParameterizedTestSuite<Fixture, Tests, Types>::Register()
698743 // registers *all combinations* of 'Tests' and 'Types' with Google
699744 // Test. The return value is insignificant - we just need to return
700745 // something such that we can call this function in a namespace scope.
701746 template <GTEST_TEMPLATE_ Fixture, typename Tests, typename Types>
702 class TypeParameterizedTestCase {
747 class TypeParameterizedTestSuite {
703748 public:
704749 static bool Register(const char* prefix, CodeLocation code_location,
705 const TypedTestCasePState* state, const char* case_name,
750 const TypedTestSuitePState* state, const char* case_name,
706751 const char* test_names,
707752 const std::vector<std::string>& type_names =
708753 GenerateNames<DefaultNameGenerator, Types>()) {
725770 prefix, test_location, case_name, test_names, 0, type_names);
726771
727772 // Next, recurses (at compile time) with the tail of the test list.
728 return TypeParameterizedTestCase<Fixture, typename Tests::Tail,
729 Types>::Register(prefix, code_location,
730 state, case_name,
731 SkipComma(test_names),
732 type_names);
773 return TypeParameterizedTestSuite<Fixture, typename Tests::Tail,
774 Types>::Register(prefix, code_location,
775 state, case_name,
776 SkipComma(test_names),
777 type_names);
733778 }
734779 };
735780
736781 // The base case for the compile time recursion.
737782 template <GTEST_TEMPLATE_ Fixture, typename Types>
738 class TypeParameterizedTestCase<Fixture, Templates0, Types> {
783 class TypeParameterizedTestSuite<Fixture, Templates0, Types> {
739784 public:
740785 static bool Register(const char* /*prefix*/, const CodeLocation&,
741 const TypedTestCasePState* /*state*/,
786 const TypedTestSuitePState* /*state*/,
742787 const char* /*case_name*/, const char* /*test_names*/,
743788 const std::vector<std::string>& =
744789 std::vector<std::string>() /*type_names*/) {
801846 GTEST_DISALLOW_COPY_AND_ASSIGN_(Random);
802847 };
803848
804 // Defining a variable of type CompileAssertTypesEqual<T1, T2> will cause a
805 // compiler error iff T1 and T2 are different types.
806 template <typename T1, typename T2>
807 struct CompileAssertTypesEqual;
808
809 template <typename T>
810 struct CompileAssertTypesEqual<T, T> {
811 };
812
813 // Removes the reference from a type if it is a reference type,
814 // otherwise leaves it unchanged. This is the same as
815 // tr1::remove_reference, which is not widely available yet.
816 template <typename T>
817 struct RemoveReference { typedef T type; }; // NOLINT
818 template <typename T>
819 struct RemoveReference<T&> { typedef T type; }; // NOLINT
820
821 // A handy wrapper around RemoveReference that works when the argument
822 // T depends on template parameters.
823 #define GTEST_REMOVE_REFERENCE_(T) \
824 typename ::testing::internal::RemoveReference<T>::type
825
826 // Removes const from a type if it is a const type, otherwise leaves
827 // it unchanged. This is the same as tr1::remove_const, which is not
828 // widely available yet.
829 template <typename T>
830 struct RemoveConst { typedef T type; }; // NOLINT
831 template <typename T>
832 struct RemoveConst<const T> { typedef T type; }; // NOLINT
833
834 // MSVC 8.0, Sun C++, and IBM XL C++ have a bug which causes the above
835 // definition to fail to remove the const in 'const int[3]' and 'const
836 // char[3][4]'. The following specialization works around the bug.
837 template <typename T, size_t N>
838 struct RemoveConst<const T[N]> {
839 typedef typename RemoveConst<T>::type type[N];
840 };
841
842 #if defined(_MSC_VER) && _MSC_VER < 1400
843 // This is the only specialization that allows VC++ 7.1 to remove const in
844 // 'const int[3] and 'const int[3][4]'. However, it causes trouble with GCC
845 // and thus needs to be conditionally compiled.
846 template <typename T, size_t N>
847 struct RemoveConst<T[N]> {
848 typedef typename RemoveConst<T>::type type[N];
849 };
850 #endif
851
852 // A handy wrapper around RemoveConst that works when the argument
853 // T depends on template parameters.
854 #define GTEST_REMOVE_CONST_(T) \
855 typename ::testing::internal::RemoveConst<T>::type
856
857849 // Turns const U&, U&, const U, and U all into U.
858850 #define GTEST_REMOVE_REFERENCE_AND_CONST_(T) \
859 GTEST_REMOVE_CONST_(GTEST_REMOVE_REFERENCE_(T))
860
861 // ImplicitlyConvertible<From, To>::value is a compile-time bool
862 // constant that's true iff type From can be implicitly converted to
863 // type To.
864 template <typename From, typename To>
865 class ImplicitlyConvertible {
866 private:
867 // We need the following helper functions only for their types.
868 // They have no implementations.
869
870 // MakeFrom() is an expression whose type is From. We cannot simply
871 // use From(), as the type From may not have a public default
872 // constructor.
873 static typename AddReference<From>::type MakeFrom();
874
875 // These two functions are overloaded. Given an expression
876 // Helper(x), the compiler will pick the first version if x can be
877 // implicitly converted to type To; otherwise it will pick the
878 // second version.
879 //
880 // The first version returns a value of size 1, and the second
881 // version returns a value of size 2. Therefore, by checking the
882 // size of Helper(x), which can be done at compile time, we can tell
883 // which version of Helper() is used, and hence whether x can be
884 // implicitly converted to type To.
885 static char Helper(To);
886 static char (&Helper(...))[2]; // NOLINT
887
888 // We have to put the 'public' section after the 'private' section,
889 // or MSVC refuses to compile the code.
890 public:
891 #if defined(__BORLANDC__)
892 // C++Builder cannot use member overload resolution during template
893 // instantiation. The simplest workaround is to use its C++0x type traits
894 // functions (C++Builder 2009 and above only).
895 static const bool value = __is_convertible(From, To);
896 #else
897 // MSVC warns about implicitly converting from double to int for
898 // possible loss of data, so we need to temporarily disable the
899 // warning.
900 GTEST_DISABLE_MSC_WARNINGS_PUSH_(4244)
901 static const bool value =
902 sizeof(Helper(ImplicitlyConvertible::MakeFrom())) == 1;
903 GTEST_DISABLE_MSC_WARNINGS_POP_()
904 #endif // __BORLANDC__
905 };
906 template <typename From, typename To>
907 const bool ImplicitlyConvertible<From, To>::value;
851 typename std::remove_const<typename std::remove_reference<T>::type>::type
908852
909853 // IsAProtocolMessage<T>::value is a compile-time bool constant that's
910 // true iff T is type ProtocolMessage, proto2::Message, or a subclass
911 // of those.
854 // true if and only if T is type proto2::Message or a subclass of it.
912855 template <typename T>
913856 struct IsAProtocolMessage
914857 : public bool_constant<
915 ImplicitlyConvertible<const T*, const ::ProtocolMessage*>::value ||
916 ImplicitlyConvertible<const T*, const ::proto2::Message*>::value> {
917 };
858 std::is_convertible<const T*, const ::proto2::Message*>::value> {};
918859
919860 // When the compiler sees expression IsContainerTest<C>(0), if C is an
920861 // STL-style container class, the first overload of IsContainerTest
941882 // IsContainerTest(typename C::const_iterator*) and
942883 // IsContainerTest(...) doesn't work with Visual Age C++ and Sun C++.
943884 typedef int IsContainer;
944 #if GTEST_LANG_CXX11
945885 template <class C,
946886 class Iterator = decltype(::std::declval<const C&>().begin()),
947887 class = decltype(::std::declval<const C&>().end()),
951891 IsContainer IsContainerTest(int /* dummy */) {
952892 return 0;
953893 }
954 #else
955 template <class C>
956 IsContainer IsContainerTest(int /* dummy */,
957 typename C::iterator* /* it */ = NULL,
958 typename C::const_iterator* /* const_it */ = NULL) {
959 return 0;
960 }
961 #endif // GTEST_LANG_CXX11
962894
963895 typedef char IsNotContainer;
964896 template <class C>
979911 static char test(...);
980912
981913 public:
982 static const bool value = sizeof(test<T>(0, 0)) == sizeof(int);
914 static const bool value = sizeof(test<T>(nullptr, nullptr)) == sizeof(int);
983915 };
984916
985917 template <typename T>
986918 const bool IsHashTable<T>::value;
987919
988 template<typename T>
989 struct VoidT {
990 typedef void value_type;
991 };
992
993 template <typename T, typename = void>
994 struct HasValueType : false_type {};
995 template <typename T>
996 struct HasValueType<T, VoidT<typename T::value_type> > : true_type {
997 };
998
999920 template <typename C,
1000 bool = sizeof(IsContainerTest<C>(0)) == sizeof(IsContainer),
1001 bool = HasValueType<C>::value>
921 bool = sizeof(IsContainerTest<C>(0)) == sizeof(IsContainer)>
1002922 struct IsRecursiveContainerImpl;
1003923
1004 template <typename C, bool HV>
1005 struct IsRecursiveContainerImpl<C, false, HV> : public false_type {};
924 template <typename C>
925 struct IsRecursiveContainerImpl<C, false> : public std::false_type {};
1006926
1007927 // Since the IsRecursiveContainerImpl depends on the IsContainerTest we need to
1008928 // obey the same inconsistencies as the IsContainerTest, namely check if
1009929 // something is a container is relying on only const_iterator in C++11 and
1010930 // is relying on both const_iterator and iterator otherwise
1011931 template <typename C>
1012 struct IsRecursiveContainerImpl<C, true, false> : public false_type {};
1013
1014 template <typename C>
1015 struct IsRecursiveContainerImpl<C, true, true> {
1016 #if GTEST_LANG_CXX11
1017 typedef typename IteratorTraits<typename C::const_iterator>::value_type
1018 value_type;
1019 #else
1020 typedef typename IteratorTraits<typename C::iterator>::value_type value_type;
1021 #endif
1022 typedef is_same<value_type, C> type;
932 struct IsRecursiveContainerImpl<C, true> {
933 using value_type = decltype(*std::declval<typename C::const_iterator>());
934 using type =
935 std::is_same<typename std::remove_const<
936 typename std::remove_reference<value_type>::type>::type,
937 C>;
1023938 };
1024939
1025940 // IsRecursiveContainer<Type> is a unary compile-time predicate that
1030945 // boost::filesystem::path.
1031946 template <typename C>
1032947 struct IsRecursiveContainer : public IsRecursiveContainerImpl<C>::type {};
1033
1034 // EnableIf<condition>::type is void when 'Cond' is true, and
1035 // undefined when 'Cond' is false. To use SFINAE to make a function
1036 // overload only apply when a particular expression is true, add
1037 // "typename EnableIf<expression>::type* = 0" as the last parameter.
1038 template<bool> struct EnableIf;
1039 template<> struct EnableIf<true> { typedef void type; }; // NOLINT
1040948
1041949 // Utilities for native arrays.
1042950
11601068 }
11611069
11621070 private:
1163 enum {
1164 kCheckTypeIsNotConstOrAReference = StaticAssertTypeEqHelper<
1165 Element, GTEST_REMOVE_REFERENCE_AND_CONST_(Element)>::value
1166 };
1071 static_assert(!std::is_const<Element>::value, "Type must not be const");
1072 static_assert(!std::is_reference<Element>::value,
1073 "Type must not be a reference");
11671074
11681075 // Initializes this object with a copy of the input.
11691076 void InitCopy(const Element* array, size_t a_size) {
11881095 GTEST_DISALLOW_ASSIGN_(NativeArray);
11891096 };
11901097
1098 // Backport of std::index_sequence.
1099 template <size_t... Is>
1100 struct IndexSequence {
1101 using type = IndexSequence;
1102 };
1103
1104 // Double the IndexSequence, and one if plus_one is true.
1105 template <bool plus_one, typename T, size_t sizeofT>
1106 struct DoubleSequence;
1107 template <size_t... I, size_t sizeofT>
1108 struct DoubleSequence<true, IndexSequence<I...>, sizeofT> {
1109 using type = IndexSequence<I..., (sizeofT + I)..., 2 * sizeofT>;
1110 };
1111 template <size_t... I, size_t sizeofT>
1112 struct DoubleSequence<false, IndexSequence<I...>, sizeofT> {
1113 using type = IndexSequence<I..., (sizeofT + I)...>;
1114 };
1115
1116 // Backport of std::make_index_sequence.
1117 // It uses O(ln(N)) instantiation depth.
1118 template <size_t N>
1119 struct MakeIndexSequence
1120 : DoubleSequence<N % 2 == 1, typename MakeIndexSequence<N / 2>::type,
1121 N / 2>::type {};
1122
1123 template <>
1124 struct MakeIndexSequence<0> : IndexSequence<> {};
1125
1126 // FIXME: This implementation of ElemFromList is O(1) in instantiation depth,
1127 // but it is O(N^2) in total instantiations. Not sure if this is the best
1128 // tradeoff, as it will make it somewhat slow to compile.
1129 template <typename T, size_t, size_t>
1130 struct ElemFromListImpl {};
1131
1132 template <typename T, size_t I>
1133 struct ElemFromListImpl<T, I, I> {
1134 using type = T;
1135 };
1136
1137 // Get the Nth element from T...
1138 // It uses O(1) instantiation depth.
1139 template <size_t N, typename I, typename... T>
1140 struct ElemFromList;
1141
1142 template <size_t N, size_t... I, typename... T>
1143 struct ElemFromList<N, IndexSequence<I...>, T...>
1144 : ElemFromListImpl<T, N, I>... {};
1145
1146 template <typename... T>
1147 class FlatTuple;
1148
1149 template <typename Derived, size_t I>
1150 struct FlatTupleElemBase;
1151
1152 template <typename... T, size_t I>
1153 struct FlatTupleElemBase<FlatTuple<T...>, I> {
1154 using value_type =
1155 typename ElemFromList<I, typename MakeIndexSequence<sizeof...(T)>::type,
1156 T...>::type;
1157 FlatTupleElemBase() = default;
1158 explicit FlatTupleElemBase(value_type t) : value(std::move(t)) {}
1159 value_type value;
1160 };
1161
1162 template <typename Derived, typename Idx>
1163 struct FlatTupleBase;
1164
1165 template <size_t... Idx, typename... T>
1166 struct FlatTupleBase<FlatTuple<T...>, IndexSequence<Idx...>>
1167 : FlatTupleElemBase<FlatTuple<T...>, Idx>... {
1168 using Indices = IndexSequence<Idx...>;
1169 FlatTupleBase() = default;
1170 explicit FlatTupleBase(T... t)
1171 : FlatTupleElemBase<FlatTuple<T...>, Idx>(std::move(t))... {}
1172 };
1173
1174 // Analog to std::tuple but with different tradeoffs.
1175 // This class minimizes the template instantiation depth, thus allowing more
1176 // elements that std::tuple would. std::tuple has been seen to require an
1177 // instantiation depth of more than 10x the number of elements in some
1178 // implementations.
1179 // FlatTuple and ElemFromList are not recursive and have a fixed depth
1180 // regardless of T...
1181 // MakeIndexSequence, on the other hand, it is recursive but with an
1182 // instantiation depth of O(ln(N)).
1183 template <typename... T>
1184 class FlatTuple
1185 : private FlatTupleBase<FlatTuple<T...>,
1186 typename MakeIndexSequence<sizeof...(T)>::type> {
1187 using Indices = typename FlatTuple::FlatTupleBase::Indices;
1188
1189 public:
1190 FlatTuple() = default;
1191 explicit FlatTuple(T... t) : FlatTuple::FlatTupleBase(std::move(t)...) {}
1192
1193 template <size_t I>
1194 const typename ElemFromList<I, Indices, T...>::type& Get() const {
1195 return static_cast<const FlatTupleElemBase<FlatTuple, I>*>(this)->value;
1196 }
1197
1198 template <size_t I>
1199 typename ElemFromList<I, Indices, T...>::type& Get() {
1200 return static_cast<FlatTupleElemBase<FlatTuple, I>*>(this)->value;
1201 }
1202 };
1203
1204 // Utility functions to be called with static_assert to induce deprecation
1205 // warnings.
1206 GTEST_INTERNAL_DEPRECATED(
1207 "INSTANTIATE_TEST_CASE_P is deprecated, please use "
1208 "INSTANTIATE_TEST_SUITE_P")
1209 constexpr bool InstantiateTestCase_P_IsDeprecated() { return true; }
1210
1211 GTEST_INTERNAL_DEPRECATED(
1212 "TYPED_TEST_CASE_P is deprecated, please use "
1213 "TYPED_TEST_SUITE_P")
1214 constexpr bool TypedTestCase_P_IsDeprecated() { return true; }
1215
1216 GTEST_INTERNAL_DEPRECATED(
1217 "TYPED_TEST_CASE is deprecated, please use "
1218 "TYPED_TEST_SUITE")
1219 constexpr bool TypedTestCaseIsDeprecated() { return true; }
1220
1221 GTEST_INTERNAL_DEPRECATED(
1222 "REGISTER_TYPED_TEST_CASE_P is deprecated, please use "
1223 "REGISTER_TYPED_TEST_SUITE_P")
1224 constexpr bool RegisterTypedTestCase_P_IsDeprecated() { return true; }
1225
1226 GTEST_INTERNAL_DEPRECATED(
1227 "INSTANTIATE_TYPED_TEST_CASE_P is deprecated, please use "
1228 "INSTANTIATE_TYPED_TEST_SUITE_P")
1229 constexpr bool InstantiateTypedTestCase_P_IsDeprecated() { return true; }
1230
11911231 } // namespace internal
11921232 } // namespace testing
11931233
12071247 #define GTEST_SUCCESS_(message) \
12081248 GTEST_MESSAGE_(message, ::testing::TestPartResult::kSuccess)
12091249
1210 // Suppress MSVC warning 4702 (unreachable code) for the code following
1250 #define GTEST_SKIP_(message) \
1251 return GTEST_MESSAGE_(message, ::testing::TestPartResult::kSkip)
1252
1253 // Suppress MSVC warning 4072 (unreachable code) for the code following
12111254 // statement if it returns or throws (or doesn't return or throw in some
12121255 // situations).
12131256 #define GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement) \
12991342 " Actual: it does.")
13001343
13011344 // Expands to the name of the class that implements the given test.
1302 #define GTEST_TEST_CLASS_NAME_(test_case_name, test_name) \
1303 test_case_name##_##test_name##_Test
1345 #define GTEST_TEST_CLASS_NAME_(test_suite_name, test_name) \
1346 test_suite_name##_##test_name##_Test
13041347
13051348 // Helper macro for defining tests.
1306 #define GTEST_TEST_(test_case_name, test_name, parent_class, parent_id)\
1307 class GTEST_TEST_CLASS_NAME_(test_case_name, test_name) : public parent_class {\
1308 public:\
1309 GTEST_TEST_CLASS_NAME_(test_case_name, test_name)() {}\
1310 private:\
1311 virtual void TestBody();\
1312 static ::testing::TestInfo* const test_info_ GTEST_ATTRIBUTE_UNUSED_;\
1313 GTEST_DISALLOW_COPY_AND_ASSIGN_(\
1314 GTEST_TEST_CLASS_NAME_(test_case_name, test_name));\
1315 };\
1316 \
1317 ::testing::TestInfo* const GTEST_TEST_CLASS_NAME_(test_case_name, test_name)\
1318 ::test_info_ =\
1319 ::testing::internal::MakeAndRegisterTestInfo(\
1320 #test_case_name, #test_name, NULL, NULL, \
1321 ::testing::internal::CodeLocation(__FILE__, __LINE__), \
1322 (parent_id), \
1323 parent_class::SetUpTestCase, \
1324 parent_class::TearDownTestCase, \
1325 new ::testing::internal::TestFactoryImpl<\
1326 GTEST_TEST_CLASS_NAME_(test_case_name, test_name)>);\
1327 void GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::TestBody()
1349 #define GTEST_TEST_(test_suite_name, test_name, parent_class, parent_id) \
1350 static_assert(sizeof(GTEST_STRINGIFY_(test_suite_name)) > 1, \
1351 "test_suite_name must not be empty"); \
1352 static_assert(sizeof(GTEST_STRINGIFY_(test_name)) > 1, \
1353 "test_name must not be empty"); \
1354 class GTEST_TEST_CLASS_NAME_(test_suite_name, test_name) \
1355 : public parent_class { \
1356 public: \
1357 GTEST_TEST_CLASS_NAME_(test_suite_name, test_name)() {} \
1358 \
1359 private: \
1360 virtual void TestBody(); \
1361 static ::testing::TestInfo* const test_info_ GTEST_ATTRIBUTE_UNUSED_; \
1362 GTEST_DISALLOW_COPY_AND_ASSIGN_(GTEST_TEST_CLASS_NAME_(test_suite_name, \
1363 test_name)); \
1364 }; \
1365 \
1366 ::testing::TestInfo* const GTEST_TEST_CLASS_NAME_(test_suite_name, \
1367 test_name)::test_info_ = \
1368 ::testing::internal::MakeAndRegisterTestInfo( \
1369 #test_suite_name, #test_name, nullptr, nullptr, \
1370 ::testing::internal::CodeLocation(__FILE__, __LINE__), (parent_id), \
1371 ::testing::internal::SuiteApiResolver< \
1372 parent_class>::GetSetUpCaseOrSuite(__FILE__, __LINE__), \
1373 ::testing::internal::SuiteApiResolver< \
1374 parent_class>::GetTearDownCaseOrSuite(__FILE__, __LINE__), \
1375 new ::testing::internal::TestFactoryImpl<GTEST_TEST_CLASS_NAME_( \
1376 test_suite_name, test_name)>); \
1377 void GTEST_TEST_CLASS_NAME_(test_suite_name, test_name)::TestBody()
13281378
13291379 #endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_INTERNAL_H_
3636
3737 #include <ctype.h>
3838
39 #include <cassert>
3940 #include <iterator>
41 #include <memory>
4042 #include <set>
43 #include <tuple>
4144 #include <utility>
4245 #include <vector>
4346
4447 #include "gtest/internal/gtest-internal.h"
45 #include "gtest/internal/gtest-linked_ptr.h"
4648 #include "gtest/internal/gtest-port.h"
4749 #include "gtest/gtest-printers.h"
4850
4951 namespace testing {
50
5152 // Input to a parameterized test name generator, describing a test parameter.
5253 // Consists of the parameter value and the integer parameter index.
5354 template <class ParamType>
7172 namespace internal {
7273
7374 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
74 //
75 // Utility Functions
76
7577 // Outputs a message explaining invalid registration of different
76 // fixture class for the same test case. This may happen when
78 // fixture class for the same test suite. This may happen when
7779 // TEST_P macro is used to define two tests with the same name
7880 // but in different namespaces.
79 GTEST_API_ void ReportInvalidTestCaseType(const char* test_case_name,
80 CodeLocation code_location);
81 GTEST_API_ void ReportInvalidTestSuiteType(const char* test_suite_name,
82 CodeLocation code_location);
8183
8284 template <typename> class ParamGeneratorInterface;
8385 template <typename> class ParamGenerator;
152154 private:
153155 friend class ParamGenerator<T>;
154156 explicit ParamIterator(ParamIteratorInterface<T>* impl) : impl_(impl) {}
155 scoped_ptr<ParamIteratorInterface<T> > impl_;
157 std::unique_ptr<ParamIteratorInterface<T> > impl_;
156158 };
157159
158160 // ParamGeneratorInterface<T> is the binary interface to access generators
191193 iterator end() const { return iterator(impl_->End()); }
192194
193195 private:
194 linked_ptr<const ParamGeneratorInterface<T> > impl_;
196 std::shared_ptr<const ParamGeneratorInterface<T> > impl_;
195197 };
196198
197199 // Generates values from a range of two comparable values. Can be used to
204206 RangeGenerator(T begin, T end, IncrementT step)
205207 : begin_(begin), end_(end),
206208 step_(step), end_index_(CalculateEndIndex(begin, end, step)) {}
207 virtual ~RangeGenerator() {}
208
209 virtual ParamIteratorInterface<T>* Begin() const {
209 ~RangeGenerator() override {}
210
211 ParamIteratorInterface<T>* Begin() const override {
210212 return new Iterator(this, begin_, 0, step_);
211213 }
212 virtual ParamIteratorInterface<T>* End() const {
214 ParamIteratorInterface<T>* End() const override {
213215 return new Iterator(this, end_, end_index_, step_);
214216 }
215217
219221 Iterator(const ParamGeneratorInterface<T>* base, T value, int index,
220222 IncrementT step)
221223 : base_(base), value_(value), index_(index), step_(step) {}
222 virtual ~Iterator() {}
223
224 virtual const ParamGeneratorInterface<T>* BaseGenerator() const {
224 ~Iterator() override {}
225
226 const ParamGeneratorInterface<T>* BaseGenerator() const override {
225227 return base_;
226228 }
227 virtual void Advance() {
229 void Advance() override {
228230 value_ = static_cast<T>(value_ + step_);
229231 index_++;
230232 }
231 virtual ParamIteratorInterface<T>* Clone() const {
233 ParamIteratorInterface<T>* Clone() const override {
232234 return new Iterator(*this);
233235 }
234 virtual const T* Current() const { return &value_; }
235 virtual bool Equals(const ParamIteratorInterface<T>& other) const {
236 const T* Current() const override { return &value_; }
237 bool Equals(const ParamIteratorInterface<T>& other) const override {
236238 // Having the same base generator guarantees that the other
237239 // iterator is of the same type and we can downcast.
238240 GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
289291 template <typename ForwardIterator>
290292 ValuesInIteratorRangeGenerator(ForwardIterator begin, ForwardIterator end)
291293 : container_(begin, end) {}
292 virtual ~ValuesInIteratorRangeGenerator() {}
293
294 virtual ParamIteratorInterface<T>* Begin() const {
294 ~ValuesInIteratorRangeGenerator() override {}
295
296 ParamIteratorInterface<T>* Begin() const override {
295297 return new Iterator(this, container_.begin());
296298 }
297 virtual ParamIteratorInterface<T>* End() const {
299 ParamIteratorInterface<T>* End() const override {
298300 return new Iterator(this, container_.end());
299301 }
300302
306308 Iterator(const ParamGeneratorInterface<T>* base,
307309 typename ContainerType::const_iterator iterator)
308310 : base_(base), iterator_(iterator) {}
309 virtual ~Iterator() {}
310
311 virtual const ParamGeneratorInterface<T>* BaseGenerator() const {
311 ~Iterator() override {}
312
313 const ParamGeneratorInterface<T>* BaseGenerator() const override {
312314 return base_;
313315 }
314 virtual void Advance() {
316 void Advance() override {
315317 ++iterator_;
316318 value_.reset();
317319 }
318 virtual ParamIteratorInterface<T>* Clone() const {
320 ParamIteratorInterface<T>* Clone() const override {
319321 return new Iterator(*this);
320322 }
321323 // We need to use cached value referenced by iterator_ because *iterator_
325327 // can advance iterator_ beyond the end of the range, and we cannot
326328 // detect that fact. The client code, on the other hand, is
327329 // responsible for not calling Current() on an out-of-range iterator.
328 virtual const T* Current() const {
329 if (value_.get() == NULL)
330 value_.reset(new T(*iterator_));
330 const T* Current() const override {
331 if (value_.get() == nullptr) value_.reset(new T(*iterator_));
331332 return value_.get();
332333 }
333 virtual bool Equals(const ParamIteratorInterface<T>& other) const {
334 bool Equals(const ParamIteratorInterface<T>& other) const override {
334335 // Having the same base generator guarantees that the other
335336 // iterator is of the same type and we can downcast.
336337 GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
353354 // A cached value of *iterator_. We keep it here to allow access by
354355 // pointer in the wrapping iterator's operator->().
355356 // value_ needs to be mutable to be accessed in Current().
356 // Use of scoped_ptr helps manage cached value's lifetime,
357 // Use of std::unique_ptr helps manage cached value's lifetime,
357358 // which is bound by the lifespan of the iterator itself.
358 mutable scoped_ptr<const T> value_;
359 mutable std::unique_ptr<const T> value_;
359360 }; // class ValuesInIteratorRangeGenerator::Iterator
360361
361362 // No implementation - assignment is unsupported.
375376 return name_stream.GetString();
376377 }
377378
378 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
379 //
380 // Parameterized test name overload helpers, which help the
381 // INSTANTIATE_TEST_CASE_P macro choose between the default parameterized
382 // test name generator and user param name generator.
383 template <class ParamType, class ParamNameGenFunctor>
384 ParamNameGenFunctor GetParamNameGen(ParamNameGenFunctor func) {
385 return func;
379 template <typename T = int>
380 void TestNotEmpty() {
381 static_assert(sizeof(T) == 0, "Empty arguments are not allowed.");
386382 }
387
388 template <class ParamType>
389 struct ParamNameGenFunc {
390 typedef std::string Type(const TestParamInfo<ParamType>&);
391 };
392
393 template <class ParamType>
394 typename ParamNameGenFunc<ParamType>::Type *GetParamNameGen() {
395 return DefaultParamName;
396 }
383 template <typename T = int>
384 void TestNotEmpty(const T&) {}
397385
398386 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
399387 //
405393 typedef typename TestClass::ParamType ParamType;
406394 explicit ParameterizedTestFactory(ParamType parameter) :
407395 parameter_(parameter) {}
408 virtual Test* CreateTest() {
396 Test* CreateTest() override {
409397 TestClass::SetParam(&parameter_);
410398 return new TestClass();
411399 }
433421 // TestMetaFactory creates test factories for passing into
434422 // MakeAndRegisterTestInfo function. Since MakeAndRegisterTestInfo receives
435423 // ownership of test factory pointer, same factory object cannot be passed
436 // into that method twice. But ParameterizedTestCaseInfo is going to call
424 // into that method twice. But ParameterizedTestSuiteInfo is going to call
437425 // it for each Test/Parameter value combination. Thus it needs meta factory
438426 // creator class.
439 template <class TestCase>
427 template <class TestSuite>
440428 class TestMetaFactory
441 : public TestMetaFactoryBase<typename TestCase::ParamType> {
442 public:
443 typedef typename TestCase::ParamType ParamType;
429 : public TestMetaFactoryBase<typename TestSuite::ParamType> {
430 public:
431 using ParamType = typename TestSuite::ParamType;
444432
445433 TestMetaFactory() {}
446434
447 virtual TestFactoryBase* CreateTestFactory(ParamType parameter) {
448 return new ParameterizedTestFactory<TestCase>(parameter);
435 TestFactoryBase* CreateTestFactory(ParamType parameter) override {
436 return new ParameterizedTestFactory<TestSuite>(parameter);
449437 }
450438
451439 private:
454442
455443 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
456444 //
457 // ParameterizedTestCaseInfoBase is a generic interface
458 // to ParameterizedTestCaseInfo classes. ParameterizedTestCaseInfoBase
445 // ParameterizedTestSuiteInfoBase is a generic interface
446 // to ParameterizedTestSuiteInfo classes. ParameterizedTestSuiteInfoBase
459447 // accumulates test information provided by TEST_P macro invocations
460 // and generators provided by INSTANTIATE_TEST_CASE_P macro invocations
448 // and generators provided by INSTANTIATE_TEST_SUITE_P macro invocations
461449 // and uses that information to register all resulting test instances
462 // in RegisterTests method. The ParameterizeTestCaseRegistry class holds
463 // a collection of pointers to the ParameterizedTestCaseInfo objects
450 // in RegisterTests method. The ParameterizeTestSuiteRegistry class holds
451 // a collection of pointers to the ParameterizedTestSuiteInfo objects
464452 // and calls RegisterTests() on each of them when asked.
465 class ParameterizedTestCaseInfoBase {
466 public:
467 virtual ~ParameterizedTestCaseInfoBase() {}
468
469 // Base part of test case name for display purposes.
470 virtual const std::string& GetTestCaseName() const = 0;
453 class ParameterizedTestSuiteInfoBase {
454 public:
455 virtual ~ParameterizedTestSuiteInfoBase() {}
456
457 // Base part of test suite name for display purposes.
458 virtual const std::string& GetTestSuiteName() const = 0;
471459 // Test case id to verify identity.
472 virtual TypeId GetTestCaseTypeId() const = 0;
460 virtual TypeId GetTestSuiteTypeId() const = 0;
473461 // UnitTest class invokes this method to register tests in this
474 // test case right before running them in RUN_ALL_TESTS macro.
475 // This method should not be called more then once on any single
476 // instance of a ParameterizedTestCaseInfoBase derived class.
462 // test suite right before running them in RUN_ALL_TESTS macro.
463 // This method should not be called more than once on any single
464 // instance of a ParameterizedTestSuiteInfoBase derived class.
477465 virtual void RegisterTests() = 0;
478466
479467 protected:
480 ParameterizedTestCaseInfoBase() {}
481
482 private:
483 GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestCaseInfoBase);
468 ParameterizedTestSuiteInfoBase() {}
469
470 private:
471 GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestSuiteInfoBase);
484472 };
485473
486474 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
487475 //
488 // ParameterizedTestCaseInfo accumulates tests obtained from TEST_P
489 // macro invocations for a particular test case and generators
490 // obtained from INSTANTIATE_TEST_CASE_P macro invocations for that
491 // test case. It registers tests with all values generated by all
476 // ParameterizedTestSuiteInfo accumulates tests obtained from TEST_P
477 // macro invocations for a particular test suite and generators
478 // obtained from INSTANTIATE_TEST_SUITE_P macro invocations for that
479 // test suite. It registers tests with all values generated by all
492480 // generators when asked.
493 template <class TestCase>
494 class ParameterizedTestCaseInfo : public ParameterizedTestCaseInfoBase {
481 template <class TestSuite>
482 class ParameterizedTestSuiteInfo : public ParameterizedTestSuiteInfoBase {
495483 public:
496484 // ParamType and GeneratorCreationFunc are private types but are required
497485 // for declarations of public methods AddTestPattern() and
498 // AddTestCaseInstantiation().
499 typedef typename TestCase::ParamType ParamType;
486 // AddTestSuiteInstantiation().
487 using ParamType = typename TestSuite::ParamType;
500488 // A function that returns an instance of appropriate generator type.
501489 typedef ParamGenerator<ParamType>(GeneratorCreationFunc)();
502 typedef typename ParamNameGenFunc<ParamType>::Type ParamNameGeneratorFunc;
503
504 explicit ParameterizedTestCaseInfo(
505 const char* name, CodeLocation code_location)
506 : test_case_name_(name), code_location_(code_location) {}
490 using ParamNameGeneratorFunc = std::string(const TestParamInfo<ParamType>&);
491
492 explicit ParameterizedTestSuiteInfo(const char* name,
493 CodeLocation code_location)
494 : test_suite_name_(name), code_location_(code_location) {}
507495
508496 // Test case base name for display purposes.
509 virtual const std::string& GetTestCaseName() const { return test_case_name_; }
497 const std::string& GetTestSuiteName() const override {
498 return test_suite_name_;
499 }
510500 // Test case id to verify identity.
511 virtual TypeId GetTestCaseTypeId() const { return GetTypeId<TestCase>(); }
501 TypeId GetTestSuiteTypeId() const override { return GetTypeId<TestSuite>(); }
512502 // TEST_P macro uses AddTestPattern() to record information
513503 // about a single test in a LocalTestInfo structure.
514 // test_case_name is the base name of the test case (without invocation
504 // test_suite_name is the base name of the test suite (without invocation
515505 // prefix). test_base_name is the name of an individual test without
516506 // parameter index. For the test SequenceA/FooTest.DoBar/1 FooTest is
517 // test case base name and DoBar is test base name.
518 void AddTestPattern(const char* test_case_name,
519 const char* test_base_name,
507 // test suite base name and DoBar is test base name.
508 void AddTestPattern(const char* test_suite_name, const char* test_base_name,
520509 TestMetaFactoryBase<ParamType>* meta_factory) {
521 tests_.push_back(linked_ptr<TestInfo>(new TestInfo(test_case_name,
522 test_base_name,
523 meta_factory)));
524 }
525 // INSTANTIATE_TEST_CASE_P macro uses AddGenerator() to record information
510 tests_.push_back(std::shared_ptr<TestInfo>(
511 new TestInfo(test_suite_name, test_base_name, meta_factory)));
512 }
513 // INSTANTIATE_TEST_SUITE_P macro uses AddGenerator() to record information
526514 // about a generator.
527 int AddTestCaseInstantiation(const std::string& instantiation_name,
528 GeneratorCreationFunc* func,
529 ParamNameGeneratorFunc* name_func,
530 const char* file, int line) {
515 int AddTestSuiteInstantiation(const std::string& instantiation_name,
516 GeneratorCreationFunc* func,
517 ParamNameGeneratorFunc* name_func,
518 const char* file, int line) {
531519 instantiations_.push_back(
532520 InstantiationInfo(instantiation_name, func, name_func, file, line));
533521 return 0; // Return value used only to run this method in namespace scope.
534522 }
535 // UnitTest class invokes this method to register tests in this test case
536 // test cases right before running tests in RUN_ALL_TESTS macro.
537 // This method should not be called more then once on any single
538 // instance of a ParameterizedTestCaseInfoBase derived class.
539 // UnitTest has a guard to prevent from calling this method more then once.
540 virtual void RegisterTests() {
523 // UnitTest class invokes this method to register tests in this test suite
524 // test suites right before running tests in RUN_ALL_TESTS macro.
525 // This method should not be called more than once on any single
526 // instance of a ParameterizedTestSuiteInfoBase derived class.
527 // UnitTest has a guard to prevent from calling this method more than once.
528 void RegisterTests() override {
541529 for (typename TestInfoContainer::iterator test_it = tests_.begin();
542530 test_it != tests_.end(); ++test_it) {
543 linked_ptr<TestInfo> test_info = *test_it;
531 std::shared_ptr<TestInfo> test_info = *test_it;
544532 for (typename InstantiationContainer::iterator gen_it =
545533 instantiations_.begin(); gen_it != instantiations_.end();
546534 ++gen_it) {
550538 const char* file = gen_it->file;
551539 int line = gen_it->line;
552540
553 std::string test_case_name;
541 std::string test_suite_name;
554542 if ( !instantiation_name.empty() )
555 test_case_name = instantiation_name + "/";
556 test_case_name += test_info->test_case_base_name;
543 test_suite_name = instantiation_name + "/";
544 test_suite_name += test_info->test_suite_base_name;
557545
558546 size_t i = 0;
559547 std::set<std::string> test_param_names;
576564
577565 test_param_names.insert(param_name);
578566
579 test_name_stream << test_info->test_base_name << "/" << param_name;
567 if (!test_info->test_base_name.empty()) {
568 test_name_stream << test_info->test_base_name << "/";
569 }
570 test_name_stream << param_name;
580571 MakeAndRegisterTestInfo(
581 test_case_name.c_str(),
582 test_name_stream.GetString().c_str(),
583 NULL, // No type parameter.
584 PrintToString(*param_it).c_str(),
585 code_location_,
586 GetTestCaseTypeId(),
587 TestCase::SetUpTestCase,
588 TestCase::TearDownTestCase,
572 test_suite_name.c_str(), test_name_stream.GetString().c_str(),
573 nullptr, // No type parameter.
574 PrintToString(*param_it).c_str(), code_location_,
575 GetTestSuiteTypeId(),
576 SuiteApiResolver<TestSuite>::GetSetUpCaseOrSuite(file, line),
577 SuiteApiResolver<TestSuite>::GetTearDownCaseOrSuite(file, line),
589578 test_info->test_meta_factory->CreateTestFactory(*param_it));
590579 } // for param_it
591580 } // for gen_it
592581 } // for test_it
593 } // RegisterTests
582 } // RegisterTests
594583
595584 private:
596585 // LocalTestInfo structure keeps information about a single test registered
597586 // with TEST_P macro.
598587 struct TestInfo {
599 TestInfo(const char* a_test_case_base_name,
600 const char* a_test_base_name,
601 TestMetaFactoryBase<ParamType>* a_test_meta_factory) :
602 test_case_base_name(a_test_case_base_name),
603 test_base_name(a_test_base_name),
604 test_meta_factory(a_test_meta_factory) {}
605
606 const std::string test_case_base_name;
588 TestInfo(const char* a_test_suite_base_name, const char* a_test_base_name,
589 TestMetaFactoryBase<ParamType>* a_test_meta_factory)
590 : test_suite_base_name(a_test_suite_base_name),
591 test_base_name(a_test_base_name),
592 test_meta_factory(a_test_meta_factory) {}
593
594 const std::string test_suite_base_name;
607595 const std::string test_base_name;
608 const scoped_ptr<TestMetaFactoryBase<ParamType> > test_meta_factory;
596 const std::unique_ptr<TestMetaFactoryBase<ParamType> > test_meta_factory;
609597 };
610 typedef ::std::vector<linked_ptr<TestInfo> > TestInfoContainer;
611 // Records data received from INSTANTIATE_TEST_CASE_P macros:
598 using TestInfoContainer = ::std::vector<std::shared_ptr<TestInfo> >;
599 // Records data received from INSTANTIATE_TEST_SUITE_P macros:
612600 // <Instantiation name, Sequence generator creation function,
613601 // Name generator function, Source file, Source line>
614602 struct InstantiationInfo {
645633 return true;
646634 }
647635
648 const std::string test_case_name_;
636 const std::string test_suite_name_;
649637 CodeLocation code_location_;
650638 TestInfoContainer tests_;
651639 InstantiationContainer instantiations_;
652640
653 GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestCaseInfo);
654 }; // class ParameterizedTestCaseInfo
641 GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestSuiteInfo);
642 }; // class ParameterizedTestSuiteInfo
643
644 // Legacy API is deprecated but still available
645 #ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_
646 template <class TestCase>
647 using ParameterizedTestCaseInfo = ParameterizedTestSuiteInfo<TestCase>;
648 #endif // GTEST_REMOVE_LEGACY_TEST_CASEAPI_
655649
656650 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
657651 //
658 // ParameterizedTestCaseRegistry contains a map of ParameterizedTestCaseInfoBase
659 // classes accessed by test case names. TEST_P and INSTANTIATE_TEST_CASE_P
660 // macros use it to locate their corresponding ParameterizedTestCaseInfo
661 // descriptors.
662 class ParameterizedTestCaseRegistry {
663 public:
664 ParameterizedTestCaseRegistry() {}
665 ~ParameterizedTestCaseRegistry() {
666 for (TestCaseInfoContainer::iterator it = test_case_infos_.begin();
667 it != test_case_infos_.end(); ++it) {
668 delete *it;
652 // ParameterizedTestSuiteRegistry contains a map of
653 // ParameterizedTestSuiteInfoBase classes accessed by test suite names. TEST_P
654 // and INSTANTIATE_TEST_SUITE_P macros use it to locate their corresponding
655 // ParameterizedTestSuiteInfo descriptors.
656 class ParameterizedTestSuiteRegistry {
657 public:
658 ParameterizedTestSuiteRegistry() {}
659 ~ParameterizedTestSuiteRegistry() {
660 for (auto& test_suite_info : test_suite_infos_) {
661 delete test_suite_info;
669662 }
670663 }
671664
672665 // Looks up or creates and returns a structure containing information about
673 // tests and instantiations of a particular test case.
674 template <class TestCase>
675 ParameterizedTestCaseInfo<TestCase>* GetTestCasePatternHolder(
676 const char* test_case_name,
677 CodeLocation code_location) {
678 ParameterizedTestCaseInfo<TestCase>* typed_test_info = NULL;
679 for (TestCaseInfoContainer::iterator it = test_case_infos_.begin();
680 it != test_case_infos_.end(); ++it) {
681 if ((*it)->GetTestCaseName() == test_case_name) {
682 if ((*it)->GetTestCaseTypeId() != GetTypeId<TestCase>()) {
666 // tests and instantiations of a particular test suite.
667 template <class TestSuite>
668 ParameterizedTestSuiteInfo<TestSuite>* GetTestSuitePatternHolder(
669 const char* test_suite_name, CodeLocation code_location) {
670 ParameterizedTestSuiteInfo<TestSuite>* typed_test_info = nullptr;
671 for (auto& test_suite_info : test_suite_infos_) {
672 if (test_suite_info->GetTestSuiteName() == test_suite_name) {
673 if (test_suite_info->GetTestSuiteTypeId() != GetTypeId<TestSuite>()) {
683674 // Complain about incorrect usage of Google Test facilities
684675 // and terminate the program since we cannot guaranty correct
685 // test case setup and tear-down in this case.
686 ReportInvalidTestCaseType(test_case_name, code_location);
676 // test suite setup and tear-down in this case.
677 ReportInvalidTestSuiteType(test_suite_name, code_location);
687678 posix::Abort();
688679 } else {
689680 // At this point we are sure that the object we found is of the same
690681 // type we are looking for, so we downcast it to that type
691682 // without further checks.
692683 typed_test_info = CheckedDowncastToActualType<
693 ParameterizedTestCaseInfo<TestCase> >(*it);
684 ParameterizedTestSuiteInfo<TestSuite> >(test_suite_info);
694685 }
695686 break;
696687 }
697688 }
698 if (typed_test_info == NULL) {
699 typed_test_info = new ParameterizedTestCaseInfo<TestCase>(
700 test_case_name, code_location);
701 test_case_infos_.push_back(typed_test_info);
689 if (typed_test_info == nullptr) {
690 typed_test_info = new ParameterizedTestSuiteInfo<TestSuite>(
691 test_suite_name, code_location);
692 test_suite_infos_.push_back(typed_test_info);
702693 }
703694 return typed_test_info;
704695 }
705696 void RegisterTests() {
706 for (TestCaseInfoContainer::iterator it = test_case_infos_.begin();
707 it != test_case_infos_.end(); ++it) {
708 (*it)->RegisterTests();
709 }
710 }
711
712 private:
713 typedef ::std::vector<ParameterizedTestCaseInfoBase*> TestCaseInfoContainer;
714
715 TestCaseInfoContainer test_case_infos_;
716
717 GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestCaseRegistry);
697 for (auto& test_suite_info : test_suite_infos_) {
698 test_suite_info->RegisterTests();
699 }
700 }
701 // Legacy API is deprecated but still available
702 #ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_
703 template <class TestCase>
704 ParameterizedTestCaseInfo<TestCase>* GetTestCasePatternHolder(
705 const char* test_case_name, CodeLocation code_location) {
706 return GetTestSuitePatternHolder<TestCase>(test_case_name, code_location);
707 }
708
709 #endif // GTEST_REMOVE_LEGACY_TEST_CASEAPI_
710
711 private:
712 using TestSuiteInfoContainer = ::std::vector<ParameterizedTestSuiteInfoBase*>;
713
714 TestSuiteInfoContainer test_suite_infos_;
715
716 GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestSuiteRegistry);
717 };
718
719 } // namespace internal
720
721 // Forward declarations of ValuesIn(), which is implemented in
722 // include/gtest/gtest-param-test.h.
723 template <class Container>
724 internal::ParamGenerator<typename Container::value_type> ValuesIn(
725 const Container& container);
726
727 namespace internal {
728 // Used in the Values() function to provide polymorphic capabilities.
729
730 template <typename... Ts>
731 class ValueArray {
732 public:
733 ValueArray(Ts... v) : v_{std::move(v)...} {}
734
735 template <typename T>
736 operator ParamGenerator<T>() const { // NOLINT
737 return ValuesIn(MakeVector<T>(MakeIndexSequence<sizeof...(Ts)>()));
738 }
739
740 private:
741 template <typename T, size_t... I>
742 std::vector<T> MakeVector(IndexSequence<I...>) const {
743 return std::vector<T>{static_cast<T>(v_.template Get<I>())...};
744 }
745
746 FlatTuple<Ts...> v_;
747 };
748
749 template <typename... T>
750 class CartesianProductGenerator
751 : public ParamGeneratorInterface<::std::tuple<T...>> {
752 public:
753 typedef ::std::tuple<T...> ParamType;
754
755 CartesianProductGenerator(const std::tuple<ParamGenerator<T>...>& g)
756 : generators_(g) {}
757 ~CartesianProductGenerator() override {}
758
759 ParamIteratorInterface<ParamType>* Begin() const override {
760 return new Iterator(this, generators_, false);
761 }
762 ParamIteratorInterface<ParamType>* End() const override {
763 return new Iterator(this, generators_, true);
764 }
765
766 private:
767 template <class I>
768 class IteratorImpl;
769 template <size_t... I>
770 class IteratorImpl<IndexSequence<I...>>
771 : public ParamIteratorInterface<ParamType> {
772 public:
773 IteratorImpl(const ParamGeneratorInterface<ParamType>* base,
774 const std::tuple<ParamGenerator<T>...>& generators, bool is_end)
775 : base_(base),
776 begin_(std::get<I>(generators).begin()...),
777 end_(std::get<I>(generators).end()...),
778 current_(is_end ? end_ : begin_) {
779 ComputeCurrentValue();
780 }
781 ~IteratorImpl() override {}
782
783 const ParamGeneratorInterface<ParamType>* BaseGenerator() const override {
784 return base_;
785 }
786 // Advance should not be called on beyond-of-range iterators
787 // so no component iterators must be beyond end of range, either.
788 void Advance() override {
789 assert(!AtEnd());
790 // Advance the last iterator.
791 ++std::get<sizeof...(T) - 1>(current_);
792 // if that reaches end, propagate that up.
793 AdvanceIfEnd<sizeof...(T) - 1>();
794 ComputeCurrentValue();
795 }
796 ParamIteratorInterface<ParamType>* Clone() const override {
797 return new IteratorImpl(*this);
798 }
799
800 const ParamType* Current() const override { return current_value_.get(); }
801
802 bool Equals(const ParamIteratorInterface<ParamType>& other) const override {
803 // Having the same base generator guarantees that the other
804 // iterator is of the same type and we can downcast.
805 GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
806 << "The program attempted to compare iterators "
807 << "from different generators." << std::endl;
808 const IteratorImpl* typed_other =
809 CheckedDowncastToActualType<const IteratorImpl>(&other);
810
811 // We must report iterators equal if they both point beyond their
812 // respective ranges. That can happen in a variety of fashions,
813 // so we have to consult AtEnd().
814 if (AtEnd() && typed_other->AtEnd()) return true;
815
816 bool same = true;
817 bool dummy[] = {
818 (same = same && std::get<I>(current_) ==
819 std::get<I>(typed_other->current_))...};
820 (void)dummy;
821 return same;
822 }
823
824 private:
825 template <size_t ThisI>
826 void AdvanceIfEnd() {
827 if (std::get<ThisI>(current_) != std::get<ThisI>(end_)) return;
828
829 bool last = ThisI == 0;
830 if (last) {
831 // We are done. Nothing else to propagate.
832 return;
833 }
834
835 constexpr size_t NextI = ThisI - (ThisI != 0);
836 std::get<ThisI>(current_) = std::get<ThisI>(begin_);
837 ++std::get<NextI>(current_);
838 AdvanceIfEnd<NextI>();
839 }
840
841 void ComputeCurrentValue() {
842 if (!AtEnd())
843 current_value_ = std::make_shared<ParamType>(*std::get<I>(current_)...);
844 }
845 bool AtEnd() const {
846 bool at_end = false;
847 bool dummy[] = {
848 (at_end = at_end || std::get<I>(current_) == std::get<I>(end_))...};
849 (void)dummy;
850 return at_end;
851 }
852
853 const ParamGeneratorInterface<ParamType>* const base_;
854 std::tuple<typename ParamGenerator<T>::iterator...> begin_;
855 std::tuple<typename ParamGenerator<T>::iterator...> end_;
856 std::tuple<typename ParamGenerator<T>::iterator...> current_;
857 std::shared_ptr<ParamType> current_value_;
858 };
859
860 using Iterator = IteratorImpl<typename MakeIndexSequence<sizeof...(T)>::type>;
861
862 std::tuple<ParamGenerator<T>...> generators_;
863 };
864
865 template <class... Gen>
866 class CartesianProductHolder {
867 public:
868 CartesianProductHolder(const Gen&... g) : generators_(g...) {}
869 template <typename... T>
870 operator ParamGenerator<::std::tuple<T...>>() const {
871 return ParamGenerator<::std::tuple<T...>>(
872 new CartesianProductGenerator<T...>(generators_));
873 }
874
875 private:
876 std::tuple<Gen...> generators_;
718877 };
719878
720879 } // namespace internal
3737 // Determines the platform on which Google Test is compiled.
3838 #ifdef __CYGWIN__
3939 # define GTEST_OS_CYGWIN 1
40 #elif defined __SYMBIAN32__
41 # define GTEST_OS_SYMBIAN 1
40 # elif defined(__MINGW__) || defined(__MINGW32__) || defined(__MINGW64__)
41 # define GTEST_OS_WINDOWS_MINGW 1
42 # define GTEST_OS_WINDOWS 1
4243 #elif defined _WIN32
4344 # define GTEST_OS_WINDOWS 1
4445 # ifdef _WIN32_WCE
4546 # define GTEST_OS_WINDOWS_MOBILE 1
46 # elif defined(__MINGW__) || defined(__MINGW32__)
47 # define GTEST_OS_WINDOWS_MINGW 1
4847 # elif defined(WINAPI_FAMILY)
4948 # include <winapifamily.h>
5049 # if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
6463 # else
6564 # define GTEST_OS_WINDOWS_DESKTOP 1
6665 # endif // _WIN32_WCE
66 #elif defined __OS2__
67 # define GTEST_OS_OS2 1
6768 #elif defined __APPLE__
6869 # define GTEST_OS_MAC 1
6970 # if TARGET_OS_IPHONE
7071 # define GTEST_OS_IOS 1
7172 # endif
73 #elif defined __DragonFly__
74 # define GTEST_OS_DRAGONFLY 1
7275 #elif defined __FreeBSD__
7376 # define GTEST_OS_FREEBSD 1
7477 #elif defined __Fuchsia__
7578 # define GTEST_OS_FUCHSIA 1
79 #elif defined(__GLIBC__) && defined(__FreeBSD_kernel__)
80 # define GTEST_OS_GNU_KFREEBSD 1
7681 #elif defined __linux__
7782 # define GTEST_OS_LINUX 1
7883 # if defined __ANDROID__
9499 # define GTEST_OS_OPENBSD 1
95100 #elif defined __QNX__
96101 # define GTEST_OS_QNX 1
102 #elif defined(__HAIKU__)
103 #define GTEST_OS_HAIKU 1
97104 #endif // __CYGWIN__
98105
99106 #endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_ARCH_H_
7171 // is/isn't available.
7272 // GTEST_HAS_EXCEPTIONS - Define it to 1/0 to indicate that exceptions
7373 // are enabled.
74 // GTEST_HAS_GLOBAL_STRING - Define it to 1/0 to indicate that ::string
75 // is/isn't available
76 // GTEST_HAS_GLOBAL_WSTRING - Define it to 1/0 to indicate that ::wstring
77 // is/isn't available
7874 // GTEST_HAS_POSIX_RE - Define it to 1/0 to indicate that POSIX regular
7975 // expressions are/aren't available.
8076 // GTEST_HAS_PTHREAD - Define it to 1/0 to indicate that <pthread.h>
8480 // GTEST_HAS_STD_WSTRING - Define it to 1/0 to indicate that
8581 // std::wstring does/doesn't work (Google Test can
8682 // be used where std::wstring is unavailable).
87 // GTEST_HAS_TR1_TUPLE - Define it to 1/0 to indicate tr1::tuple
88 // is/isn't available.
8983 // GTEST_HAS_SEH - Define it to 1/0 to indicate whether the
9084 // compiler supports Microsoft's "Structured
9185 // Exception Handling".
9387 // - Define it to 1/0 to indicate whether the
9488 // platform supports I/O stream redirection using
9589 // dup() and dup2().
96 // GTEST_USE_OWN_TR1_TUPLE - Define it to 1/0 to indicate whether Google
97 // Test's own tr1 tuple implementation should be
98 // used. Unused when the user sets
99 // GTEST_HAS_TR1_TUPLE to 0.
100 // GTEST_LANG_CXX11 - Define it to 1/0 to indicate that Google Test
101 // is building in C++11/C++98 mode.
10290 // GTEST_LINKED_AS_SHARED_LIBRARY
10391 // - Define to 1 when compiling tests that use
10492 // Google Test as a shared library (known as
124112 //
125113 // GTEST_OS_AIX - IBM AIX
126114 // GTEST_OS_CYGWIN - Cygwin
115 // GTEST_OS_DRAGONFLY - DragonFlyBSD
127116 // GTEST_OS_FREEBSD - FreeBSD
128117 // GTEST_OS_FUCHSIA - Fuchsia
118 // GTEST_OS_GNU_KFREEBSD - GNU/kFreeBSD
119 // GTEST_OS_HAIKU - Haiku
129120 // GTEST_OS_HPUX - HP-UX
130121 // GTEST_OS_LINUX - Linux
131122 // GTEST_OS_LINUX_ANDROID - Google Android
134125 // GTEST_OS_NACL - Google Native Client (NaCl)
135126 // GTEST_OS_NETBSD - NetBSD
136127 // GTEST_OS_OPENBSD - OpenBSD
128 // GTEST_OS_OS2 - OS/2
137129 // GTEST_OS_QNX - QNX
138130 // GTEST_OS_SOLARIS - Sun Solaris
139 // GTEST_OS_SYMBIAN - Symbian
140131 // GTEST_OS_WINDOWS - Windows (Desktop, MinGW, or Mobile)
141132 // GTEST_OS_WINDOWS_DESKTOP - Windows Desktop
142133 // GTEST_OS_WINDOWS_MINGW - MinGW
145136 // GTEST_OS_WINDOWS_RT - Windows Store App/WinRT
146137 // GTEST_OS_ZOS - z/OS
147138 //
148 // Among the platforms, Cygwin, Linux, Max OS X, and Windows have the
139 // Among the platforms, Cygwin, Linux, Mac OS X, and Windows have the
149140 // most stable support. Since core members of the Google Test project
150141 // don't have access to other platforms, support for them may be less
151142 // stable. If you notice any problems on your platform, please notify
171162 // EXPECT_DEATH(DoSomethingDeadly());
172163 // #endif
173164 //
174 // GTEST_HAS_COMBINE - the Combine() function (for value-parameterized
175 // tests)
176165 // GTEST_HAS_DEATH_TEST - death tests
177166 // GTEST_HAS_TYPED_TEST - typed tests
178167 // GTEST_HAS_TYPED_TEST_P - type-parameterized tests
183172 // define themselves.
184173 // GTEST_USES_SIMPLE_RE - our own simple regex is used;
185174 // the above RE\b(s) are mutually exclusive.
186 // GTEST_CAN_COMPARE_NULL - accepts untyped NULL in EXPECT_EQ().
187175
188176 // Misc public macros
189177 // ------------------
209197 // GTEST_INTENTIONAL_CONST_COND_POP_ - finish code section where MSVC C4127
210198 // is suppressed.
211199 //
212 // C++11 feature wrappers:
213 //
214 // testing::internal::forward - portability wrapper for std::forward.
215 // testing::internal::move - portability wrapper for std::move.
216 //
217200 // Synchronization:
218201 // Mutex, MutexLock, ThreadLocal, GetThreadCount()
219202 // - synchronization primitives.
220 //
221 // Template meta programming:
222 // is_pointer - as in TR1; needed on Symbian and IBM XL C/C++ only.
223 // IteratorTraits - partial implementation of std::iterator_traits, which
224 // is not available in libCstd when compiled with Sun C++.
225 //
226 // Smart pointers:
227 // scoped_ptr - as in TR2.
228203 //
229204 // Regular expressions:
230205 // RE - a simple regular expression class using the POSIX
261236 // BoolFromGTestEnv() - parses a bool environment variable.
262237 // Int32FromGTestEnv() - parses an Int32 environment variable.
263238 // StringFromGTestEnv() - parses a string environment variable.
239 //
240 // Deprecation warnings:
241 // GTEST_INTERNAL_DEPRECATED(message) - attribute marking a function as
242 // deprecated; calling a marked function
243 // should generate a compiler warning
264244
265245 #include <ctype.h> // for isspace, etc
266246 #include <stddef.h> // for ptrdiff_t
247 #include <stdio.h>
267248 #include <stdlib.h>
268 #include <stdio.h>
269249 #include <string.h>
250 #include <memory>
251 #include <type_traits>
252
270253 #ifndef _WIN32_WCE
271254 # include <sys/types.h>
272255 # include <sys/stat.h>
277260 # include <TargetConditionals.h>
278261 #endif
279262
280 // Brings in the definition of HAS_GLOBAL_STRING. This must be done
281 // BEFORE we test HAS_GLOBAL_STRING.
282 #include <string> // NOLINT
283263 #include <algorithm> // NOLINT
284 #include <iostream> // NOLINT
285 #include <sstream> // NOLINT
264 #include <iostream> // NOLINT
265 #include <sstream> // NOLINT
266 #include <string> // NOLINT
267 #include <tuple>
286268 #include <utility>
287269 #include <vector> // NOLINT
288270
314296 // GTEST_DISABLE_MSC_WARNINGS_PUSH_(4800 4385)
315297 // /* code that triggers warnings C4800 and C4385 */
316298 // GTEST_DISABLE_MSC_WARNINGS_POP_()
317 #if _MSC_VER >= 1400
299 #if defined(_MSC_VER)
318300 # define GTEST_DISABLE_MSC_WARNINGS_PUSH_(warnings) \
319301 __pragma(warning(push)) \
320302 __pragma(warning(disable: warnings))
321303 # define GTEST_DISABLE_MSC_WARNINGS_POP_() \
322304 __pragma(warning(pop))
323305 #else
324 // Older versions of MSVC don't have __pragma.
306 // Not all compilers are MSVC
325307 # define GTEST_DISABLE_MSC_WARNINGS_PUSH_(warnings)
326308 # define GTEST_DISABLE_MSC_WARNINGS_POP_()
327309 #endif
340322 GTEST_DISABLE_MSC_WARNINGS_PUSH_(4996)
341323 # define GTEST_DISABLE_MSC_DEPRECATED_POP_() \
342324 GTEST_DISABLE_MSC_WARNINGS_POP_()
343 #endif
344
345 #ifndef GTEST_LANG_CXX11
346 // gcc and clang define __GXX_EXPERIMENTAL_CXX0X__ when
347 // -std={c,gnu}++{0x,11} is passed. The C++11 standard specifies a
348 // value for __cplusplus, and recent versions of clang, gcc, and
349 // probably other compilers set that too in C++11 mode.
350 # if __GXX_EXPERIMENTAL_CXX0X__ || __cplusplus >= 201103L || _MSC_VER >= 1900
351 // Compiling in at least C++11 mode.
352 # define GTEST_LANG_CXX11 1
353 # else
354 # define GTEST_LANG_CXX11 0
355 # endif
356 #endif
357
358 // Distinct from C++11 language support, some environments don't provide
359 // proper C++11 library support. Notably, it's possible to build in
360 // C++11 mode when targeting Mac OS X 10.6, which has an old libstdc++
361 // with no C++11 support.
362 //
363 // libstdc++ has sufficient C++11 support as of GCC 4.6.0, __GLIBCXX__
364 // 20110325, but maintenance releases in the 4.4 and 4.5 series followed
365 // this date, so check for those versions by their date stamps.
366 // https://gcc.gnu.org/onlinedocs/libstdc++/manual/abi.html#abi.versioning
367 #if GTEST_LANG_CXX11 && \
368 (!defined(__GLIBCXX__) || ( \
369 __GLIBCXX__ >= 20110325ul && /* GCC >= 4.6.0 */ \
370 /* Blacklist of patch releases of older branches: */ \
371 __GLIBCXX__ != 20110416ul && /* GCC 4.4.6 */ \
372 __GLIBCXX__ != 20120313ul && /* GCC 4.4.7 */ \
373 __GLIBCXX__ != 20110428ul && /* GCC 4.5.3 */ \
374 __GLIBCXX__ != 20120702ul)) /* GCC 4.5.4 */
375 # define GTEST_STDLIB_CXX11 1
376 #endif
377
378 // Only use C++11 library features if the library provides them.
379 #if GTEST_STDLIB_CXX11
380 # define GTEST_HAS_STD_BEGIN_AND_END_ 1
381 # define GTEST_HAS_STD_FORWARD_LIST_ 1
382 # if !defined(_MSC_VER) || (_MSC_FULL_VER >= 190023824)
383 // works only with VS2015U2 and better
384 # define GTEST_HAS_STD_FUNCTION_ 1
385 # endif
386 # define GTEST_HAS_STD_INITIALIZER_LIST_ 1
387 # define GTEST_HAS_STD_MOVE_ 1
388 # define GTEST_HAS_STD_UNIQUE_PTR_ 1
389 # define GTEST_HAS_STD_SHARED_PTR_ 1
390 # define GTEST_HAS_UNORDERED_MAP_ 1
391 # define GTEST_HAS_UNORDERED_SET_ 1
392 #endif
393
394 // C++11 specifies that <tuple> provides std::tuple.
395 // Some platforms still might not have it, however.
396 #if GTEST_LANG_CXX11
397 # define GTEST_HAS_STD_TUPLE_ 1
398 # if defined(__clang__)
399 // Inspired by
400 // https://clang.llvm.org/docs/LanguageExtensions.html#include-file-checking-macros
401 # if defined(__has_include) && !__has_include(<tuple>)
402 # undef GTEST_HAS_STD_TUPLE_
403 # endif
404 # elif defined(_MSC_VER)
405 // Inspired by boost/config/stdlib/dinkumware.hpp
406 # if defined(_CPPLIB_VER) && _CPPLIB_VER < 520
407 # undef GTEST_HAS_STD_TUPLE_
408 # endif
409 # elif defined(__GLIBCXX__)
410 // Inspired by boost/config/stdlib/libstdcpp3.hpp,
411 // http://gcc.gnu.org/gcc-4.2/changes.html and
412 // https://web.archive.org/web/20140227044429/gcc.gnu.org/onlinedocs/libstdc++/manual/bk01pt01ch01.html#manual.intro.status.standard.200x
413 # if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 2)
414 # undef GTEST_HAS_STD_TUPLE_
415 # endif
416 # endif
417325 #endif
418326
419327 // Brings in definitions for functions used in the testing::internal::posix
448356 # include <android/api-level.h> // NOLINT
449357 #endif
450358
451 // Defines this to true iff Google Test can use POSIX regular expressions.
359 // Defines this to true if and only if Google Test can use POSIX regular
360 // expressions.
452361 #ifndef GTEST_HAS_POSIX_RE
453362 # if GTEST_OS_LINUX_ANDROID
454363 // On Android, <regex.h> is only available starting with Gingerbread.
489398 // The user didn't tell us whether exceptions are enabled, so we need
490399 // to figure it out.
491400 # if defined(_MSC_VER) && defined(_CPPUNWIND)
492 // MSVC defines _CPPUNWIND to 1 iff exceptions are enabled.
401 // MSVC defines _CPPUNWIND to 1 if and only if exceptions are enabled.
493402 # define GTEST_HAS_EXCEPTIONS 1
494403 # elif defined(__BORLANDC__)
495404 // C++Builder's implementation of the STL uses the _HAS_EXCEPTIONS
500409 # endif // _HAS_EXCEPTIONS
501410 # define GTEST_HAS_EXCEPTIONS _HAS_EXCEPTIONS
502411 # elif defined(__clang__)
503 // clang defines __EXCEPTIONS iff exceptions are enabled before clang 220714,
504 // but iff cleanups are enabled after that. In Obj-C++ files, there can be
505 // cleanups for ObjC exceptions which also need cleanups, even if C++ exceptions
506 // are disabled. clang has __has_feature(cxx_exceptions) which checks for C++
507 // exceptions starting at clang r206352, but which checked for cleanups prior to
508 // that. To reliably check for C++ exception availability with clang, check for
412 // clang defines __EXCEPTIONS if and only if exceptions are enabled before clang
413 // 220714, but if and only if cleanups are enabled after that. In Obj-C++ files,
414 // there can be cleanups for ObjC exceptions which also need cleanups, even if
415 // C++ exceptions are disabled. clang has __has_feature(cxx_exceptions) which
416 // checks for C++ exceptions starting at clang r206352, but which checked for
417 // cleanups prior to that. To reliably check for C++ exception availability with
418 // clang, check for
509419 // __EXCEPTIONS && __has_feature(cxx_exceptions).
510420 # define GTEST_HAS_EXCEPTIONS (__EXCEPTIONS && __has_feature(cxx_exceptions))
511421 # elif defined(__GNUC__) && __EXCEPTIONS
512 // gcc defines __EXCEPTIONS to 1 iff exceptions are enabled.
422 // gcc defines __EXCEPTIONS to 1 if and only if exceptions are enabled.
513423 # define GTEST_HAS_EXCEPTIONS 1
514424 # elif defined(__SUNPRO_CC)
515425 // Sun Pro CC supports exceptions. However, there is no compile-time way of
517427 // they are enabled unless the user tells us otherwise.
518428 # define GTEST_HAS_EXCEPTIONS 1
519429 # elif defined(__IBMCPP__) && __EXCEPTIONS
520 // xlC defines __EXCEPTIONS to 1 iff exceptions are enabled.
430 // xlC defines __EXCEPTIONS to 1 if and only if exceptions are enabled.
521431 # define GTEST_HAS_EXCEPTIONS 1
522432 # elif defined(__HP_aCC)
523433 // Exception handling is in effect by default in HP aCC compiler. It has to
539449 # error "::std::string isn't available."
540450 #endif // !defined(GTEST_HAS_STD_STRING)
541451
542 #ifndef GTEST_HAS_GLOBAL_STRING
543 # define GTEST_HAS_GLOBAL_STRING 0
544 #endif // GTEST_HAS_GLOBAL_STRING
545
546452 #ifndef GTEST_HAS_STD_WSTRING
547453 // The user didn't tell us whether ::std::wstring is available, so we need
548454 // to figure it out.
549 // FIXME: uses autoconf to detect whether ::std::wstring
550 // is available.
551
552455 // Cygwin 1.7 and below doesn't support ::std::wstring.
553456 // Solaris' libc++ doesn't support it either. Android has
554457 // no support for it at least as recent as Froyo (2.2).
555 # define GTEST_HAS_STD_WSTRING \
556 (!(GTEST_OS_LINUX_ANDROID || GTEST_OS_CYGWIN || GTEST_OS_SOLARIS))
458 #define GTEST_HAS_STD_WSTRING \
459 (!(GTEST_OS_LINUX_ANDROID || GTEST_OS_CYGWIN || GTEST_OS_SOLARIS || \
460 GTEST_OS_HAIKU))
557461
558462 #endif // GTEST_HAS_STD_WSTRING
559
560 #ifndef GTEST_HAS_GLOBAL_WSTRING
561 // The user didn't tell us whether ::wstring is available, so we need
562 // to figure it out.
563 # define GTEST_HAS_GLOBAL_WSTRING \
564 (GTEST_HAS_STD_WSTRING && GTEST_HAS_GLOBAL_STRING)
565 #endif // GTEST_HAS_GLOBAL_WSTRING
566463
567464 // Determines whether RTTI is available.
568465 #ifndef GTEST_HAS_RTTI
571468
572469 # ifdef _MSC_VER
573470
574 # ifdef _CPPRTTI // MSVC defines this macro iff RTTI is enabled.
471 #ifdef _CPPRTTI // MSVC defines this macro if and only if RTTI is enabled.
575472 # define GTEST_HAS_RTTI 1
576473 # else
577474 # define GTEST_HAS_RTTI 0
578475 # endif
579476
580 // Starting with version 4.3.2, gcc defines __GXX_RTTI iff RTTI is enabled.
581 # elif defined(__GNUC__) && (GTEST_GCC_VER_ >= 40302)
477 // Starting with version 4.3.2, gcc defines __GXX_RTTI if and only if RTTI is
478 // enabled.
479 # elif defined(__GNUC__)
582480
583481 # ifdef __GXX_RTTI
584482 // When building against STLport with the Android NDK and with
634532 //
635533 // To disable threading support in Google Test, add -DGTEST_HAS_PTHREAD=0
636534 // to your compiler flags.
637 #define GTEST_HAS_PTHREAD \
638 (GTEST_OS_LINUX || GTEST_OS_MAC || GTEST_OS_HPUX || GTEST_OS_QNX || \
639 GTEST_OS_FREEBSD || GTEST_OS_NACL || GTEST_OS_NETBSD || GTEST_OS_FUCHSIA)
535 #define GTEST_HAS_PTHREAD \
536 (GTEST_OS_LINUX || GTEST_OS_MAC || GTEST_OS_HPUX || GTEST_OS_QNX || \
537 GTEST_OS_FREEBSD || GTEST_OS_NACL || GTEST_OS_NETBSD || GTEST_OS_FUCHSIA || \
538 GTEST_OS_DRAGONFLY || GTEST_OS_GNU_KFREEBSD || GTEST_OS_OPENBSD || \
539 GTEST_OS_HAIKU)
640540 #endif // GTEST_HAS_PTHREAD
641541
642542 #if GTEST_HAS_PTHREAD
647547 // For timespec and nanosleep, used below.
648548 # include <time.h> // NOLINT
649549 #endif
650
651 // Determines if hash_map/hash_set are available.
652 // Only used for testing against those containers.
653 #if !defined(GTEST_HAS_HASH_MAP_)
654 # if defined(_MSC_VER) && (_MSC_VER < 1900)
655 # define GTEST_HAS_HASH_MAP_ 1 // Indicates that hash_map is available.
656 # define GTEST_HAS_HASH_SET_ 1 // Indicates that hash_set is available.
657 # endif // _MSC_VER
658 #endif // !defined(GTEST_HAS_HASH_MAP_)
659
660 // Determines whether Google Test can use tr1/tuple. You can define
661 // this macro to 0 to prevent Google Test from using tuple (any
662 // feature depending on tuple with be disabled in this mode).
663 #ifndef GTEST_HAS_TR1_TUPLE
664 # if GTEST_OS_LINUX_ANDROID && defined(_STLPORT_MAJOR)
665 // STLport, provided with the Android NDK, has neither <tr1/tuple> or <tuple>.
666 # define GTEST_HAS_TR1_TUPLE 0
667 # elif defined(_MSC_VER) && (_MSC_VER >= 1910)
668 // Prevent `warning C4996: 'std::tr1': warning STL4002:
669 // The non-Standard std::tr1 namespace and TR1-only machinery
670 // are deprecated and will be REMOVED.`
671 # define GTEST_HAS_TR1_TUPLE 0
672 # elif GTEST_LANG_CXX11 && defined(_LIBCPP_VERSION)
673 // libc++ doesn't support TR1.
674 # define GTEST_HAS_TR1_TUPLE 0
675 # else
676 // The user didn't tell us not to do it, so we assume it's OK.
677 # define GTEST_HAS_TR1_TUPLE 1
678 # endif
679 #endif // GTEST_HAS_TR1_TUPLE
680
681 // Determines whether Google Test's own tr1 tuple implementation
682 // should be used.
683 #ifndef GTEST_USE_OWN_TR1_TUPLE
684 // We use our own tuple implementation on Symbian.
685 # if GTEST_OS_SYMBIAN
686 # define GTEST_USE_OWN_TR1_TUPLE 1
687 # else
688 // The user didn't tell us, so we need to figure it out.
689
690 // We use our own TR1 tuple if we aren't sure the user has an
691 // implementation of it already. At this time, libstdc++ 4.0.0+ and
692 // MSVC 2010 are the only mainstream standard libraries that come
693 // with a TR1 tuple implementation. NVIDIA's CUDA NVCC compiler
694 // pretends to be GCC by defining __GNUC__ and friends, but cannot
695 // compile GCC's tuple implementation. MSVC 2008 (9.0) provides TR1
696 // tuple in a 323 MB Feature Pack download, which we cannot assume the
697 // user has. QNX's QCC compiler is a modified GCC but it doesn't
698 // support TR1 tuple. libc++ only provides std::tuple, in C++11 mode,
699 // and it can be used with some compilers that define __GNUC__.
700 # if (defined(__GNUC__) && !defined(__CUDACC__) && (GTEST_GCC_VER_ >= 40000) \
701 && !GTEST_OS_QNX && !defined(_LIBCPP_VERSION)) \
702 || (_MSC_VER >= 1600 && _MSC_VER < 1900)
703 # define GTEST_ENV_HAS_TR1_TUPLE_ 1
704 # endif
705
706 // C++11 specifies that <tuple> provides std::tuple. Use that if gtest is used
707 // in C++11 mode and libstdc++ isn't very old (binaries targeting OS X 10.6
708 // can build with clang but need to use gcc4.2's libstdc++).
709 # if GTEST_LANG_CXX11 && (!defined(__GLIBCXX__) || __GLIBCXX__ > 20110325)
710 # define GTEST_ENV_HAS_STD_TUPLE_ 1
711 # endif
712
713 # if GTEST_ENV_HAS_TR1_TUPLE_ || GTEST_ENV_HAS_STD_TUPLE_
714 # define GTEST_USE_OWN_TR1_TUPLE 0
715 # else
716 # define GTEST_USE_OWN_TR1_TUPLE 1
717 # endif
718 # endif // GTEST_OS_SYMBIAN
719 #endif // GTEST_USE_OWN_TR1_TUPLE
720
721 // To avoid conditional compilation we make it gtest-port.h's responsibility
722 // to #include the header implementing tuple.
723 #if GTEST_HAS_STD_TUPLE_
724 # include <tuple> // IWYU pragma: export
725 # define GTEST_TUPLE_NAMESPACE_ ::std
726 #endif // GTEST_HAS_STD_TUPLE_
727
728 // We include tr1::tuple even if std::tuple is available to define printers for
729 // them.
730 #if GTEST_HAS_TR1_TUPLE
731 # ifndef GTEST_TUPLE_NAMESPACE_
732 # define GTEST_TUPLE_NAMESPACE_ ::std::tr1
733 # endif // GTEST_TUPLE_NAMESPACE_
734
735 # if GTEST_USE_OWN_TR1_TUPLE
736 # include "gtest/internal/gtest-tuple.h" // IWYU pragma: export // NOLINT
737 # elif GTEST_OS_SYMBIAN
738
739 // On Symbian, BOOST_HAS_TR1_TUPLE causes Boost's TR1 tuple library to
740 // use STLport's tuple implementation, which unfortunately doesn't
741 // work as the copy of STLport distributed with Symbian is incomplete.
742 // By making sure BOOST_HAS_TR1_TUPLE is undefined, we force Boost to
743 // use its own tuple implementation.
744 # ifdef BOOST_HAS_TR1_TUPLE
745 # undef BOOST_HAS_TR1_TUPLE
746 # endif // BOOST_HAS_TR1_TUPLE
747
748 // This prevents <boost/tr1/detail/config.hpp>, which defines
749 // BOOST_HAS_TR1_TUPLE, from being #included by Boost's <tuple>.
750 # define BOOST_TR1_DETAIL_CONFIG_HPP_INCLUDED
751 # include <tuple> // IWYU pragma: export // NOLINT
752
753 # elif defined(__GNUC__) && (GTEST_GCC_VER_ >= 40000)
754 // GCC 4.0+ implements tr1/tuple in the <tr1/tuple> header. This does
755 // not conform to the TR1 spec, which requires the header to be <tuple>.
756
757 # if !GTEST_HAS_RTTI && GTEST_GCC_VER_ < 40302
758 // Until version 4.3.2, gcc has a bug that causes <tr1/functional>,
759 // which is #included by <tr1/tuple>, to not compile when RTTI is
760 // disabled. _TR1_FUNCTIONAL is the header guard for
761 // <tr1/functional>. Hence the following #define is used to prevent
762 // <tr1/functional> from being included.
763 # define _TR1_FUNCTIONAL 1
764 # include <tr1/tuple>
765 # undef _TR1_FUNCTIONAL // Allows the user to #include
766 // <tr1/functional> if they choose to.
767 # else
768 # include <tr1/tuple> // NOLINT
769 # endif // !GTEST_HAS_RTTI && GTEST_GCC_VER_ < 40302
770
771 // VS 2010 now has tr1 support.
772 # elif _MSC_VER >= 1600
773 # include <tuple> // IWYU pragma: export // NOLINT
774
775 # else // GTEST_USE_OWN_TR1_TUPLE
776 # include <tr1/tuple> // IWYU pragma: export // NOLINT
777 # endif // GTEST_USE_OWN_TR1_TUPLE
778
779 #endif // GTEST_HAS_TR1_TUPLE
780550
781551 // Determines whether clone(2) is supported.
782552 // Usually it will only be available on Linux, excluding
811581 #ifndef GTEST_HAS_STREAM_REDIRECTION
812582 // By default, we assume that stream redirection is supported on all
813583 // platforms except known mobile ones.
814 # if GTEST_OS_WINDOWS_MOBILE || GTEST_OS_SYMBIAN || \
815 GTEST_OS_WINDOWS_PHONE || GTEST_OS_WINDOWS_RT
584 # if GTEST_OS_WINDOWS_MOBILE || GTEST_OS_WINDOWS_PHONE || GTEST_OS_WINDOWS_RT
816585 # define GTEST_HAS_STREAM_REDIRECTION 0
817586 # else
818587 # define GTEST_HAS_STREAM_REDIRECTION 1
819 # endif // !GTEST_OS_WINDOWS_MOBILE && !GTEST_OS_SYMBIAN
588 # endif // !GTEST_OS_WINDOWS_MOBILE
820589 #endif // GTEST_HAS_STREAM_REDIRECTION
821590
822591 // Determines whether to support death tests.
823 // Google Test does not support death tests for VC 7.1 and earlier as
824 // abort() in a VC 7.1 application compiled as GUI in debug config
825592 // pops up a dialog window that cannot be suppressed programmatically.
826 #if (GTEST_OS_LINUX || GTEST_OS_CYGWIN || GTEST_OS_SOLARIS || \
827 (GTEST_OS_MAC && !GTEST_OS_IOS) || \
828 (GTEST_OS_WINDOWS_DESKTOP && _MSC_VER >= 1400) || \
829 GTEST_OS_WINDOWS_MINGW || GTEST_OS_AIX || GTEST_OS_HPUX || \
830 GTEST_OS_OPENBSD || GTEST_OS_QNX || GTEST_OS_FREEBSD || \
831 GTEST_OS_NETBSD || GTEST_OS_FUCHSIA)
593 #if (GTEST_OS_LINUX || GTEST_OS_CYGWIN || GTEST_OS_SOLARIS || \
594 (GTEST_OS_MAC && !GTEST_OS_IOS) || \
595 (GTEST_OS_WINDOWS_DESKTOP && _MSC_VER) || GTEST_OS_WINDOWS_MINGW || \
596 GTEST_OS_AIX || GTEST_OS_HPUX || GTEST_OS_OPENBSD || GTEST_OS_QNX || \
597 GTEST_OS_FREEBSD || GTEST_OS_NETBSD || GTEST_OS_FUCHSIA || \
598 GTEST_OS_DRAGONFLY || GTEST_OS_GNU_KFREEBSD || GTEST_OS_HAIKU)
832599 # define GTEST_HAS_DEATH_TEST 1
833600 #endif
834601
836603
837604 // Typed tests need <typeinfo> and variadic macros, which GCC, VC++ 8.0,
838605 // Sun Pro CC, IBM Visual Age, and HP aCC support.
839 #if defined(__GNUC__) || (_MSC_VER >= 1400) || defined(__SUNPRO_CC) || \
606 #if defined(__GNUC__) || defined(_MSC_VER) || defined(__SUNPRO_CC) || \
840607 defined(__IBMCPP__) || defined(__HP_aCC)
841608 # define GTEST_HAS_TYPED_TEST 1
842609 # define GTEST_HAS_TYPED_TEST_P 1
843610 #endif
844611
845 // Determines whether to support Combine(). This only makes sense when
846 // value-parameterized tests are enabled. The implementation doesn't
847 // work on Sun Studio since it doesn't understand templated conversion
848 // operators.
849 #if (GTEST_HAS_TR1_TUPLE || GTEST_HAS_STD_TUPLE_) && !defined(__SUNPRO_CC)
850 # define GTEST_HAS_COMBINE 1
851 #endif
852
853612 // Determines whether the system compiler uses UTF-16 for encoding wide strings.
854613 #define GTEST_WIDE_STRING_USES_UTF16_ \
855 (GTEST_OS_WINDOWS || GTEST_OS_CYGWIN || GTEST_OS_SYMBIAN || GTEST_OS_AIX)
614 (GTEST_OS_WINDOWS || GTEST_OS_CYGWIN || GTEST_OS_AIX || GTEST_OS_OS2)
856615
857616 // Determines whether test results can be streamed to a socket.
858 #if GTEST_OS_LINUX
617 #if GTEST_OS_LINUX || GTEST_OS_GNU_KFREEBSD || GTEST_OS_DRAGONFLY || \
618 GTEST_OS_FREEBSD || GTEST_OS_NETBSD || GTEST_OS_OPENBSD
859619 # define GTEST_CAN_STREAM_RESULTS_ 1
860620 #endif
861621
896656 #ifndef GTEST_ATTRIBUTE_UNUSED_
897657 # define GTEST_ATTRIBUTE_UNUSED_
898658 #endif
899
900 #if GTEST_LANG_CXX11
901 # define GTEST_CXX11_EQUALS_DELETE_ = delete
902 #else // GTEST_LANG_CXX11
903 # define GTEST_CXX11_EQUALS_DELETE_
904 #endif // GTEST_LANG_CXX11
905659
906660 // Use this annotation before a function that takes a printf format string.
907661 #if (defined(__GNUC__) || defined(__clang__)) && !defined(COMPILER_ICC)
924678 // A macro to disallow operator=
925679 // This should be used in the private: declarations for a class.
926680 #define GTEST_DISALLOW_ASSIGN_(type) \
927 void operator=(type const &) GTEST_CXX11_EQUALS_DELETE_
681 void operator=(type const &) = delete
928682
929683 // A macro to disallow copy constructor and operator=
930684 // This should be used in the private: declarations for a class.
931685 #define GTEST_DISALLOW_COPY_AND_ASSIGN_(type) \
932 type(type const &) GTEST_CXX11_EQUALS_DELETE_; \
686 type(type const &) = delete; \
933687 GTEST_DISALLOW_ASSIGN_(type)
934688
935689 // Tell the compiler to warn about unused return values for functions declared
937691 // following the argument list:
938692 //
939693 // Sprocket* AllocateSprocket() GTEST_MUST_USE_RESULT_;
940 #if defined(__GNUC__) && (GTEST_GCC_VER_ >= 30400) && !defined(COMPILER_ICC)
694 #if defined(__GNUC__) && !defined(COMPILER_ICC)
941695 # define GTEST_MUST_USE_RESULT_ __attribute__ ((warn_unused_result))
942696 #else
943697 # define GTEST_MUST_USE_RESULT_
944 #endif // __GNUC__ && (GTEST_GCC_VER_ >= 30400) && !COMPILER_ICC
698 #endif // __GNUC__ && !COMPILER_ICC
945699
946700 // MS C++ compiler emits warning when a conditional expression is compile time
947701 // constant. In some contexts this warning is false positive and needs to be
970724 # define GTEST_HAS_SEH 0
971725 # endif
972726
973 #define GTEST_IS_THREADSAFE \
974 (GTEST_HAS_MUTEX_AND_THREAD_LOCAL_ \
975 || (GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_PHONE && !GTEST_OS_WINDOWS_RT) \
976 || GTEST_HAS_PTHREAD)
977
978727 #endif // GTEST_HAS_SEH
728
729 #ifndef GTEST_IS_THREADSAFE
730
731 #define GTEST_IS_THREADSAFE \
732 (GTEST_HAS_MUTEX_AND_THREAD_LOCAL_ || \
733 (GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_PHONE && !GTEST_OS_WINDOWS_RT) || \
734 GTEST_HAS_PTHREAD)
735
736 #endif // GTEST_IS_THREADSAFE
979737
980738 // GTEST_API_ qualifies all symbols that must be exported. The definitions below
981739 // are guarded by #ifndef to give embedders a chance to define GTEST_API_ in
1043801 # define GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_
1044802 #endif // __clang__
1045803
804 // A function level attribute to disable HWAddressSanitizer instrumentation.
805 #if defined(__clang__)
806 # if __has_feature(hwaddress_sanitizer)
807 # define GTEST_ATTRIBUTE_NO_SANITIZE_HWADDRESS_ \
808 __attribute__((no_sanitize("hwaddress")))
809 # else
810 # define GTEST_ATTRIBUTE_NO_SANITIZE_HWADDRESS_
811 # endif // __has_feature(hwaddress_sanitizer)
812 #else
813 # define GTEST_ATTRIBUTE_NO_SANITIZE_HWADDRESS_
814 #endif // __clang__
815
1046816 // A function level attribute to disable ThreadSanitizer instrumentation.
1047817 #if defined(__clang__)
1048818 # if __has_feature(thread_sanitizer)
1059829
1060830 class Message;
1061831
1062 #if defined(GTEST_TUPLE_NAMESPACE_)
1063 // Import tuple and friends into the ::testing namespace.
1064 // It is part of our interface, having them in ::testing allows us to change
1065 // their types as needed.
1066 using GTEST_TUPLE_NAMESPACE_::get;
1067 using GTEST_TUPLE_NAMESPACE_::make_tuple;
1068 using GTEST_TUPLE_NAMESPACE_::tuple;
1069 using GTEST_TUPLE_NAMESPACE_::tuple_size;
1070 using GTEST_TUPLE_NAMESPACE_::tuple_element;
1071 #endif // defined(GTEST_TUPLE_NAMESPACE_)
832 // Legacy imports for backwards compatibility.
833 // New code should use std:: names directly.
834 using std::get;
835 using std::make_tuple;
836 using std::tuple;
837 using std::tuple_element;
838 using std::tuple_size;
1072839
1073840 namespace internal {
1074841
1077844 // Secret object, which is what we want.
1078845 class Secret;
1079846
1080 // The GTEST_COMPILE_ASSERT_ macro can be used to verify that a compile time
1081 // expression is true. For example, you could use it to verify the
1082 // size of a static array:
847 // The GTEST_COMPILE_ASSERT_ is a legacy macro used to verify that a compile
848 // time expression is true (in new code, use static_assert instead). For
849 // example, you could use it to verify the size of a static array:
1083850 //
1084851 // GTEST_COMPILE_ASSERT_(GTEST_ARRAY_SIZE_(names) == NUM_NAMES,
1085852 // names_incorrect_size);
1086853 //
1087 // or to make sure a struct is smaller than a certain size:
1088 //
1089 // GTEST_COMPILE_ASSERT_(sizeof(foo) < 128, foo_too_large);
1090 //
1091 // The second argument to the macro is the name of the variable. If
1092 // the expression is false, most compilers will issue a warning/error
1093 // containing the name of the variable.
1094
1095 #if GTEST_LANG_CXX11
1096 # define GTEST_COMPILE_ASSERT_(expr, msg) static_assert(expr, #msg)
1097 #else // !GTEST_LANG_CXX11
1098 template <bool>
1099 struct CompileAssert {
1100 };
1101
1102 # define GTEST_COMPILE_ASSERT_(expr, msg) \
1103 typedef ::testing::internal::CompileAssert<(static_cast<bool>(expr))> \
1104 msg[static_cast<bool>(expr) ? 1 : -1] GTEST_ATTRIBUTE_UNUSED_
1105 #endif // !GTEST_LANG_CXX11
1106
1107 // Implementation details of GTEST_COMPILE_ASSERT_:
1108 //
1109 // (In C++11, we simply use static_assert instead of the following)
1110 //
1111 // - GTEST_COMPILE_ASSERT_ works by defining an array type that has -1
1112 // elements (and thus is invalid) when the expression is false.
1113 //
1114 // - The simpler definition
1115 //
1116 // #define GTEST_COMPILE_ASSERT_(expr, msg) typedef char msg[(expr) ? 1 : -1]
1117 //
1118 // does not work, as gcc supports variable-length arrays whose sizes
1119 // are determined at run-time (this is gcc's extension and not part
1120 // of the C++ standard). As a result, gcc fails to reject the
1121 // following code with the simple definition:
1122 //
1123 // int foo;
1124 // GTEST_COMPILE_ASSERT_(foo, msg); // not supposed to compile as foo is
1125 // // not a compile-time constant.
1126 //
1127 // - By using the type CompileAssert<(bool(expr))>, we ensures that
1128 // expr is a compile-time constant. (Template arguments must be
1129 // determined at compile-time.)
1130 //
1131 // - The outter parentheses in CompileAssert<(bool(expr))> are necessary
1132 // to work around a bug in gcc 3.4.4 and 4.0.1. If we had written
1133 //
1134 // CompileAssert<bool(expr)>
1135 //
1136 // instead, these compilers will refuse to compile
1137 //
1138 // GTEST_COMPILE_ASSERT_(5 > 0, some_message);
1139 //
1140 // (They seem to think the ">" in "5 > 0" marks the end of the
1141 // template argument list.)
1142 //
1143 // - The array size is (bool(expr) ? 1 : -1), instead of simply
1144 //
1145 // ((expr) ? 1 : -1).
1146 //
1147 // This is to avoid running into a bug in MS VC 7.1, which
1148 // causes ((0.0) ? 1 : -1) to incorrectly evaluate to 1.
1149
1150 // StaticAssertTypeEqHelper is used by StaticAssertTypeEq defined in gtest.h.
1151 //
1152 // This template is declared, but intentionally undefined.
1153 template <typename T1, typename T2>
1154 struct StaticAssertTypeEqHelper;
1155
1156 template <typename T>
1157 struct StaticAssertTypeEqHelper<T, T> {
1158 enum { value = true };
1159 };
1160
1161 // Same as std::is_same<>.
1162 template <typename T, typename U>
1163 struct IsSame {
1164 enum { value = false };
1165 };
1166 template <typename T>
1167 struct IsSame<T, T> {
1168 enum { value = true };
1169 };
854 // The second argument to the macro must be a valid C++ identifier. If the
855 // expression is false, compiler will issue an error containing this identifier.
856 #define GTEST_COMPILE_ASSERT_(expr, msg) static_assert(expr, #msg)
1170857
1171858 // Evaluates to the number of elements in 'array'.
1172859 #define GTEST_ARRAY_SIZE_(array) (sizeof(array) / sizeof(array[0]))
1173
1174 #if GTEST_HAS_GLOBAL_STRING
1175 typedef ::string string;
1176 #else
1177 typedef ::std::string string;
1178 #endif // GTEST_HAS_GLOBAL_STRING
1179
1180 #if GTEST_HAS_GLOBAL_WSTRING
1181 typedef ::wstring wstring;
1182 #elif GTEST_HAS_STD_WSTRING
1183 typedef ::std::wstring wstring;
1184 #endif // GTEST_HAS_GLOBAL_WSTRING
1185860
1186861 // A helper for suppressing warnings on constant condition. It just
1187862 // returns 'condition'.
1188863 GTEST_API_ bool IsTrue(bool condition);
1189864
1190 // Defines scoped_ptr.
1191
1192 // This implementation of scoped_ptr is PARTIAL - it only contains
1193 // enough stuff to satisfy Google Test's need.
1194 template <typename T>
1195 class scoped_ptr {
1196 public:
1197 typedef T element_type;
1198
1199 explicit scoped_ptr(T* p = NULL) : ptr_(p) {}
1200 ~scoped_ptr() { reset(); }
1201
1202 T& operator*() const { return *ptr_; }
1203 T* operator->() const { return ptr_; }
1204 T* get() const { return ptr_; }
1205
1206 T* release() {
1207 T* const ptr = ptr_;
1208 ptr_ = NULL;
1209 return ptr;
1210 }
1211
1212 void reset(T* p = NULL) {
1213 if (p != ptr_) {
1214 if (IsTrue(sizeof(T) > 0)) { // Makes sure T is a complete type.
1215 delete ptr_;
1216 }
1217 ptr_ = p;
1218 }
1219 }
1220
1221 friend void swap(scoped_ptr& a, scoped_ptr& b) {
1222 using std::swap;
1223 swap(a.ptr_, b.ptr_);
1224 }
1225
1226 private:
1227 T* ptr_;
1228
1229 GTEST_DISALLOW_COPY_AND_ASSIGN_(scoped_ptr);
1230 };
1231
1232865 // Defines RE.
1233866
1234867 #if GTEST_USES_PCRE
1246879 // Constructs an RE from a string.
1247880 RE(const ::std::string& regex) { Init(regex.c_str()); } // NOLINT
1248881
1249 # if GTEST_HAS_GLOBAL_STRING
1250
1251 RE(const ::string& regex) { Init(regex.c_str()); } // NOLINT
1252
1253 # endif // GTEST_HAS_GLOBAL_STRING
1254
1255882 RE(const char* regex) { Init(regex); } // NOLINT
1256883 ~RE();
1257884
1258885 // Returns the string representation of the regex.
1259886 const char* pattern() const { return pattern_; }
1260887
1261 // FullMatch(str, re) returns true iff regular expression re matches
1262 // the entire str.
1263 // PartialMatch(str, re) returns true iff regular expression re
888 // FullMatch(str, re) returns true if and only if regular expression re
889 // matches the entire str.
890 // PartialMatch(str, re) returns true if and only if regular expression re
1264891 // matches a substring of str (including str itself).
1265 //
1266 // FIXME: make FullMatch() and PartialMatch() work
1267 // when str contains NUL characters.
1268892 static bool FullMatch(const ::std::string& str, const RE& re) {
1269893 return FullMatch(str.c_str(), re);
1270894 }
1272896 return PartialMatch(str.c_str(), re);
1273897 }
1274898
1275 # if GTEST_HAS_GLOBAL_STRING
1276
1277 static bool FullMatch(const ::string& str, const RE& re) {
1278 return FullMatch(str.c_str(), re);
1279 }
1280 static bool PartialMatch(const ::string& str, const RE& re) {
1281 return PartialMatch(str.c_str(), re);
1282 }
1283
1284 # endif // GTEST_HAS_GLOBAL_STRING
1285
1286899 static bool FullMatch(const char* str, const RE& re);
1287900 static bool PartialMatch(const char* str, const RE& re);
1288901
1289902 private:
1290903 void Init(const char* regex);
1291
1292 // We use a const char* instead of an std::string, as Google Test used to be
1293 // used where std::string is not available. FIXME: change to
1294 // std::string.
1295904 const char* pattern_;
1296905 bool is_valid_;
1297906
1359968 __FILE__, __LINE__).GetStream()
1360969
1361970 inline void LogToStderr() {}
1362 inline void FlushInfoLog() { fflush(NULL); }
971 inline void FlushInfoLog() { fflush(nullptr); }
1363972
1364973 #endif // !defined(GTEST_LOG_)
1365974
13961005 GTEST_LOG_(FATAL) << #posix_call << "failed with error " \
13971006 << gtest_error
13981007
1399 // Adds reference to a type if it is not a reference type,
1400 // otherwise leaves it unchanged. This is the same as
1401 // tr1::add_reference, which is not widely available yet.
1402 template <typename T>
1403 struct AddReference { typedef T& type; }; // NOLINT
1404 template <typename T>
1405 struct AddReference<T&> { typedef T& type; }; // NOLINT
1406
1407 // A handy wrapper around AddReference that works when the argument T
1408 // depends on template parameters.
1409 #define GTEST_ADD_REFERENCE_(T) \
1410 typename ::testing::internal::AddReference<T>::type
1411
14121008 // Transforms "T" into "const T&" according to standard reference collapsing
14131009 // rules (this is only needed as a backport for C++98 compilers that do not
14141010 // support reference collapsing). Specifically, it transforms:
14281024 // The argument T must depend on some template parameters.
14291025 #define GTEST_REFERENCE_TO_CONST_(T) \
14301026 typename ::testing::internal::ConstRef<T>::type
1431
1432 #if GTEST_HAS_STD_MOVE_
1433 using std::forward;
1434 using std::move;
1435
1436 template <typename T>
1437 struct RvalueRef {
1438 typedef T&& type;
1439 };
1440 #else // GTEST_HAS_STD_MOVE_
1441 template <typename T>
1442 const T& move(const T& t) {
1443 return t;
1444 }
1445 template <typename T>
1446 GTEST_ADD_REFERENCE_(T) forward(GTEST_ADD_REFERENCE_(T) t) { return t; }
1447
1448 template <typename T>
1449 struct RvalueRef {
1450 typedef const T& type;
1451 };
1452 #endif // GTEST_HAS_STD_MOVE_
14531027
14541028 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
14551029 //
15041078 GTEST_INTENTIONAL_CONST_COND_PUSH_()
15051079 if (false) {
15061080 GTEST_INTENTIONAL_CONST_COND_POP_()
1507 const To to = NULL;
1508 ::testing::internal::ImplicitCast_<From*>(to);
1081 const To to = nullptr;
1082 ::testing::internal::ImplicitCast_<From*>(to);
15091083 }
15101084
15111085 #if GTEST_HAS_RTTI
15121086 // RTTI: debug mode only!
1513 GTEST_CHECK_(f == NULL || dynamic_cast<To>(f) != NULL);
1087 GTEST_CHECK_(f == nullptr || dynamic_cast<To>(f) != nullptr);
15141088 #endif
15151089 return static_cast<To>(f);
15161090 }
15641138 // Deprecated: pass the args vector by value instead.
15651139 void SetInjectableArgvs(const std::vector<std::string>* new_argvs);
15661140 void SetInjectableArgvs(const std::vector<std::string>& new_argvs);
1567 #if GTEST_HAS_GLOBAL_STRING
1568 void SetInjectableArgvs(const std::vector< ::string>& new_argvs);
1569 #endif // GTEST_HAS_GLOBAL_STRING
15701141 void ClearInjectableArgvs();
15711142
15721143 #endif // GTEST_HAS_DEATH_TEST
15821153 0, // 0 seconds.
15831154 n * 1000L * 1000L, // And n ms.
15841155 };
1585 nanosleep(&time, NULL);
1156 nanosleep(&time, nullptr);
15861157 }
15871158 # endif // GTEST_HAS_PTHREAD
15881159
16001171 class Notification {
16011172 public:
16021173 Notification() : notified_(false) {
1603 GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_init(&mutex_, NULL));
1174 GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_init(&mutex_, nullptr));
16041175 }
16051176 ~Notification() {
16061177 pthread_mutex_destroy(&mutex_);
16581229 void Reset(Handle handle);
16591230
16601231 private:
1661 // Returns true iff the handle is a valid handle object that can be closed.
1232 // Returns true if and only if the handle is a valid handle object that can be
1233 // closed.
16621234 bool IsCloseable() const;
16631235
16641236 Handle handle_;
17091281 // pass into pthread_create().
17101282 extern "C" inline void* ThreadFuncWithCLinkage(void* thread) {
17111283 static_cast<ThreadWithParamBase*>(thread)->Run();
1712 return NULL;
1284 return nullptr;
17131285 }
17141286
17151287 // Helper class for testing Google Test's multi-threading constructs.
17381310 // The thread can be created only after all fields except thread_
17391311 // have been initialized.
17401312 GTEST_CHECK_POSIX_SUCCESS_(
1741 pthread_create(&thread_, 0, &ThreadFuncWithCLinkage, base));
1313 pthread_create(&thread_, nullptr, &ThreadFuncWithCLinkage, base));
17421314 }
1743 ~ThreadWithParam() { Join(); }
1315 ~ThreadWithParam() override { Join(); }
17441316
17451317 void Join() {
17461318 if (!finished_) {
1747 GTEST_CHECK_POSIX_SUCCESS_(pthread_join(thread_, 0));
1319 GTEST_CHECK_POSIX_SUCCESS_(pthread_join(thread_, nullptr));
17481320 finished_ = true;
17491321 }
17501322 }
17511323
1752 virtual void Run() {
1753 if (thread_can_start_ != NULL)
1754 thread_can_start_->WaitForNotification();
1324 void Run() override {
1325 if (thread_can_start_ != nullptr) thread_can_start_->WaitForNotification();
17551326 func_(param_);
17561327 }
17571328
17611332 // When non-NULL, used to block execution until the controller thread
17621333 // notifies.
17631334 Notification* const thread_can_start_;
1764 bool finished_; // true iff we know that the thread function has finished.
1335 bool finished_; // true if and only if we know that the thread function has
1336 // finished.
17651337 pthread_t thread_; // The native thread object.
17661338
17671339 GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadWithParam);
20451617 GTEST_DISALLOW_COPY_AND_ASSIGN_(InstanceValueHolderFactory);
20461618 };
20471619
2048 scoped_ptr<ValueHolderFactory> default_factory_;
1620 std::unique_ptr<ValueHolderFactory> default_factory_;
20491621
20501622 GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadLocal);
20511623 };
21141686 class Mutex : public MutexBase {
21151687 public:
21161688 Mutex() {
2117 GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_init(&mutex_, NULL));
1689 GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_init(&mutex_, nullptr));
21181690 has_owner_ = false;
21191691 }
21201692 ~Mutex() {
22121784 T* GetOrCreateValue() const {
22131785 ThreadLocalValueHolderBase* const holder =
22141786 static_cast<ThreadLocalValueHolderBase*>(pthread_getspecific(key_));
2215 if (holder != NULL) {
1787 if (holder != nullptr) {
22161788 return CheckedDowncastToActualType<ValueHolder>(holder)->pointer();
22171789 }
22181790
22561828
22571829 // A key pthreads uses for looking up per-thread values.
22581830 const pthread_key_t key_;
2259 scoped_ptr<ValueHolderFactory> default_factory_;
1831 std::unique_ptr<ValueHolderFactory> default_factory_;
22601832
22611833 GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadLocal);
22621834 };
23141886 // we cannot detect it.
23151887 GTEST_API_ size_t GetThreadCount();
23161888
2317 // Passing non-POD classes through ellipsis (...) crashes the ARM
2318 // compiler and generates a warning in Sun Studio before 12u4. The Nokia Symbian
2319 // and the IBM XL C/C++ compiler try to instantiate a copy constructor
2320 // for objects passed through ellipsis (...), failing for uncopyable
2321 // objects. We define this to ensure that only POD is passed through
2322 // ellipsis on these systems.
2323 #if defined(__SYMBIAN32__) || defined(__IBMCPP__) || \
2324 (defined(__SUNPRO_CC) && __SUNPRO_CC < 0x5130)
2325 // We lose support for NULL detection where the compiler doesn't like
2326 // passing non-POD classes through ellipsis (...).
2327 # define GTEST_ELLIPSIS_NEEDS_POD_ 1
2328 #else
2329 # define GTEST_CAN_COMPARE_NULL 1
2330 #endif
2331
2332 // The Nokia Symbian and IBM XL C/C++ compilers cannot decide between
2333 // const T& and const T* in a function template. These compilers
2334 // _can_ decide between class template specializations for T and T*,
2335 // so a tr1::type_traits-like is_pointer works.
2336 #if defined(__SYMBIAN32__) || defined(__IBMCPP__)
2337 # define GTEST_NEEDS_IS_POINTER_ 1
2338 #endif
2339
2340 template <bool bool_value>
2341 struct bool_constant {
2342 typedef bool_constant<bool_value> type;
2343 static const bool value = bool_value;
2344 };
2345 template <bool bool_value> const bool bool_constant<bool_value>::value;
2346
2347 typedef bool_constant<false> false_type;
2348 typedef bool_constant<true> true_type;
2349
2350 template <typename T, typename U>
2351 struct is_same : public false_type {};
2352
2353 template <typename T>
2354 struct is_same<T, T> : public true_type {};
2355
2356
2357 template <typename T>
2358 struct is_pointer : public false_type {};
2359
2360 template <typename T>
2361 struct is_pointer<T*> : public true_type {};
2362
2363 template <typename Iterator>
2364 struct IteratorTraits {
2365 typedef typename Iterator::value_type value_type;
2366 };
2367
2368
2369 template <typename T>
2370 struct IteratorTraits<T*> {
2371 typedef T value_type;
2372 };
2373
2374 template <typename T>
2375 struct IteratorTraits<const T*> {
2376 typedef T value_type;
2377 };
1889 template <bool B>
1890 using bool_constant = std::integral_constant<bool, B>;
23781891
23791892 #if GTEST_OS_WINDOWS
23801893 # define GTEST_PATH_SEP_ "\\"
25342047 #if GTEST_OS_WINDOWS_MOBILE || GTEST_OS_WINDOWS_PHONE || GTEST_OS_WINDOWS_RT
25352048 // We are on Windows CE, which has no environment variables.
25362049 static_cast<void>(name); // To prevent 'unused argument' warning.
2537 return NULL;
2050 return nullptr;
25382051 #elif defined(__BORLANDC__) || defined(__SunOS_5_8) || defined(__SunOS_5_9)
25392052 // Environment variables which we programmatically clear will be set to the
25402053 // empty string rather than unset (NULL). Handle that case.
25412054 const char* const env = getenv(name);
2542 return (env != NULL && env[0] != '\0') ? env : NULL;
2055 return (env != nullptr && env[0] != '\0') ? env : nullptr;
25432056 #else
25442057 return getenv(name);
25452058 #endif
25512064 // Windows CE has no C library. The abort() function is used in
25522065 // several places in Google Test. This implementation provides a reasonable
25532066 // imitation of standard behaviour.
2554 void Abort();
2067 [[noreturn]] void Abort();
25552068 #else
2556 inline void Abort() { abort(); }
2069 [[noreturn]] inline void Abort() { abort(); }
25572070 #endif // GTEST_OS_WINDOWS_MOBILE
25582071
25592072 } // namespace posix
25632076 // MSVC-based platforms. We map the GTEST_SNPRINTF_ macro to the appropriate
25642077 // function in order to achieve that. We use macro definition here because
25652078 // snprintf is a variadic function.
2566 #if _MSC_VER >= 1400 && !GTEST_OS_WINDOWS_MOBILE
2079 #if _MSC_VER && !GTEST_OS_WINDOWS_MOBILE
25672080 // MSVC 2005 and above support variadic macros.
25682081 # define GTEST_SNPRINTF_(buffer, size, format, ...) \
25692082 _snprintf_s(buffer, size, size, format, __VA_ARGS__)
25702083 #elif defined(_MSC_VER)
2571 // Windows CE does not define _snprintf_s and MSVC prior to 2005 doesn't
2572 // complain about _snprintf.
2084 // Windows CE does not define _snprintf_s
25732085 # define GTEST_SNPRINTF_ _snprintf
25742086 #else
25752087 # define GTEST_SNPRINTF_ snprintf
26832195 // Parses 'str' for a 32-bit signed integer. If successful, writes the result
26842196 // to *value and returns true; otherwise leaves *value unchanged and returns
26852197 // false.
2686 // FIXME: Find a better way to refactor flag and environment parsing
2687 // out of both gtest-port.cc and gtest.cc to avoid exporting this utility
2688 // function.
26892198 bool ParseInt32(const Message& src_text, const char* str, Int32* value);
26902199
26912200 // Parses a bool/Int32/string from the environment variable
26982207 } // namespace internal
26992208 } // namespace testing
27002209
2210 #if !defined(GTEST_INTERNAL_DEPRECATED)
2211
2212 // Internal Macro to mark an API deprecated, for googletest usage only
2213 // Usage: class GTEST_INTERNAL_DEPRECATED(message) MyClass or
2214 // GTEST_INTERNAL_DEPRECATED(message) <return_type> myFunction(); Every usage of
2215 // a deprecated entity will trigger a warning when compiled with
2216 // `-Wdeprecated-declarations` option (clang, gcc, any __GNUC__ compiler).
2217 // For msvc /W3 option will need to be used
2218 // Note that for 'other' compilers this macro evaluates to nothing to prevent
2219 // compilations errors.
2220 #if defined(_MSC_VER)
2221 #define GTEST_INTERNAL_DEPRECATED(message) __declspec(deprecated(message))
2222 #elif defined(__GNUC__)
2223 #define GTEST_INTERNAL_DEPRECATED(message) __attribute__((deprecated(message)))
2224 #else
2225 #define GTEST_INTERNAL_DEPRECATED(message)
2226 #endif
2227
2228 #endif // !defined(GTEST_INTERNAL_DEPRECATED)
2229
27012230 #endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_H_
9393 static const char* Utf16ToAnsi(LPCWSTR utf16_str);
9494 #endif
9595
96 // Compares two C strings. Returns true iff they have the same content.
96 // Compares two C strings. Returns true if and only if they have the same
97 // content.
9798 //
9899 // Unlike strcmp(), this function can handle NULL argument(s). A
99100 // NULL C string is considered different to any non-NULL C string,
106107 // returned.
107108 static std::string ShowWideCString(const wchar_t* wide_c_str);
108109
109 // Compares two wide C strings. Returns true iff they have the same
110 // content.
110 // Compares two wide C strings. Returns true if and only if they have the
111 // same content.
111112 //
112113 // Unlike wcscmp(), this function can handle NULL argument(s). A
113114 // NULL C string is considered different to any non-NULL C string,
114115 // including the empty string.
115116 static bool WideCStringEquals(const wchar_t* lhs, const wchar_t* rhs);
116117
117 // Compares two C strings, ignoring case. Returns true iff they
118 // have the same content.
118 // Compares two C strings, ignoring case. Returns true if and only if
119 // they have the same content.
119120 //
120121 // Unlike strcasecmp(), this function can handle NULL argument(s).
121122 // A NULL C string is considered different to any non-NULL C string,
123124 static bool CaseInsensitiveCStringEquals(const char* lhs,
124125 const char* rhs);
125126
126 // Compares two wide C strings, ignoring case. Returns true iff they
127 // have the same content.
127 // Compares two wide C strings, ignoring case. Returns true if and only if
128 // they have the same content.
128129 //
129130 // Unlike wcscasecmp(), this function can handle NULL argument(s).
130131 // A NULL C string is considered different to any non-NULL wide C string,
138139 static bool CaseInsensitiveWideCStringEquals(const wchar_t* lhs,
139140 const wchar_t* rhs);
140141
141 // Returns true iff the given string ends with the given suffix, ignoring
142 // case. Any string is considered to end with an empty suffix.
142 // Returns true if and only if the given string ends with the given suffix,
143 // ignoring case. Any string is considered to end with an empty suffix.
143144 static bool EndsWithCaseInsensitive(
144145 const std::string& str, const std::string& suffix);
145146
148149
149150 // Formats an int value as "%X".
150151 static std::string FormatHexInt(int value);
152
153 // Formats an int value as "%X".
154 static std::string FormatHexUInt32(UInt32 value);
151155
152156 // Formats a byte as "%02X".
153157 static std::string FormatByte(unsigned char value);
3030 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
3131 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3232
33
3433 // Type utilities needed for implementing typed and type-parameterized
3534 // tests. This file is generated by a SCRIPT. DO NOT EDIT BY HAND!
3635 //
3736 // Currently we support at most 50 types in a list, and at most 50
38 // type-parameterized tests in one type-parameterized test case.
37 // type-parameterized tests in one type-parameterized test suite.
3938 // Please contact googletestframework@googlegroups.com if you need
4039 // more.
4140
8887 # if GTEST_HAS_CXXABI_H_
8988 using abi::__cxa_demangle;
9089 # endif // GTEST_HAS_CXXABI_H_
91 char* const readable_name = __cxa_demangle(name, 0, 0, &status);
90 char* const readable_name = __cxa_demangle(name, nullptr, nullptr, &status);
9291 const std::string name_str(status == 0 ? readable_name : name);
9392 free(readable_name);
9493 return CanonicalizeForStdLibVersioning(name_str);
104103 }
105104
106105 #if GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P
107
108 // AssertyTypeEq<T1, T2>::type is defined iff T1 and T2 are the same
109 // type. This can be used as a compile-time assertion to ensure that
110 // two types are equal.
111
112 template <typename T1, typename T2>
113 struct AssertTypeEq;
114
115 template <typename T>
116 struct AssertTypeEq<T, T> {
117 typedef bool type;
118 };
119106
120107 // A unique type used as the default value for the arguments of class
121108 // template Types. This allows us to simulate variadic templates
33113298 };
33123299
33133300 // The TypeList template makes it possible to use either a single type
3314 // or a Types<...> list in TYPED_TEST_CASE() and
3315 // INSTANTIATE_TYPED_TEST_CASE_P().
3301 // or a Types<...> list in TYPED_TEST_SUITE() and
3302 // INSTANTIATE_TYPED_TEST_SUITE_P().
33163303
33173304 template <typename T>
33183305 struct TypeList {
4040 #include "src/gtest.cc"
4141 #include "src/gtest-death-test.cc"
4242 #include "src/gtest-filepath.cc"
43 #include "src/gtest-matchers.cc"
4344 #include "src/gtest-port.cc"
4445 #include "src/gtest-printers.cc"
4546 #include "src/gtest-test-part.cc"
3030 // This file implements death tests.
3131
3232 #include "gtest/gtest-death-test.h"
33
34 #include <utility>
35
3336 #include "gtest/internal/gtest-port.h"
3437 #include "gtest/internal/custom/gtest.h"
3538
6164 # endif // GTEST_OS_QNX
6265
6366 # if GTEST_OS_FUCHSIA
67 # include <lib/fdio/fd.h>
6468 # include <lib/fdio/io.h>
6569 # include <lib/fdio/spawn.h>
70 # include <lib/zx/channel.h>
71 # include <lib/zx/port.h>
72 # include <lib/zx/process.h>
73 # include <lib/zx/socket.h>
6674 # include <zircon/processargs.h>
6775 # include <zircon/syscalls.h>
76 # include <zircon/syscalls/policy.h>
6877 # include <zircon/syscalls/port.h>
6978 # endif // GTEST_OS_FUCHSIA
7079
112121 "Indicates the file, line number, temporal index of "
113122 "the single death test to run, and a file descriptor to "
114123 "which a success code may be sent, all separated by "
115 "the '|' characters. This flag is specified if and only if the current "
116 "process is a sub-process launched for running a thread-safe "
124 "the '|' characters. This flag is specified if and only if the "
125 "current process is a sub-process launched for running a thread-safe "
117126 "death test. FOR INTERNAL USE ONLY.");
118127 } // namespace internal
119128
265274 // statement, which is not allowed; THREW means that the test statement
266275 // returned control by throwing an exception. IN_PROGRESS means the test
267276 // has not yet concluded.
268 // FIXME: Unify names and possibly values for
269 // AbortReason, DeathTestOutcome, and flag characters above.
270277 enum DeathTestOutcome { IN_PROGRESS, DIED, LIVED, RETURNED, THREW };
271278
272279 // Routine for aborting the program which is safe to call from an
280287 // the heap for any additional non-minuscule memory requirements.
281288 const InternalRunDeathTestFlag* const flag =
282289 GetUnitTestImpl()->internal_run_death_test_flag();
283 if (flag != NULL) {
290 if (flag != nullptr) {
284291 FILE* parent = posix::FDOpen(flag->write_fd(), "w");
285292 fputc(kDeathTestInternalError, parent);
286293 fprintf(parent, "%s", message.c_str());
360367 // for the current test.
361368 DeathTest::DeathTest() {
362369 TestInfo* const info = GetUnitTestImpl()->current_test_info();
363 if (info == NULL) {
370 if (info == nullptr) {
364371 DeathTestAbort("Cannot run a death test outside of a TEST or "
365372 "TEST_F construct");
366373 }
368375
369376 // Creates and returns a death test by dispatching to the current
370377 // death test factory.
371 bool DeathTest::Create(const char* statement, const RE* regex,
372 const char* file, int line, DeathTest** test) {
378 bool DeathTest::Create(const char* statement,
379 Matcher<const std::string&> matcher, const char* file,
380 int line, DeathTest** test) {
373381 return GetUnitTestImpl()->death_test_factory()->Create(
374 statement, regex, file, line, test);
382 statement, std::move(matcher), file, line, test);
375383 }
376384
377385 const char* DeathTest::LastMessage() {
387395 // Provides cross platform implementation for some death functionality.
388396 class DeathTestImpl : public DeathTest {
389397 protected:
390 DeathTestImpl(const char* a_statement, const RE* a_regex)
398 DeathTestImpl(const char* a_statement, Matcher<const std::string&> matcher)
391399 : statement_(a_statement),
392 regex_(a_regex),
400 matcher_(std::move(matcher)),
393401 spawned_(false),
394402 status_(-1),
395403 outcome_(IN_PROGRESS),
397405 write_fd_(-1) {}
398406
399407 // read_fd_ is expected to be closed and cleared by a derived class.
400 ~DeathTestImpl() { GTEST_DEATH_TEST_CHECK_(read_fd_ == -1); }
401
402 void Abort(AbortReason reason);
403 virtual bool Passed(bool status_ok);
408 ~DeathTestImpl() override { GTEST_DEATH_TEST_CHECK_(read_fd_ == -1); }
409
410 void Abort(AbortReason reason) override;
411 bool Passed(bool status_ok) override;
404412
405413 const char* statement() const { return statement_; }
406 const RE* regex() const { return regex_; }
407414 bool spawned() const { return spawned_; }
408415 void set_spawned(bool is_spawned) { spawned_ = is_spawned; }
409416 int status() const { return status_; }
421428 // case of unexpected codes.
422429 void ReadAndInterpretStatusByte();
423430
431 // Returns stderr output from the child process.
432 virtual std::string GetErrorLogs();
433
424434 private:
425435 // The textual content of the code this object is testing. This class
426436 // doesn't own this string and should not attempt to delete it.
427437 const char* const statement_;
428 // The regular expression which test output must match. DeathTestImpl
429 // doesn't own this object and should not attempt to delete it.
430 const RE* const regex_;
438 // A matcher that's expected to match the stderr output by the child process.
439 Matcher<const std::string&> matcher_;
431440 // True if the death test child process has been successfully spawned.
432441 bool spawned_;
433442 // The exit status of the child process.
489498 set_read_fd(-1);
490499 }
491500
501 std::string DeathTestImpl::GetErrorLogs() {
502 return GetCapturedStderr();
503 }
504
492505 // Signals that the death test code which should have exited, didn't.
493506 // Should be called only in a death test child process.
494507 // Writes a status byte to the child's status file descriptor, then
542555 // in the format specified by wait(2). On Windows, this is the
543556 // value supplied to the ExitProcess() API or a numeric code
544557 // of the exception that terminated the program.
545 // regex: A regular expression object to be applied to
546 // the test's captured standard error output; the death test
547 // fails if it does not match.
558 // matcher_: A matcher that's expected to match the stderr output by the child
559 // process.
548560 //
549561 // Argument:
550562 // status_ok: true if exit_status is acceptable in the context of
551563 // this particular death test, which fails if it is false
552564 //
553 // Returns true iff all of the above conditions are met. Otherwise, the
554 // first failing condition, in the order given above, is the one that is
565 // Returns true if and only if all of the above conditions are met. Otherwise,
566 // the first failing condition, in the order given above, is the one that is
555567 // reported. Also sets the last death test message string.
556568 bool DeathTestImpl::Passed(bool status_ok) {
557569 if (!spawned())
558570 return false;
559571
560 const std::string error_message = GetCapturedStderr();
572 const std::string error_message = GetErrorLogs();
561573
562574 bool success = false;
563575 Message buffer;
578590 break;
579591 case DIED:
580592 if (status_ok) {
581 # if GTEST_USES_PCRE
582 // PCRE regexes support embedded NULs.
583 const bool matched = RE::PartialMatch(error_message, *regex());
584 # else
585 const bool matched = RE::PartialMatch(error_message.c_str(), *regex());
586 # endif // GTEST_USES_PCRE
587 if (matched) {
593 if (matcher_.Matches(error_message)) {
588594 success = true;
589595 } else {
596 std::ostringstream stream;
597 matcher_.DescribeTo(&stream);
590598 buffer << " Result: died but not with expected error.\n"
591 << " Expected: " << regex()->pattern() << "\n"
592 << "Actual msg:\n" << FormatDeathTestOutput(error_message);
599 << " Expected: " << stream.str() << "\n"
600 << "Actual msg:\n"
601 << FormatDeathTestOutput(error_message);
593602 }
594603 } else {
595604 buffer << " Result: died but not with expected exit code:\n"
638647 //
639648 class WindowsDeathTest : public DeathTestImpl {
640649 public:
641 WindowsDeathTest(const char* a_statement,
642 const RE* a_regex,
643 const char* file,
644 int line)
645 : DeathTestImpl(a_statement, a_regex), file_(file), line_(line) {}
650 WindowsDeathTest(const char* a_statement, Matcher<const std::string&> matcher,
651 const char* file, int line)
652 : DeathTestImpl(a_statement, std::move(matcher)),
653 file_(file),
654 line_(line) {}
646655
647656 // All of these virtual functions are inherited from DeathTest.
648657 virtual int Wait();
719728 const TestInfo* const info = impl->current_test_info();
720729 const int death_test_index = info->result()->death_test_count();
721730
722 if (flag != NULL) {
731 if (flag != nullptr) {
723732 // ParseInternalRunDeathTestFlag() has performed all the necessary
724733 // processing.
725734 set_write_fd(flag->write_fd());
728737
729738 // WindowsDeathTest uses an anonymous pipe to communicate results of
730739 // a death test.
731 SECURITY_ATTRIBUTES handles_are_inheritable = {
732 sizeof(SECURITY_ATTRIBUTES), NULL, TRUE };
740 SECURITY_ATTRIBUTES handles_are_inheritable = {sizeof(SECURITY_ATTRIBUTES),
741 nullptr, TRUE};
733742 HANDLE read_handle, write_handle;
734743 GTEST_DEATH_TEST_CHECK_(
735744 ::CreatePipe(&read_handle, &write_handle, &handles_are_inheritable,
740749 write_handle_.Reset(write_handle);
741750 event_handle_.Reset(::CreateEvent(
742751 &handles_are_inheritable,
743 TRUE, // The event will automatically reset to non-signaled state.
744 FALSE, // The initial state is non-signalled.
745 NULL)); // The even is unnamed.
746 GTEST_DEATH_TEST_CHECK_(event_handle_.Get() != NULL);
747 const std::string filter_flag =
748 std::string("--") + GTEST_FLAG_PREFIX_ + kFilterFlag + "=" +
749 info->test_case_name() + "." + info->name();
752 TRUE, // The event will automatically reset to non-signaled state.
753 FALSE, // The initial state is non-signalled.
754 nullptr)); // The even is unnamed.
755 GTEST_DEATH_TEST_CHECK_(event_handle_.Get() != nullptr);
756 const std::string filter_flag = std::string("--") + GTEST_FLAG_PREFIX_ +
757 kFilterFlag + "=" + info->test_suite_name() +
758 "." + info->name();
750759 const std::string internal_flag =
751760 std::string("--") + GTEST_FLAG_PREFIX_ + kInternalRunDeathTestFlag +
752761 "=" + file_ + "|" + StreamableToString(line_) + "|" +
759768 "|" + StreamableToString(reinterpret_cast<size_t>(event_handle_.Get()));
760769
761770 char executable_path[_MAX_PATH + 1]; // NOLINT
762 GTEST_DEATH_TEST_CHECK_(
763 _MAX_PATH + 1 != ::GetModuleFileNameA(NULL,
764 executable_path,
765 _MAX_PATH));
771 GTEST_DEATH_TEST_CHECK_(_MAX_PATH + 1 != ::GetModuleFileNameA(nullptr,
772 executable_path,
773 _MAX_PATH));
766774
767775 std::string command_line =
768776 std::string(::GetCommandLineA()) + " " + filter_flag + " \"" +
783791 startup_info.hStdError = ::GetStdHandle(STD_ERROR_HANDLE);
784792
785793 PROCESS_INFORMATION process_info;
786 GTEST_DEATH_TEST_CHECK_(::CreateProcessA(
787 executable_path,
788 const_cast<char*>(command_line.c_str()),
789 NULL, // Retuned process handle is not inheritable.
790 NULL, // Retuned thread handle is not inheritable.
791 TRUE, // Child inherits all inheritable handles (for write_handle_).
792 0x0, // Default creation flags.
793 NULL, // Inherit the parent's environment.
794 UnitTest::GetInstance()->original_working_dir(),
795 &startup_info,
796 &process_info) != FALSE);
794 GTEST_DEATH_TEST_CHECK_(
795 ::CreateProcessA(
796 executable_path, const_cast<char*>(command_line.c_str()),
797 nullptr, // Retuned process handle is not inheritable.
798 nullptr, // Retuned thread handle is not inheritable.
799 TRUE, // Child inherits all inheritable handles (for write_handle_).
800 0x0, // Default creation flags.
801 nullptr, // Inherit the parent's environment.
802 UnitTest::GetInstance()->original_working_dir(), &startup_info,
803 &process_info) != FALSE);
797804 child_handle_.Reset(process_info.hProcess);
798805 ::CloseHandle(process_info.hThread);
799806 set_spawned(true);
804811
805812 class FuchsiaDeathTest : public DeathTestImpl {
806813 public:
807 FuchsiaDeathTest(const char* a_statement,
808 const RE* a_regex,
809 const char* file,
810 int line)
811 : DeathTestImpl(a_statement, a_regex), file_(file), line_(line) {}
812 virtual ~FuchsiaDeathTest() {
813 zx_status_t status = zx_handle_close(child_process_);
814 GTEST_DEATH_TEST_CHECK_(status == ZX_OK);
815 status = zx_handle_close(port_);
816 GTEST_DEATH_TEST_CHECK_(status == ZX_OK);
817 }
814 FuchsiaDeathTest(const char* a_statement, Matcher<const std::string&> matcher,
815 const char* file, int line)
816 : DeathTestImpl(a_statement, std::move(matcher)),
817 file_(file),
818 line_(line) {}
818819
819820 // All of these virtual functions are inherited from DeathTest.
820 virtual int Wait();
821 virtual TestRole AssumeRole();
821 int Wait() override;
822 TestRole AssumeRole() override;
823 std::string GetErrorLogs() override;
822824
823825 private:
824826 // The name of the file in which the death test is located.
825827 const char* const file_;
826828 // The line number on which the death test is located.
827829 const int line_;
828
829 zx_handle_t child_process_ = ZX_HANDLE_INVALID;
830 zx_handle_t port_ = ZX_HANDLE_INVALID;
830 // The stderr data captured by the child process.
831 std::string captured_stderr_;
832
833 zx::process child_process_;
834 zx::channel exception_channel_;
835 zx::socket stderr_socket_;
831836 };
832837
833838 // Utility class for accumulating command-line arguments.
834839 class Arguments {
835840 public:
836 Arguments() {
837 args_.push_back(NULL);
838 }
841 Arguments() { args_.push_back(nullptr); }
839842
840843 ~Arguments() {
841844 for (std::vector<char*>::iterator i = args_.begin(); i != args_.end();
871874 // status, or 0 if no child process exists. As a side effect, sets the
872875 // outcome data member.
873876 int FuchsiaDeathTest::Wait() {
877 const int kProcessKey = 0;
878 const int kSocketKey = 1;
879 const int kExceptionKey = 2;
880
874881 if (!spawned())
875882 return 0;
876883
884 // Create a port to wait for socket/task/exception events.
885 zx_status_t status_zx;
886 zx::port port;
887 status_zx = zx::port::create(0, &port);
888 GTEST_DEATH_TEST_CHECK_(status_zx == ZX_OK);
889
877890 // Register to wait for the child process to terminate.
878 zx_status_t status_zx;
879 status_zx = zx_object_wait_async(child_process_,
880 port_,
881 0 /* key */,
882 ZX_PROCESS_TERMINATED,
883 ZX_WAIT_ASYNC_ONCE);
891 status_zx = child_process_.wait_async(
892 port, kProcessKey, ZX_PROCESS_TERMINATED, ZX_WAIT_ASYNC_ONCE);
884893 GTEST_DEATH_TEST_CHECK_(status_zx == ZX_OK);
885894
886 // Wait for it to terminate, or an exception to be received.
887 zx_port_packet_t packet;
888 status_zx = zx_port_wait(port_, ZX_TIME_INFINITE, &packet);
895 // Register to wait for the socket to be readable or closed.
896 status_zx = stderr_socket_.wait_async(
897 port, kSocketKey, ZX_SOCKET_READABLE | ZX_SOCKET_PEER_CLOSED,
898 ZX_WAIT_ASYNC_ONCE);
889899 GTEST_DEATH_TEST_CHECK_(status_zx == ZX_OK);
890900
891 if (ZX_PKT_IS_EXCEPTION(packet.type)) {
892 // Process encountered an exception. Kill it directly rather than letting
893 // other handlers process the event.
894 status_zx = zx_task_kill(child_process_);
901 // Register to wait for an exception.
902 status_zx = exception_channel_.wait_async(
903 port, kExceptionKey, ZX_CHANNEL_READABLE, ZX_WAIT_ASYNC_ONCE);
904 GTEST_DEATH_TEST_CHECK_(status_zx == ZX_OK);
905
906 bool process_terminated = false;
907 bool socket_closed = false;
908 do {
909 zx_port_packet_t packet = {};
910 status_zx = port.wait(zx::time::infinite(), &packet);
895911 GTEST_DEATH_TEST_CHECK_(status_zx == ZX_OK);
896912
897 // Now wait for |child_process_| to terminate.
898 zx_signals_t signals = 0;
899 status_zx = zx_object_wait_one(
900 child_process_, ZX_PROCESS_TERMINATED, ZX_TIME_INFINITE, &signals);
901 GTEST_DEATH_TEST_CHECK_(status_zx == ZX_OK);
902 GTEST_DEATH_TEST_CHECK_(signals & ZX_PROCESS_TERMINATED);
903 } else {
904 // Process terminated.
905 GTEST_DEATH_TEST_CHECK_(ZX_PKT_IS_SIGNAL_ONE(packet.type));
906 GTEST_DEATH_TEST_CHECK_(packet.signal.observed & ZX_PROCESS_TERMINATED);
907 }
913 if (packet.key == kExceptionKey) {
914 // Process encountered an exception. Kill it directly rather than
915 // letting other handlers process the event. We will get a kProcessKey
916 // event when the process actually terminates.
917 status_zx = child_process_.kill();
918 GTEST_DEATH_TEST_CHECK_(status_zx == ZX_OK);
919 } else if (packet.key == kProcessKey) {
920 // Process terminated.
921 GTEST_DEATH_TEST_CHECK_(ZX_PKT_IS_SIGNAL_ONE(packet.type));
922 GTEST_DEATH_TEST_CHECK_(packet.signal.observed & ZX_PROCESS_TERMINATED);
923 process_terminated = true;
924 } else if (packet.key == kSocketKey) {
925 GTEST_DEATH_TEST_CHECK_(ZX_PKT_IS_SIGNAL_ONE(packet.type));
926 if (packet.signal.observed & ZX_SOCKET_READABLE) {
927 // Read data from the socket.
928 constexpr size_t kBufferSize = 1024;
929 do {
930 size_t old_length = captured_stderr_.length();
931 size_t bytes_read = 0;
932 captured_stderr_.resize(old_length + kBufferSize);
933 status_zx = stderr_socket_.read(
934 0, &captured_stderr_.front() + old_length, kBufferSize,
935 &bytes_read);
936 captured_stderr_.resize(old_length + bytes_read);
937 } while (status_zx == ZX_OK);
938 if (status_zx == ZX_ERR_PEER_CLOSED) {
939 socket_closed = true;
940 } else {
941 GTEST_DEATH_TEST_CHECK_(status_zx == ZX_ERR_SHOULD_WAIT);
942 status_zx = stderr_socket_.wait_async(
943 port, kSocketKey, ZX_SOCKET_READABLE | ZX_SOCKET_PEER_CLOSED,
944 ZX_WAIT_ASYNC_ONCE);
945 GTEST_DEATH_TEST_CHECK_(status_zx == ZX_OK);
946 }
947 } else {
948 GTEST_DEATH_TEST_CHECK_(packet.signal.observed & ZX_SOCKET_PEER_CLOSED);
949 socket_closed = true;
950 }
951 }
952 } while (!process_terminated && !socket_closed);
908953
909954 ReadAndInterpretStatusByte();
910955
911956 zx_info_process_t buffer;
912 status_zx = zx_object_get_info(
913 child_process_,
914 ZX_INFO_PROCESS,
915 &buffer,
916 sizeof(buffer),
917 nullptr,
918 nullptr);
957 status_zx = child_process_.get_info(
958 ZX_INFO_PROCESS, &buffer, sizeof(buffer), nullptr, nullptr);
919959 GTEST_DEATH_TEST_CHECK_(status_zx == ZX_OK);
920960
921961 GTEST_DEATH_TEST_CHECK_(buffer.exited);
935975 const TestInfo* const info = impl->current_test_info();
936976 const int death_test_index = info->result()->death_test_count();
937977
938 if (flag != NULL) {
978 if (flag != nullptr) {
939979 // ParseInternalRunDeathTestFlag() has performed all the necessary
940980 // processing.
941981 set_write_fd(kFuchsiaReadPipeFd);
942982 return EXECUTE_TEST;
943983 }
944984
945 CaptureStderr();
946985 // Flush the log buffers since the log streams are shared with the child.
947986 FlushInfoLog();
948987
949988 // Build the child process command line.
950 const std::string filter_flag =
951 std::string("--") + GTEST_FLAG_PREFIX_ + kFilterFlag + "="
952 + info->test_case_name() + "." + info->name();
989 const std::string filter_flag = std::string("--") + GTEST_FLAG_PREFIX_ +
990 kFilterFlag + "=" + info->test_suite_name() +
991 "." + info->name();
953992 const std::string internal_flag =
954993 std::string("--") + GTEST_FLAG_PREFIX_ + kInternalRunDeathTestFlag + "="
955994 + file_ + "|"
9631002 // Build the pipe for communication with the child.
9641003 zx_status_t status;
9651004 zx_handle_t child_pipe_handle;
966 uint32_t type;
967 status = fdio_pipe_half(&child_pipe_handle, &type);
1005 int child_pipe_fd;
1006 status = fdio_pipe_half(&child_pipe_fd, &child_pipe_handle);
1007 GTEST_DEATH_TEST_CHECK_(status == ZX_OK);
1008 set_read_fd(child_pipe_fd);
1009
1010 // Set the pipe handle for the child.
1011 fdio_spawn_action_t spawn_actions[2] = {};
1012 fdio_spawn_action_t* add_handle_action = &spawn_actions[0];
1013 add_handle_action->action = FDIO_SPAWN_ACTION_ADD_HANDLE;
1014 add_handle_action->h.id = PA_HND(PA_FD, kFuchsiaReadPipeFd);
1015 add_handle_action->h.handle = child_pipe_handle;
1016
1017 // Create a socket pair will be used to receive the child process' stderr.
1018 zx::socket stderr_producer_socket;
1019 status =
1020 zx::socket::create(0, &stderr_producer_socket, &stderr_socket_);
9681021 GTEST_DEATH_TEST_CHECK_(status >= 0);
969 set_read_fd(status);
970
971 // Set the pipe handle for the child.
972 fdio_spawn_action_t add_handle_action = {};
973 add_handle_action.action = FDIO_SPAWN_ACTION_ADD_HANDLE;
974 add_handle_action.h.id = PA_HND(type, kFuchsiaReadPipeFd);
975 add_handle_action.h.handle = child_pipe_handle;
1022 int stderr_producer_fd = -1;
1023 status =
1024 fdio_fd_create(stderr_producer_socket.release(), &stderr_producer_fd);
1025 GTEST_DEATH_TEST_CHECK_(status >= 0);
1026
1027 // Make the stderr socket nonblocking.
1028 GTEST_DEATH_TEST_CHECK_(fcntl(stderr_producer_fd, F_SETFL, 0) == 0);
1029
1030 fdio_spawn_action_t* add_stderr_action = &spawn_actions[1];
1031 add_stderr_action->action = FDIO_SPAWN_ACTION_CLONE_FD;
1032 add_stderr_action->fd.local_fd = stderr_producer_fd;
1033 add_stderr_action->fd.target_fd = STDERR_FILENO;
1034
1035 // Create a child job.
1036 zx_handle_t child_job = ZX_HANDLE_INVALID;
1037 status = zx_job_create(zx_job_default(), 0, & child_job);
1038 GTEST_DEATH_TEST_CHECK_(status == ZX_OK);
1039 zx_policy_basic_t policy;
1040 policy.condition = ZX_POL_NEW_ANY;
1041 policy.policy = ZX_POL_ACTION_ALLOW;
1042 status = zx_job_set_policy(
1043 child_job, ZX_JOB_POL_RELATIVE, ZX_JOB_POL_BASIC, &policy, 1);
1044 GTEST_DEATH_TEST_CHECK_(status == ZX_OK);
1045
1046 // Create an exception channel attached to the |child_job|, to allow
1047 // us to suppress the system default exception handler from firing.
1048 status =
1049 zx_task_create_exception_channel(
1050 child_job, 0, exception_channel_.reset_and_get_address());
1051 GTEST_DEATH_TEST_CHECK_(status == ZX_OK);
9761052
9771053 // Spawn the child process.
978 status = fdio_spawn_etc(ZX_HANDLE_INVALID, FDIO_SPAWN_CLONE_ALL,
979 args.Argv()[0], args.Argv(), nullptr, 1,
980 &add_handle_action, &child_process_, nullptr);
981 GTEST_DEATH_TEST_CHECK_(status == ZX_OK);
982
983 // Create an exception port and attach it to the |child_process_|, to allow
984 // us to suppress the system default exception handler from firing.
985 status = zx_port_create(0, &port_);
986 GTEST_DEATH_TEST_CHECK_(status == ZX_OK);
987 status = zx_task_bind_exception_port(
988 child_process_, port_, 0 /* key */, 0 /*options */);
1054 status = fdio_spawn_etc(
1055 child_job, FDIO_SPAWN_CLONE_ALL, args.Argv()[0], args.Argv(), nullptr,
1056 2, spawn_actions, child_process_.reset_and_get_address(), nullptr);
9891057 GTEST_DEATH_TEST_CHECK_(status == ZX_OK);
9901058
9911059 set_spawned(true);
9921060 return OVERSEE_TEST;
1061 }
1062
1063 std::string FuchsiaDeathTest::GetErrorLogs() {
1064 return captured_stderr_;
9931065 }
9941066
9951067 #else // We are neither on Windows, nor on Fuchsia.
9991071 // left undefined.
10001072 class ForkingDeathTest : public DeathTestImpl {
10011073 public:
1002 ForkingDeathTest(const char* statement, const RE* regex);
1074 ForkingDeathTest(const char* statement, Matcher<const std::string&> matcher);
10031075
10041076 // All of these virtual functions are inherited from DeathTest.
1005 virtual int Wait();
1077 int Wait() override;
10061078
10071079 protected:
10081080 void set_child_pid(pid_t child_pid) { child_pid_ = child_pid; }
10131085 };
10141086
10151087 // Constructs a ForkingDeathTest.
1016 ForkingDeathTest::ForkingDeathTest(const char* a_statement, const RE* a_regex)
1017 : DeathTestImpl(a_statement, a_regex),
1018 child_pid_(-1) {}
1088 ForkingDeathTest::ForkingDeathTest(const char* a_statement,
1089 Matcher<const std::string&> matcher)
1090 : DeathTestImpl(a_statement, std::move(matcher)), child_pid_(-1) {}
10191091
10201092 // Waits for the child in a death test to exit, returning its exit
10211093 // status, or 0 if no child process exists. As a side effect, sets the
10361108 // in the child process.
10371109 class NoExecDeathTest : public ForkingDeathTest {
10381110 public:
1039 NoExecDeathTest(const char* a_statement, const RE* a_regex) :
1040 ForkingDeathTest(a_statement, a_regex) { }
1041 virtual TestRole AssumeRole();
1111 NoExecDeathTest(const char* a_statement, Matcher<const std::string&> matcher)
1112 : ForkingDeathTest(a_statement, std::move(matcher)) {}
1113 TestRole AssumeRole() override;
10421114 };
10431115
10441116 // The AssumeRole process for a fork-and-run death test. It implements a
10911163 // only this specific death test to be run.
10921164 class ExecDeathTest : public ForkingDeathTest {
10931165 public:
1094 ExecDeathTest(const char* a_statement, const RE* a_regex,
1095 const char* file, int line) :
1096 ForkingDeathTest(a_statement, a_regex), file_(file), line_(line) { }
1097 virtual TestRole AssumeRole();
1166 ExecDeathTest(const char* a_statement, Matcher<const std::string&> matcher,
1167 const char* file, int line)
1168 : ForkingDeathTest(a_statement, std::move(matcher)),
1169 file_(file),
1170 line_(line) {}
1171 TestRole AssumeRole() override;
1172
10981173 private:
10991174 static ::std::vector<std::string> GetArgvsForDeathTestChildProcess() {
11001175 ::std::vector<std::string> args = GetInjectableArgvs();
11141189 // Utility class for accumulating command-line arguments.
11151190 class Arguments {
11161191 public:
1117 Arguments() {
1118 args_.push_back(NULL);
1119 }
1192 Arguments() { args_.push_back(nullptr); }
11201193
11211194 ~Arguments() {
11221195 for (std::vector<char*>::iterator i = args_.begin(); i != args_.end();
12101283 // correct answer.
12111284 static void StackLowerThanAddress(const void* ptr,
12121285 bool* result) GTEST_NO_INLINE_;
1286 // HWAddressSanitizer add a random tag to the MSB of the local variable address,
1287 // making comparison result unpredictable.
1288 GTEST_ATTRIBUTE_NO_SANITIZE_HWADDRESS_
12131289 static void StackLowerThanAddress(const void* ptr, bool* result) {
12141290 int dummy;
12151291 *result = (&dummy < ptr);
12171293
12181294 // Make sure AddressSanitizer does not tamper with the stack here.
12191295 GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_
1296 GTEST_ATTRIBUTE_NO_SANITIZE_HWADDRESS_
12201297 static bool StackGrowsDown() {
12211298 int dummy;
12221299 bool result;
12611338 fd_flags | FD_CLOEXEC));
12621339 struct inheritance inherit = {0};
12631340 // spawn is a system call.
1264 child_pid = spawn(args.argv[0], 0, NULL, &inherit, args.argv, GetEnviron());
1341 child_pid =
1342 spawn(args.argv[0], 0, nullptr, &inherit, args.argv, GetEnviron());
12651343 // Restores the current working directory.
12661344 GTEST_DEATH_TEST_CHECK_(fchdir(cwd_fd) != -1);
12671345 GTEST_DEATH_TEST_CHECK_SYSCALL_(close(cwd_fd));
12851363
12861364 if (!use_fork) {
12871365 static const bool stack_grows_down = StackGrowsDown();
1288 const size_t stack_size = getpagesize();
1366 const auto stack_size = static_cast<size_t>(getpagesize());
12891367 // MMAP_ANONYMOUS is not defined on Mac, so we use MAP_ANON instead.
1290 void* const stack = mmap(NULL, stack_size, PROT_READ | PROT_WRITE,
1368 void* const stack = mmap(nullptr, stack_size, PROT_READ | PROT_WRITE,
12911369 MAP_ANON | MAP_PRIVATE, -1, 0);
12921370 GTEST_DEATH_TEST_CHECK_(stack != MAP_FAILED);
12931371
13011379 void* const stack_top =
13021380 static_cast<char*>(stack) +
13031381 (stack_grows_down ? stack_size - kMaxStackAlignment : 0);
1304 GTEST_DEATH_TEST_CHECK_(stack_size > kMaxStackAlignment &&
1305 reinterpret_cast<intptr_t>(stack_top) % kMaxStackAlignment == 0);
1382 GTEST_DEATH_TEST_CHECK_(
1383 static_cast<size_t>(stack_size) > kMaxStackAlignment &&
1384 reinterpret_cast<uintptr_t>(stack_top) % kMaxStackAlignment == 0);
13061385
13071386 child_pid = clone(&ExecDeathTestChildMain, stack_top, SIGCHLD, &args);
13081387
13191398 # endif // GTEST_OS_QNX
13201399 # if GTEST_OS_LINUX
13211400 GTEST_DEATH_TEST_CHECK_SYSCALL_(
1322 sigaction(SIGPROF, &saved_sigprof_action, NULL));
1401 sigaction(SIGPROF, &saved_sigprof_action, nullptr));
13231402 # endif // GTEST_OS_LINUX
13241403
13251404 GTEST_DEATH_TEST_CHECK_(child_pid != -1);
13371416 const TestInfo* const info = impl->current_test_info();
13381417 const int death_test_index = info->result()->death_test_count();
13391418
1340 if (flag != NULL) {
1419 if (flag != nullptr) {
13411420 set_write_fd(flag->write_fd());
13421421 return EXECUTE_TEST;
13431422 }
13481427 // it be closed when the child process does an exec:
13491428 GTEST_DEATH_TEST_CHECK_(fcntl(pipe_fd[1], F_SETFD, 0) != -1);
13501429
1351 const std::string filter_flag =
1352 std::string("--") + GTEST_FLAG_PREFIX_ + kFilterFlag + "="
1353 + info->test_case_name() + "." + info->name();
1430 const std::string filter_flag = std::string("--") + GTEST_FLAG_PREFIX_ +
1431 kFilterFlag + "=" + info->test_suite_name() +
1432 "." + info->name();
13541433 const std::string internal_flag =
13551434 std::string("--") + GTEST_FLAG_PREFIX_ + kInternalRunDeathTestFlag + "="
13561435 + file_ + "|" + StreamableToString(line_) + "|"
13831462 // by the "test" argument to its address. If the test should be
13841463 // skipped, sets that pointer to NULL. Returns true, unless the
13851464 // flag is set to an invalid value.
1386 bool DefaultDeathTestFactory::Create(const char* statement, const RE* regex,
1465 bool DefaultDeathTestFactory::Create(const char* statement,
1466 Matcher<const std::string&> matcher,
13871467 const char* file, int line,
13881468 DeathTest** test) {
13891469 UnitTestImpl* const impl = GetUnitTestImpl();
13921472 const int death_test_index = impl->current_test_info()
13931473 ->increment_death_test_count();
13941474
1395 if (flag != NULL) {
1475 if (flag != nullptr) {
13961476 if (death_test_index > flag->index()) {
13971477 DeathTest::set_last_death_test_message(
13981478 "Death test count (" + StreamableToString(death_test_index)
14031483
14041484 if (!(flag->file() == file && flag->line() == line &&
14051485 flag->index() == death_test_index)) {
1406 *test = NULL;
1486 *test = nullptr;
14071487 return true;
14081488 }
14091489 }
14121492
14131493 if (GTEST_FLAG(death_test_style) == "threadsafe" ||
14141494 GTEST_FLAG(death_test_style) == "fast") {
1415 *test = new WindowsDeathTest(statement, regex, file, line);
1495 *test = new WindowsDeathTest(statement, std::move(matcher), file, line);
14161496 }
14171497
14181498 # elif GTEST_OS_FUCHSIA
14191499
14201500 if (GTEST_FLAG(death_test_style) == "threadsafe" ||
14211501 GTEST_FLAG(death_test_style) == "fast") {
1422 *test = new FuchsiaDeathTest(statement, regex, file, line);
1502 *test = new FuchsiaDeathTest(statement, std::move(matcher), file, line);
14231503 }
14241504
14251505 # else
14261506
14271507 if (GTEST_FLAG(death_test_style) == "threadsafe") {
1428 *test = new ExecDeathTest(statement, regex, file, line);
1508 *test = new ExecDeathTest(statement, std::move(matcher), file, line);
14291509 } else if (GTEST_FLAG(death_test_style) == "fast") {
1430 *test = new NoExecDeathTest(statement, regex);
1510 *test = new NoExecDeathTest(statement, std::move(matcher));
14311511 }
14321512
14331513 # endif // GTEST_OS_WINDOWS
14571537 StreamableToString(parent_process_id));
14581538 }
14591539
1460 // FIXME: Replace the following check with a
1461 // compile-time assertion when available.
14621540 GTEST_CHECK_(sizeof(HANDLE) <= sizeof(size_t));
14631541
14641542 const HANDLE write_handle =
15141592 // initialized from the GTEST_FLAG(internal_run_death_test) flag if
15151593 // the flag is specified; otherwise returns NULL.
15161594 InternalRunDeathTestFlag* ParseInternalRunDeathTestFlag() {
1517 if (GTEST_FLAG(internal_run_death_test) == "") return NULL;
1595 if (GTEST_FLAG(internal_run_death_test) == "") return nullptr;
15181596
15191597 // GTEST_HAS_DEATH_TEST implies that we have ::std::string, so we
15201598 // can use it here.
3737 #elif GTEST_OS_WINDOWS
3838 # include <direct.h>
3939 # include <io.h>
40 #elif GTEST_OS_SYMBIAN
41 // Symbian OpenC has PATH_MAX in sys/syslimits.h
42 # include <sys/syslimits.h>
4340 #else
4441 # include <limits.h>
4542 # include <climits> // Some Linux distributions define PATH_MAX here.
9491
9592 // Returns the current working directory, or "" if unsuccessful.
9693 FilePath FilePath::GetCurrentDir() {
97 #if GTEST_OS_WINDOWS_MOBILE || GTEST_OS_WINDOWS_PHONE || GTEST_OS_WINDOWS_RT
98 // Windows CE doesn't have a current directory, so we just return
94 #if GTEST_OS_WINDOWS_MOBILE || GTEST_OS_WINDOWS_PHONE || \
95 GTEST_OS_WINDOWS_RT || ARDUINO || defined(ESP_PLATFORM)
96 // These platforms do not have a current directory, so we just return
9997 // something reasonable.
10098 return FilePath(kCurrentDirectoryString);
10199 #elif GTEST_OS_WINDOWS
102100 char cwd[GTEST_PATH_MAX_ + 1] = { '\0' };
103 return FilePath(_getcwd(cwd, sizeof(cwd)) == NULL ? "" : cwd);
101 return FilePath(_getcwd(cwd, sizeof(cwd)) == nullptr ? "" : cwd);
104102 #else
105103 char cwd[GTEST_PATH_MAX_ + 1] = { '\0' };
106104 char* result = getcwd(cwd, sizeof(cwd));
108106 // getcwd will likely fail in NaCl due to the sandbox, so return something
109107 // reasonable. The user may have provided a shim implementation for getcwd,
110108 // however, so fallback only when failure is detected.
111 return FilePath(result == NULL ? kCurrentDirectoryString : cwd);
109 return FilePath(result == nullptr ? kCurrentDirectoryString : cwd);
112110 # endif // GTEST_OS_NACL
113 return FilePath(result == NULL ? "" : cwd);
111 return FilePath(result == nullptr ? "" : cwd);
114112 #endif // GTEST_OS_WINDOWS_MOBILE
115113 }
116114
135133 #if GTEST_HAS_ALT_PATH_SEP_
136134 const char* const last_alt_sep = strrchr(c_str(), kAlternatePathSeparator);
137135 // Comparing two pointers of which only one is NULL is undefined.
138 if (last_alt_sep != NULL &&
139 (last_sep == NULL || last_alt_sep > last_sep)) {
136 if (last_alt_sep != nullptr &&
137 (last_sep == nullptr || last_alt_sep > last_sep)) {
140138 return last_alt_sep;
141139 }
142140 #endif
164162 const char* const last_sep = FindLastPathSeparator();
165163 std::string dir;
166164 if (last_sep) {
167 dir = std::string(c_str(), last_sep + 1 - c_str());
165 dir = std::string(c_str(), static_cast<size_t>(last_sep + 1 - c_str()));
168166 } else {
169167 dir = kCurrentDirectoryString;
170168 }
249247 // root directory per disk drive.)
250248 bool FilePath::IsRootDirectory() const {
251249 #if GTEST_OS_WINDOWS
252 // FIXME: on Windows a network share like
253 // \\server\share can be a root directory, although it cannot be the
254 // current directory. Handle this properly.
255250 return pathname_.length() == 3 && IsAbsolutePath();
256251 #else
257252 return pathname_.length() == 1 && IsPathSeparator(pathname_.c_str()[0]);
323318 #if GTEST_OS_WINDOWS_MOBILE
324319 FilePath removed_sep(this->RemoveTrailingPathSeparator());
325320 LPCWSTR unicode = String::AnsiToUtf16(removed_sep.c_str());
326 int result = CreateDirectory(unicode, NULL) ? 0 : -1;
321 int result = CreateDirectory(unicode, nullptr) ? 0 : -1;
327322 delete [] unicode;
328323 #elif GTEST_OS_WINDOWS
329324 int result = _mkdir(pathname_.c_str());
349344 // Removes any redundant separators that might be in the pathname.
350345 // For example, "bar///foo" becomes "bar/foo". Does not eliminate other
351346 // redundancies that might be in a pathname involving "." or "..".
352 // FIXME: handle Windows network shares (e.g. \\server\share).
353347 void FilePath::Normalize() {
354 if (pathname_.c_str() == NULL) {
348 if (pathname_.c_str() == nullptr) {
355349 pathname_ = "";
356350 return;
357351 }
4141 #include <string.h> // For memmove.
4242
4343 #include <algorithm>
44 #include <memory>
4445 #include <string>
4546 #include <vector>
4647
9798 // A valid random seed must be in [1, kMaxRandomSeed].
9899 const int kMaxRandomSeed = 99999;
99100
100 // g_help_flag is true iff the --help flag or an equivalent form is
101 // specified on the command line.
101 // g_help_flag is true if and only if the --help flag or an equivalent form
102 // is specified on the command line.
102103 GTEST_API_ extern bool g_help_flag;
103104
104105 // Returns the current time in milliseconds.
105106 GTEST_API_ TimeInMillis GetTimeInMillis();
106107
107 // Returns true iff Google Test should use colors in the output.
108 // Returns true if and only if Google Test should use colors in the output.
108109 GTEST_API_ bool ShouldUseColor(bool stdout_is_tty);
109110
110111 // Formats the given time in milliseconds as seconds.
229230
230231 // Converts a wide string to a narrow string in UTF-8 encoding.
231232 // The wide string is assumed to have the following encoding:
232 // UTF-16 if sizeof(wchar_t) == 2 (on Windows, Cygwin, Symbian OS)
233 // UTF-16 if sizeof(wchar_t) == 2 (on Windows, Cygwin)
233234 // UTF-32 if sizeof(wchar_t) == 4 (on Linux)
234235 // Parameter str points to a null-terminated wide string.
235236 // Parameter num_chars may additionally limit the number
264265 GTEST_API_ Int32 Int32FromEnvOrDie(const char* env_var, Int32 default_val);
265266
266267 // Given the total number of shards, the shard index, and the test id,
267 // returns true iff the test should be run on this shard. The test id is
268 // some arbitrary but unique non-negative integer assigned to each test
268 // returns true if and only if the test should be run on this shard. The test id
269 // is some arbitrary but unique non-negative integer assigned to each test
269270 // method. Assumes that 0 <= shard_index < total_shards.
270271 GTEST_API_ bool ShouldRunTestOnShard(
271272 int total_shards, int shard_index, int test_id);
296297 // in range [0, v.size()).
297298 template <typename E>
298299 inline E GetElementOr(const std::vector<E>& v, int i, E default_value) {
299 return (i < 0 || i >= static_cast<int>(v.size())) ? default_value : v[i];
300 return (i < 0 || i >= static_cast<int>(v.size())) ? default_value
301 : v[static_cast<size_t>(i)];
300302 }
301303
302304 // Performs an in-place shuffle of a range of the vector's elements.
318320 // http://en.wikipedia.org/wiki/Fisher-Yates_shuffle
319321 for (int range_width = end - begin; range_width >= 2; range_width--) {
320322 const int last_in_range = begin + range_width - 1;
321 const int selected = begin + random->Generate(range_width);
322 std::swap((*v)[selected], (*v)[last_in_range]);
323 const int selected =
324 begin +
325 static_cast<int>(random->Generate(static_cast<UInt32>(range_width)));
326 std::swap((*v)[static_cast<size_t>(selected)],
327 (*v)[static_cast<size_t>(last_in_range)]);
323328 }
324329 }
325330
346351 // TestPropertyKeyIs has NO default constructor.
347352 explicit TestPropertyKeyIs(const std::string& key) : key_(key) {}
348353
349 // Returns true iff the test name of test property matches on key_.
354 // Returns true if and only if the test name of test property matches on key_.
350355 bool operator()(const TestProperty& test_property) const {
351356 return test_property.key() == key_;
352357 }
379384
380385 // Functions for processing the gtest_filter flag.
381386
382 // Returns true iff the wildcard pattern matches the string. The
383 // first ':' or '\0' character in pattern marks the end of it.
387 // Returns true if and only if the wildcard pattern matches the string.
388 // The first ':' or '\0' character in pattern marks the end of it.
384389 //
385390 // This recursive algorithm isn't very efficient, but is clear and
386391 // works well enough for matching test names, which are short.
387392 static bool PatternMatchesString(const char *pattern, const char *str);
388393
389 // Returns true iff the user-specified filter matches the test case
390 // name and the test name.
391 static bool FilterMatchesTest(const std::string &test_case_name,
392 const std::string &test_name);
394 // Returns true if and only if the user-specified filter matches the test
395 // suite name and the test name.
396 static bool FilterMatchesTest(const std::string& test_suite_name,
397 const std::string& test_name);
393398
394399 #if GTEST_OS_WINDOWS
395400 // Function for supporting the gtest_catch_exception flag.
441446 public:
442447 OsStackTraceGetter() {}
443448
444 virtual std::string CurrentStackTrace(int max_depth, int skip_count);
445 virtual void UponLeavingGTest();
449 std::string CurrentStackTrace(int max_depth, int skip_count) override;
450 void UponLeavingGTest() override;
446451
447452 private:
448453 #if GTEST_HAS_ABSL
473478 explicit DefaultGlobalTestPartResultReporter(UnitTestImpl* unit_test);
474479 // Implements the TestPartResultReporterInterface. Reports the test part
475480 // result in the current test.
476 virtual void ReportTestPartResult(const TestPartResult& result);
481 void ReportTestPartResult(const TestPartResult& result) override;
477482
478483 private:
479484 UnitTestImpl* const unit_test_;
489494 explicit DefaultPerThreadTestPartResultReporter(UnitTestImpl* unit_test);
490495 // Implements the TestPartResultReporterInterface. The implementation just
491496 // delegates to the current global test part result reporter of *unit_test_.
492 virtual void ReportTestPartResult(const TestPartResult& result);
497 void ReportTestPartResult(const TestPartResult& result) override;
493498
494499 private:
495500 UnitTestImpl* const unit_test_;
527532 void SetTestPartResultReporterForCurrentThread(
528533 TestPartResultReporterInterface* reporter);
529534
530 // Gets the number of successful test cases.
531 int successful_test_case_count() const;
532
533 // Gets the number of failed test cases.
534 int failed_test_case_count() const;
535
536 // Gets the number of all test cases.
537 int total_test_case_count() const;
538
539 // Gets the number of all test cases that contain at least one test
535 // Gets the number of successful test suites.
536 int successful_test_suite_count() const;
537
538 // Gets the number of failed test suites.
539 int failed_test_suite_count() const;
540
541 // Gets the number of all test suites.
542 int total_test_suite_count() const;
543
544 // Gets the number of all test suites that contain at least one test
540545 // that should run.
541 int test_case_to_run_count() const;
546 int test_suite_to_run_count() const;
542547
543548 // Gets the number of successful tests.
544549 int successful_test_count() const;
550
551 // Gets the number of skipped tests.
552 int skipped_test_count() const;
545553
546554 // Gets the number of failed tests.
547555 int failed_test_count() const;
568576 // Gets the elapsed time, in milliseconds.
569577 TimeInMillis elapsed_time() const { return elapsed_time_; }
570578
571 // Returns true iff the unit test passed (i.e. all test cases passed).
579 // Returns true if and only if the unit test passed (i.e. all test suites
580 // passed).
572581 bool Passed() const { return !Failed(); }
573582
574 // Returns true iff the unit test failed (i.e. some test case failed
575 // or something outside of all tests failed).
583 // Returns true if and only if the unit test failed (i.e. some test suite
584 // failed or something outside of all tests failed).
576585 bool Failed() const {
577 return failed_test_case_count() > 0 || ad_hoc_test_result()->Failed();
578 }
579
580 // Gets the i-th test case among all the test cases. i can range from 0 to
581 // total_test_case_count() - 1. If i is not in that range, returns NULL.
582 const TestCase* GetTestCase(int i) const {
583 const int index = GetElementOr(test_case_indices_, i, -1);
584 return index < 0 ? NULL : test_cases_[i];
585 }
586
587 // Gets the i-th test case among all the test cases. i can range from 0 to
588 // total_test_case_count() - 1. If i is not in that range, returns NULL.
589 TestCase* GetMutableTestCase(int i) {
590 const int index = GetElementOr(test_case_indices_, i, -1);
591 return index < 0 ? NULL : test_cases_[index];
586 return failed_test_suite_count() > 0 || ad_hoc_test_result()->Failed();
587 }
588
589 // Gets the i-th test suite among all the test suites. i can range from 0 to
590 // total_test_suite_count() - 1. If i is not in that range, returns NULL.
591 const TestSuite* GetTestSuite(int i) const {
592 const int index = GetElementOr(test_suite_indices_, i, -1);
593 return index < 0 ? nullptr : test_suites_[static_cast<size_t>(i)];
594 }
595
596 // Legacy API is deprecated but still available
597 #ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_
598 const TestCase* GetTestCase(int i) const { return GetTestSuite(i); }
599 #endif // GTEST_REMOVE_LEGACY_TEST_CASEAPI_
600
601 // Gets the i-th test suite among all the test suites. i can range from 0 to
602 // total_test_suite_count() - 1. If i is not in that range, returns NULL.
603 TestSuite* GetMutableSuiteCase(int i) {
604 const int index = GetElementOr(test_suite_indices_, i, -1);
605 return index < 0 ? nullptr : test_suites_[static_cast<size_t>(index)];
592606 }
593607
594608 // Provides access to the event listener list.
625639 // trace but Bar() and CurrentOsStackTraceExceptTop() won't.
626640 std::string CurrentOsStackTraceExceptTop(int skip_count) GTEST_NO_INLINE_;
627641
628 // Finds and returns a TestCase with the given name. If one doesn't
642 // Finds and returns a TestSuite with the given name. If one doesn't
629643 // exist, creates one and returns it.
630644 //
631645 // Arguments:
632646 //
633 // test_case_name: name of the test case
647 // test_suite_name: name of the test suite
634648 // type_param: the name of the test's type parameter, or NULL if
635649 // this is not a typed or a type-parameterized test.
636 // set_up_tc: pointer to the function that sets up the test case
637 // tear_down_tc: pointer to the function that tears down the test case
638 TestCase* GetTestCase(const char* test_case_name,
639 const char* type_param,
640 Test::SetUpTestCaseFunc set_up_tc,
641 Test::TearDownTestCaseFunc tear_down_tc);
650 // set_up_tc: pointer to the function that sets up the test suite
651 // tear_down_tc: pointer to the function that tears down the test suite
652 TestSuite* GetTestSuite(const char* test_suite_name, const char* type_param,
653 internal::SetUpTestSuiteFunc set_up_tc,
654 internal::TearDownTestSuiteFunc tear_down_tc);
655
656 // Legacy API is deprecated but still available
657 #ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_
658 TestCase* GetTestCase(const char* test_case_name, const char* type_param,
659 internal::SetUpTestSuiteFunc set_up_tc,
660 internal::TearDownTestSuiteFunc tear_down_tc) {
661 return GetTestSuite(test_case_name, type_param, set_up_tc, tear_down_tc);
662 }
663 #endif // GTEST_REMOVE_LEGACY_TEST_CASEAPI_
642664
643665 // Adds a TestInfo to the unit test.
644666 //
645667 // Arguments:
646668 //
647 // set_up_tc: pointer to the function that sets up the test case
648 // tear_down_tc: pointer to the function that tears down the test case
669 // set_up_tc: pointer to the function that sets up the test suite
670 // tear_down_tc: pointer to the function that tears down the test suite
649671 // test_info: the TestInfo object
650 void AddTestInfo(Test::SetUpTestCaseFunc set_up_tc,
651 Test::TearDownTestCaseFunc tear_down_tc,
672 void AddTestInfo(internal::SetUpTestSuiteFunc set_up_tc,
673 internal::TearDownTestSuiteFunc tear_down_tc,
652674 TestInfo* test_info) {
653675 // In order to support thread-safe death tests, we need to
654676 // remember the original working directory when the test program
663685 << "Failed to get the current working directory.";
664686 }
665687
666 GetTestCase(test_info->test_case_name(),
667 test_info->type_param(),
668 set_up_tc,
669 tear_down_tc)->AddTestInfo(test_info);
670 }
671
672 // Returns ParameterizedTestCaseRegistry object used to keep track of
688 GetTestSuite(test_info->test_suite_name(), test_info->type_param(),
689 set_up_tc, tear_down_tc)
690 ->AddTestInfo(test_info);
691 }
692
693 // Returns ParameterizedTestSuiteRegistry object used to keep track of
673694 // value-parameterized tests and instantiate and register them.
674 internal::ParameterizedTestCaseRegistry& parameterized_test_registry() {
695 internal::ParameterizedTestSuiteRegistry& parameterized_test_registry() {
675696 return parameterized_test_registry_;
676697 }
677698
678 // Sets the TestCase object for the test that's currently running.
679 void set_current_test_case(TestCase* a_current_test_case) {
680 current_test_case_ = a_current_test_case;
699 // Sets the TestSuite object for the test that's currently running.
700 void set_current_test_suite(TestSuite* a_current_test_suite) {
701 current_test_suite_ = a_current_test_suite;
681702 }
682703
683704 // Sets the TestInfo object for the test that's currently running. If
688709 }
689710
690711 // Registers all parameterized tests defined using TEST_P and
691 // INSTANTIATE_TEST_CASE_P, creating regular tests for each test/parameter
712 // INSTANTIATE_TEST_SUITE_P, creating regular tests for each test/parameter
692713 // combination. This method can be called more then once; it has guards
693714 // protecting from registering the tests more then once. If
694715 // value-parameterized tests are disabled, RegisterParameterizedTests is
703724
704725 // Clears the results of all tests, except the ad hoc tests.
705726 void ClearNonAdHocTestResult() {
706 ForEach(test_cases_, TestCase::ClearTestCaseResult);
727 ForEach(test_suites_, TestSuite::ClearTestSuiteResult);
707728 }
708729
709730 // Clears the results of ad-hoc test assertions.
712733 }
713734
714735 // Adds a TestProperty to the current TestResult object when invoked in a
715 // context of a test or a test case, or to the global property set. If the
736 // context of a test or a test suite, or to the global property set. If the
716737 // result already contains a property with the same key, the value will be
717738 // updated.
718739 void RecordProperty(const TestProperty& test_property);
724745
725746 // Matches the full name of each test against the user-specified
726747 // filter to decide whether the test should run, then records the
727 // result in each TestCase and TestInfo object.
748 // result in each TestSuite and TestInfo object.
728749 // If shard_tests == HONOR_SHARDING_PROTOCOL, further filters tests
729750 // based on sharding variables in the environment.
730751 // Returns the number of tests that should run.
733754 // Prints the names of the tests matching the user-specified filter flag.
734755 void ListTestsMatchingFilter();
735756
736 const TestCase* current_test_case() const { return current_test_case_; }
757 const TestSuite* current_test_suite() const { return current_test_suite_; }
737758 TestInfo* current_test_info() { return current_test_info_; }
738759 const TestInfo* current_test_info() const { return current_test_info_; }
739760
794815 // Gets the random number generator.
795816 internal::Random* random() { return &random_; }
796817
797 // Shuffles all test cases, and the tests within each test case,
818 // Shuffles all test suites, and the tests within each test suite,
798819 // making sure that death tests are still run first.
799820 void ShuffleTests();
800821
801 // Restores the test cases and tests to their order before the first shuffle.
822 // Restores the test suites and tests to their order before the first shuffle.
802823 void UnshuffleTests();
803824
804825 // Returns the value of GTEST_FLAG(catch_exceptions) at the moment
838859 // before/after the tests are run.
839860 std::vector<Environment*> environments_;
840861
841 // The vector of TestCases in their original order. It owns the
862 // The vector of TestSuites in their original order. It owns the
842863 // elements in the vector.
843 std::vector<TestCase*> test_cases_;
844
845 // Provides a level of indirection for the test case list to allow
846 // easy shuffling and restoring the test case order. The i-th
847 // element of this vector is the index of the i-th test case in the
864 std::vector<TestSuite*> test_suites_;
865
866 // Provides a level of indirection for the test suite list to allow
867 // easy shuffling and restoring the test suite order. The i-th
868 // element of this vector is the index of the i-th test suite in the
848869 // shuffled order.
849 std::vector<int> test_case_indices_;
870 std::vector<int> test_suite_indices_;
850871
851872 // ParameterizedTestRegistry object used to register value-parameterized
852873 // tests.
853 internal::ParameterizedTestCaseRegistry parameterized_test_registry_;
874 internal::ParameterizedTestSuiteRegistry parameterized_test_registry_;
854875
855876 // Indicates whether RegisterParameterizedTests() has been called already.
856877 bool parameterized_tests_registered_;
857878
858 // Index of the last death test case registered. Initially -1.
859 int last_death_test_case_;
860
861 // This points to the TestCase for the currently running test. It
862 // changes as Google Test goes through one test case after another.
879 // Index of the last death test suite registered. Initially -1.
880 int last_death_test_suite_;
881
882 // This points to the TestSuite for the currently running test. It
883 // changes as Google Test goes through one test suite after another.
863884 // When no test is running, this is set to NULL and Google Test
864885 // stores assertion results in ad_hoc_test_result_. Initially NULL.
865 TestCase* current_test_case_;
886 TestSuite* current_test_suite_;
866887
867888 // This points to the TestInfo for the currently running test. It
868889 // changes as Google Test goes through one test after another. When
890911 // desired.
891912 OsStackTraceGetterInterface* os_stack_trace_getter_;
892913
893 // True iff PostFlagParsingInit() has been called.
914 // True if and only if PostFlagParsingInit() has been called.
894915 bool post_flag_parse_init_performed_;
895916
896917 // The random number seed used at the beginning of the test run.
909930 #if GTEST_HAS_DEATH_TEST
910931 // The decomposed components of the gtest_internal_run_death_test flag,
911932 // parsed when RUN_ALL_TESTS is called.
912 internal::scoped_ptr<InternalRunDeathTestFlag> internal_run_death_test_flag_;
913 internal::scoped_ptr<internal::DeathTestFactory> death_test_factory_;
933 std::unique_ptr<InternalRunDeathTestFlag> internal_run_death_test_flag_;
934 std::unique_ptr<internal::DeathTestFactory> death_test_factory_;
914935 #endif // GTEST_HAS_DEATH_TEST
915936
916937 // A per-thread stack of traces created by the SCOPED_TRACE() macro.
9931014
9941015 const bool parse_success = *end == '\0' && errno == 0;
9951016
996 // FIXME: Convert this to compile time assertion when it is
997 // available.
9981017 GTEST_CHECK_(sizeof(Integer) <= sizeof(parsed));
9991018
10001019 const Integer result = static_cast<Integer>(parsed);
10581077 MakeConnection();
10591078 }
10601079
1061 virtual ~SocketWriter() {
1080 ~SocketWriter() override {
10621081 if (sockfd_ != -1)
10631082 CloseConnection();
10641083 }
10651084
10661085 // Sends a string to the socket.
1067 virtual void Send(const std::string& message) {
1086 void Send(const std::string& message) override {
10681087 GTEST_CHECK_(sockfd_ != -1)
10691088 << "Send() can be called only when there is a connection.";
10701089
1071 const int len = static_cast<int>(message.length());
1072 if (write(sockfd_, message.c_str(), len) != len) {
1090 const auto len = static_cast<size_t>(message.length());
1091 if (write(sockfd_, message.c_str(), len) != static_cast<ssize_t>(len)) {
10731092 GTEST_LOG_(WARNING)
10741093 << "stream_result_to: failed to stream to "
10751094 << host_name_ << ":" << port_num_;
10811100 void MakeConnection();
10821101
10831102 // Closes the socket.
1084 void CloseConnection() {
1103 void CloseConnection() override {
10851104 GTEST_CHECK_(sockfd_ != -1)
10861105 << "CloseConnection() can be called only when there is a connection.";
10871106
11071126 explicit StreamingListener(AbstractSocketWriter* socket_writer)
11081127 : socket_writer_(socket_writer) { Start(); }
11091128
1110 void OnTestProgramStart(const UnitTest& /* unit_test */) {
1129 void OnTestProgramStart(const UnitTest& /* unit_test */) override {
11111130 SendLn("event=TestProgramStart");
11121131 }
11131132
1114 void OnTestProgramEnd(const UnitTest& unit_test) {
1133 void OnTestProgramEnd(const UnitTest& unit_test) override {
11151134 // Note that Google Test current only report elapsed time for each
11161135 // test iteration, not for the entire test program.
11171136 SendLn("event=TestProgramEnd&passed=" + FormatBool(unit_test.Passed()));
11201139 socket_writer_->CloseConnection();
11211140 }
11221141
1123 void OnTestIterationStart(const UnitTest& /* unit_test */, int iteration) {
1142 void OnTestIterationStart(const UnitTest& /* unit_test */,
1143 int iteration) override {
11241144 SendLn("event=TestIterationStart&iteration=" +
11251145 StreamableToString(iteration));
11261146 }
11271147
1128 void OnTestIterationEnd(const UnitTest& unit_test, int /* iteration */) {
1148 void OnTestIterationEnd(const UnitTest& unit_test,
1149 int /* iteration */) override {
11291150 SendLn("event=TestIterationEnd&passed=" +
11301151 FormatBool(unit_test.Passed()) + "&elapsed_time=" +
11311152 StreamableToString(unit_test.elapsed_time()) + "ms");
11321153 }
11331154
1134 void OnTestCaseStart(const TestCase& test_case) {
1155 // Note that "event=TestCaseStart" is a wire format and has to remain
1156 // "case" for compatibilty
1157 void OnTestCaseStart(const TestCase& test_case) override {
11351158 SendLn(std::string("event=TestCaseStart&name=") + test_case.name());
11361159 }
11371160
1138 void OnTestCaseEnd(const TestCase& test_case) {
1139 SendLn("event=TestCaseEnd&passed=" + FormatBool(test_case.Passed())
1140 + "&elapsed_time=" + StreamableToString(test_case.elapsed_time())
1141 + "ms");
1142 }
1143
1144 void OnTestStart(const TestInfo& test_info) {
1161 // Note that "event=TestCaseEnd" is a wire format and has to remain
1162 // "case" for compatibilty
1163 void OnTestCaseEnd(const TestCase& test_case) override {
1164 SendLn("event=TestCaseEnd&passed=" + FormatBool(test_case.Passed()) +
1165 "&elapsed_time=" + StreamableToString(test_case.elapsed_time()) +
1166 "ms");
1167 }
1168
1169 void OnTestStart(const TestInfo& test_info) override {
11451170 SendLn(std::string("event=TestStart&name=") + test_info.name());
11461171 }
11471172
1148 void OnTestEnd(const TestInfo& test_info) {
1173 void OnTestEnd(const TestInfo& test_info) override {
11491174 SendLn("event=TestEnd&passed=" +
11501175 FormatBool((test_info.result())->Passed()) +
11511176 "&elapsed_time=" +
11521177 StreamableToString((test_info.result())->elapsed_time()) + "ms");
11531178 }
11541179
1155 void OnTestPartResult(const TestPartResult& test_part_result) {
1180 void OnTestPartResult(const TestPartResult& test_part_result) override {
11561181 const char* file_name = test_part_result.file_name();
1157 if (file_name == NULL)
1158 file_name = "";
1182 if (file_name == nullptr) file_name = "";
11591183 SendLn("event=TestPartResult&file=" + UrlEncode(file_name) +
11601184 "&line=" + StreamableToString(test_part_result.line_number()) +
11611185 "&message=" + UrlEncode(test_part_result.message()));
11711195
11721196 std::string FormatBool(bool value) { return value ? "1" : "0"; }
11731197
1174 const scoped_ptr<AbstractSocketWriter> socket_writer_;
1198 const std::unique_ptr<AbstractSocketWriter> socket_writer_;
11751199
11761200 GTEST_DISALLOW_COPY_AND_ASSIGN_(StreamingListener);
11771201 }; // class StreamingListener
0 // Copyright 2007, Google Inc.
1 // All rights reserved.
2 //
3 // Redistribution and use in source and binary forms, with or without
4 // modification, are permitted provided that the following conditions are
5 // met:
6 //
7 // * Redistributions of source code must retain the above copyright
8 // notice, this list of conditions and the following disclaimer.
9 // * Redistributions in binary form must reproduce the above
10 // copyright notice, this list of conditions and the following disclaimer
11 // in the documentation and/or other materials provided with the
12 // distribution.
13 // * Neither the name of Google Inc. nor the names of its
14 // contributors may be used to endorse or promote products derived from
15 // this software without specific prior written permission.
16 //
17 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
21 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28
29 // The Google C++ Testing and Mocking Framework (Google Test)
30 //
31 // This file implements just enough of the matcher interface to allow
32 // EXPECT_DEATH and friends to accept a matcher argument.
33
34 #include "gtest/internal/gtest-internal.h"
35 #include "gtest/internal/gtest-port.h"
36 #include "gtest/gtest-matchers.h"
37
38 #include <string>
39
40 namespace testing {
41
42 // Constructs a matcher that matches a const std::string& whose value is
43 // equal to s.
44 Matcher<const std::string&>::Matcher(const std::string& s) { *this = Eq(s); }
45
46 // Constructs a matcher that matches a const std::string& whose value is
47 // equal to s.
48 Matcher<const std::string&>::Matcher(const char* s) {
49 *this = Eq(std::string(s));
50 }
51
52 // Constructs a matcher that matches a std::string whose value is equal to
53 // s.
54 Matcher<std::string>::Matcher(const std::string& s) { *this = Eq(s); }
55
56 // Constructs a matcher that matches a std::string whose value is equal to
57 // s.
58 Matcher<std::string>::Matcher(const char* s) { *this = Eq(std::string(s)); }
59
60 #if GTEST_HAS_ABSL
61 // Constructs a matcher that matches a const absl::string_view& whose value is
62 // equal to s.
63 Matcher<const absl::string_view&>::Matcher(const std::string& s) {
64 *this = Eq(s);
65 }
66
67 // Constructs a matcher that matches a const absl::string_view& whose value is
68 // equal to s.
69 Matcher<const absl::string_view&>::Matcher(const char* s) {
70 *this = Eq(std::string(s));
71 }
72
73 // Constructs a matcher that matches a const absl::string_view& whose value is
74 // equal to s.
75 Matcher<const absl::string_view&>::Matcher(absl::string_view s) {
76 *this = Eq(std::string(s));
77 }
78
79 // Constructs a matcher that matches a absl::string_view whose value is equal to
80 // s.
81 Matcher<absl::string_view>::Matcher(const std::string& s) { *this = Eq(s); }
82
83 // Constructs a matcher that matches a absl::string_view whose value is equal to
84 // s.
85 Matcher<absl::string_view>::Matcher(const char* s) {
86 *this = Eq(std::string(s));
87 }
88
89 // Constructs a matcher that matches a absl::string_view whose value is equal to
90 // s.
91 Matcher<absl::string_view>::Matcher(absl::string_view s) {
92 *this = Eq(std::string(s));
93 }
94 #endif // GTEST_HAS_ABSL
95
96 } // namespace testing
3030 #include "gtest/internal/gtest-port.h"
3131
3232 #include <limits.h>
33 #include <stdio.h>
3334 #include <stdlib.h>
34 #include <stdio.h>
3535 #include <string.h>
3636 #include <fstream>
37 #include <memory>
3738
3839 #if GTEST_OS_WINDOWS
3940 # include <windows.h>
4041 # include <io.h>
4142 # include <sys/stat.h>
4243 # include <map> // Used in ThreadLocal.
44 # ifdef _MSC_VER
45 # include <crtdbg.h>
46 # endif // _MSC_VER
4347 #else
4448 # include <unistd.h>
4549 #endif // GTEST_OS_WINDOWS
4953 # include <mach/task.h>
5054 # include <mach/vm_map.h>
5155 #endif // GTEST_OS_MAC
56
57 #if GTEST_OS_DRAGONFLY || GTEST_OS_FREEBSD || GTEST_OS_GNU_KFREEBSD || \
58 GTEST_OS_NETBSD || GTEST_OS_OPENBSD
59 # include <sys/sysctl.h>
60 # if GTEST_OS_DRAGONFLY || GTEST_OS_FREEBSD || GTEST_OS_GNU_KFREEBSD
61 # include <sys/user.h>
62 # endif
63 #endif
5264
5365 #if GTEST_OS_QNX
5466 # include <devctl.h>
104116 size_t GetThreadCount() {
105117 const std::string filename =
106118 (Message() << "/proc/" << getpid() << "/stat").GetString();
107 return ReadProcFileField<int>(filename, 19);
119 return ReadProcFileField<size_t>(filename, 19);
108120 }
109121
110122 #elif GTEST_OS_MAC
126138 }
127139 }
128140
141 #elif GTEST_OS_DRAGONFLY || GTEST_OS_FREEBSD || GTEST_OS_GNU_KFREEBSD || \
142 GTEST_OS_NETBSD
143
144 #if GTEST_OS_NETBSD
145 #undef KERN_PROC
146 #define KERN_PROC KERN_PROC2
147 #define kinfo_proc kinfo_proc2
148 #endif
149
150 #if GTEST_OS_DRAGONFLY
151 #define KP_NLWP(kp) (kp.kp_nthreads)
152 #elif GTEST_OS_FREEBSD || GTEST_OS_GNU_KFREEBSD
153 #define KP_NLWP(kp) (kp.ki_numthreads)
154 #elif GTEST_OS_NETBSD
155 #define KP_NLWP(kp) (kp.p_nlwps)
156 #endif
157
158 // Returns the number of threads running in the process, or 0 to indicate that
159 // we cannot detect it.
160 size_t GetThreadCount() {
161 int mib[] = {
162 CTL_KERN,
163 KERN_PROC,
164 KERN_PROC_PID,
165 getpid(),
166 #if GTEST_OS_NETBSD
167 sizeof(struct kinfo_proc),
168 1,
169 #endif
170 };
171 u_int miblen = sizeof(mib) / sizeof(mib[0]);
172 struct kinfo_proc info;
173 size_t size = sizeof(info);
174 if (sysctl(mib, miblen, &info, &size, NULL, 0)) {
175 return 0;
176 }
177 return static_cast<size_t>(KP_NLWP(info));
178 }
179 #elif GTEST_OS_OPENBSD
180
181 // Returns the number of threads running in the process, or 0 to indicate that
182 // we cannot detect it.
183 size_t GetThreadCount() {
184 int mib[] = {
185 CTL_KERN,
186 KERN_PROC,
187 KERN_PROC_PID | KERN_PROC_SHOW_THREADS,
188 getpid(),
189 sizeof(struct kinfo_proc),
190 0,
191 };
192 u_int miblen = sizeof(mib) / sizeof(mib[0]);
193
194 // get number of structs
195 size_t size;
196 if (sysctl(mib, miblen, NULL, &size, NULL, 0)) {
197 return 0;
198 }
199 mib[5] = size / mib[4];
200
201 // populate array of structs
202 struct kinfo_proc info[mib[5]];
203 if (sysctl(mib, miblen, &info, &size, NULL, 0)) {
204 return 0;
205 }
206
207 // exclude empty members
208 int nthreads = 0;
209 for (int i = 0; i < size / mib[4]; i++) {
210 if (info[i].p_tid != -1)
211 nthreads++;
212 }
213 return nthreads;
214 }
215
129216 #elif GTEST_OS_QNX
130217
131218 // Returns the number of threads running in the process, or 0 to indicate that
137224 }
138225 procfs_info process_info;
139226 const int status =
140 devctl(fd, DCMD_PROC_INFO, &process_info, sizeof(process_info), NULL);
227 devctl(fd, DCMD_PROC_INFO, &process_info, sizeof(process_info), nullptr);
141228 close(fd);
142229 if (status == EOK) {
143230 return static_cast<size_t>(process_info.num_threads);
151238 size_t GetThreadCount() {
152239 struct procentry64 entry;
153240 pid_t pid = getpid();
154 int status = getprocs64(&entry, sizeof(entry), NULL, 0, &pid, 1);
241 int status = getprocs64(&entry, sizeof(entry), nullptr, 0, &pid, 1);
155242 if (status == 1) {
156243 return entry.pi_thcount;
157244 } else {
191278 #if GTEST_IS_THREADSAFE && GTEST_OS_WINDOWS
192279
193280 void SleepMilliseconds(int n) {
194 ::Sleep(n);
281 ::Sleep(static_cast<DWORD>(n));
195282 }
196283
197284 AutoHandle::AutoHandle()
229316 bool AutoHandle::IsCloseable() const {
230317 // Different Windows APIs may use either of these values to represent an
231318 // invalid handle.
232 return handle_ != NULL && handle_ != INVALID_HANDLE_VALUE;
319 return handle_ != nullptr && handle_ != INVALID_HANDLE_VALUE;
233320 }
234321
235322 Notification::Notification()
236 : event_(::CreateEvent(NULL, // Default security attributes.
237 TRUE, // Do not reset automatically.
238 FALSE, // Initially unset.
239 NULL)) { // Anonymous event.
240 GTEST_CHECK_(event_.Get() != NULL);
323 : event_(::CreateEvent(nullptr, // Default security attributes.
324 TRUE, // Do not reset automatically.
325 FALSE, // Initially unset.
326 nullptr)) { // Anonymous event.
327 GTEST_CHECK_(event_.Get() != nullptr);
241328 }
242329
243330 void Notification::Notify() {
260347 Mutex::~Mutex() {
261348 // Static mutexes are leaked intentionally. It is not thread-safe to try
262349 // to clean them up.
263 // FIXME: Switch to Slim Reader/Writer (SRW) Locks, which requires
264 // nothing to clean it up but is available only on Vista and later.
265 // https://docs.microsoft.com/en-us/windows/desktop/Sync/slim-reader-writer--srw--locks
266350 if (type_ == kDynamic) {
267351 ::DeleteCriticalSection(critical_section_);
268352 delete critical_section_;
269 critical_section_ = NULL;
353 critical_section_ = nullptr;
270354 }
271355 }
272356
295379
296380 namespace {
297381
382 #ifdef _MSC_VER
298383 // Use the RAII idiom to flag mem allocs that are intentionally never
299384 // deallocated. The motivation is to silence the false positive mem leaks
300385 // that are reported by the debug version of MS's CRT which can only detect
307392 {
308393 public:
309394 MemoryIsNotDeallocated() : old_crtdbg_flag_(0) {
310 #ifdef _MSC_VER
311395 old_crtdbg_flag_ = _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG);
312396 // Set heap allocation block type to _IGNORE_BLOCK so that MS debug CRT
313397 // doesn't report mem leak if there's no matching deallocation.
314398 _CrtSetDbgFlag(old_crtdbg_flag_ & ~_CRTDBG_ALLOC_MEM_DF);
315 #endif // _MSC_VER
316399 }
317400
318401 ~MemoryIsNotDeallocated() {
319 #ifdef _MSC_VER
320402 // Restore the original _CRTDBG_ALLOC_MEM_DF flag
321403 _CrtSetDbgFlag(old_crtdbg_flag_);
322 #endif // _MSC_VER
323404 }
324405
325406 private:
327408
328409 GTEST_DISALLOW_COPY_AND_ASSIGN_(MemoryIsNotDeallocated);
329410 };
411 #endif // _MSC_VER
330412
331413 } // namespace
332414
342424 owner_thread_id_ = 0;
343425 {
344426 // Use RAII to flag that following mem alloc is never deallocated.
427 #ifdef _MSC_VER
345428 MemoryIsNotDeallocated memory_is_not_deallocated;
429 #endif // _MSC_VER
346430 critical_section_ = new CRITICAL_SECTION;
347431 }
348432 ::InitializeCriticalSection(critical_section_);
383467 Notification* thread_can_start) {
384468 ThreadMainParam* param = new ThreadMainParam(runnable, thread_can_start);
385469 DWORD thread_id;
386 // FIXME: Consider to use _beginthreadex instead.
387470 HANDLE thread_handle = ::CreateThread(
388 NULL, // Default security.
389 0, // Default stack size.
471 nullptr, // Default security.
472 0, // Default stack size.
390473 &ThreadWithParamSupport::ThreadMain,
391 param, // Parameter to ThreadMainStatic
392 0x0, // Default creation flags.
474 param, // Parameter to ThreadMainStatic
475 0x0, // Default creation flags.
393476 &thread_id); // Need a valid pointer for the call to work under Win98.
394 GTEST_CHECK_(thread_handle != NULL) << "CreateThread failed with error "
395 << ::GetLastError() << ".";
396 if (thread_handle == NULL) {
477 GTEST_CHECK_(thread_handle != nullptr)
478 << "CreateThread failed with error " << ::GetLastError() << ".";
479 if (thread_handle == nullptr) {
397480 delete param;
398481 }
399482 return thread_handle;
405488 : runnable_(runnable),
406489 thread_can_start_(thread_can_start) {
407490 }
408 scoped_ptr<Runnable> runnable_;
491 std::unique_ptr<Runnable> runnable_;
409492 // Does not own.
410493 Notification* thread_can_start_;
411494 };
412495
413496 static DWORD WINAPI ThreadMain(void* ptr) {
414497 // Transfers ownership.
415 scoped_ptr<ThreadMainParam> param(static_cast<ThreadMainParam*>(ptr));
416 if (param->thread_can_start_ != NULL)
498 std::unique_ptr<ThreadMainParam> param(static_cast<ThreadMainParam*>(ptr));
499 if (param->thread_can_start_ != nullptr)
417500 param->thread_can_start_->WaitForNotification();
418501 param->runnable_->Run();
419502 return 0;
471554 thread_local_values
472555 .insert(std::make_pair(
473556 thread_local_instance,
474 linked_ptr<ThreadLocalValueHolderBase>(
557 std::shared_ptr<ThreadLocalValueHolderBase>(
475558 thread_local_instance->NewValueForCurrentThread())))
476559 .first;
477560 }
480563
481564 static void OnThreadLocalDestroyed(
482565 const ThreadLocalBase* thread_local_instance) {
483 std::vector<linked_ptr<ThreadLocalValueHolderBase> > value_holders;
566 std::vector<std::shared_ptr<ThreadLocalValueHolderBase> > value_holders;
484567 // Clean up the ThreadLocalValues data structure while holding the lock, but
485568 // defer the destruction of the ThreadLocalValueHolderBases.
486569 {
508591
509592 static void OnThreadExit(DWORD thread_id) {
510593 GTEST_CHECK_(thread_id != 0) << ::GetLastError();
511 std::vector<linked_ptr<ThreadLocalValueHolderBase> > value_holders;
594 std::vector<std::shared_ptr<ThreadLocalValueHolderBase> > value_holders;
512595 // Clean up the ThreadIdToThreadLocals data structure while holding the
513596 // lock, but defer the destruction of the ThreadLocalValueHolderBases.
514597 {
535618 private:
536619 // In a particular thread, maps a ThreadLocal object to its value.
537620 typedef std::map<const ThreadLocalBase*,
538 linked_ptr<ThreadLocalValueHolderBase> > ThreadLocalValues;
621 std::shared_ptr<ThreadLocalValueHolderBase> >
622 ThreadLocalValues;
539623 // Stores all ThreadIdToThreadLocals having values in a thread, indexed by
540624 // thread's ID.
541625 typedef std::map<DWORD, ThreadLocalValues> ThreadIdToThreadLocals;
550634 HANDLE thread = ::OpenThread(SYNCHRONIZE | THREAD_QUERY_INFORMATION,
551635 FALSE,
552636 thread_id);
553 GTEST_CHECK_(thread != NULL);
637 GTEST_CHECK_(thread != nullptr);
554638 // We need to pass a valid thread ID pointer into CreateThread for it
555639 // to work correctly under Win98.
556640 DWORD watcher_thread_id;
557641 HANDLE watcher_thread = ::CreateThread(
558 NULL, // Default security.
559 0, // Default stack size
642 nullptr, // Default security.
643 0, // Default stack size
560644 &ThreadLocalRegistryImpl::WatcherThreadFunc,
561645 reinterpret_cast<LPVOID>(new ThreadIdAndHandle(thread_id, thread)),
562 CREATE_SUSPENDED,
563 &watcher_thread_id);
564 GTEST_CHECK_(watcher_thread != NULL);
646 CREATE_SUSPENDED, &watcher_thread_id);
647 GTEST_CHECK_(watcher_thread != nullptr);
565648 // Give the watcher thread the same priority as ours to avoid being
566649 // blocked by it.
567650 ::SetThreadPriority(watcher_thread,
586669 // Returns map of thread local instances.
587670 static ThreadIdToThreadLocals* GetThreadLocalsMapLocked() {
588671 mutex_.AssertHeld();
672 #ifdef _MSC_VER
589673 MemoryIsNotDeallocated memory_is_not_deallocated;
674 #endif // _MSC_VER
590675 static ThreadIdToThreadLocals* map = new ThreadIdToThreadLocals();
591676 return map;
592677 }
629714 free(const_cast<char*>(pattern_));
630715 }
631716
632 // Returns true iff regular expression re matches the entire str.
717 // Returns true if and only if regular expression re matches the entire str.
633718 bool RE::FullMatch(const char* str, const RE& re) {
634719 if (!re.is_valid_) return false;
635720
637722 return regexec(&re.full_regex_, str, 1, &match, 0) == 0;
638723 }
639724
640 // Returns true iff regular expression re matches a substring of str
641 // (including str itself).
725 // Returns true if and only if regular expression re matches a substring of
726 // str (including str itself).
642727 bool RE::PartialMatch(const char* str, const RE& re) {
643728 if (!re.is_valid_) return false;
644729
678763
679764 #elif GTEST_USES_SIMPLE_RE
680765
681 // Returns true iff ch appears anywhere in str (excluding the
766 // Returns true if and only if ch appears anywhere in str (excluding the
682767 // terminating '\0' character).
683768 bool IsInSet(char ch, const char* str) {
684 return ch != '\0' && strchr(str, ch) != NULL;
685 }
686
687 // Returns true iff ch belongs to the given classification. Unlike
688 // similar functions in <ctype.h>, these aren't affected by the
769 return ch != '\0' && strchr(str, ch) != nullptr;
770 }
771
772 // Returns true if and only if ch belongs to the given classification.
773 // Unlike similar functions in <ctype.h>, these aren't affected by the
689774 // current locale.
690775 bool IsAsciiDigit(char ch) { return '0' <= ch && ch <= '9'; }
691776 bool IsAsciiPunct(char ch) {
698783 ('0' <= ch && ch <= '9') || ch == '_';
699784 }
700785
701 // Returns true iff "\\c" is a supported escape sequence.
786 // Returns true if and only if "\\c" is a supported escape sequence.
702787 bool IsValidEscape(char c) {
703788 return (IsAsciiPunct(c) || IsInSet(c, "dDfnrsStvwW"));
704789 }
705790
706 // Returns true iff the given atom (specified by escaped and pattern)
707 // matches ch. The result is undefined if the atom is invalid.
791 // Returns true if and only if the given atom (specified by escaped and
792 // pattern) matches ch. The result is undefined if the atom is invalid.
708793 bool AtomMatchesChar(bool escaped, char pattern_char, char ch) {
709794 if (escaped) { // "\\p" where p is pattern_char.
710795 switch (pattern_char) {
735820 // Generates non-fatal failures and returns false if regex is invalid;
736821 // otherwise returns true.
737822 bool ValidateRegex(const char* regex) {
738 if (regex == NULL) {
739 // FIXME: fix the source file location in the
740 // assertion failures to match where the regex is used in user
741 // code.
823 if (regex == nullptr) {
742824 ADD_FAILURE() << "NULL is not a valid simple regular expression.";
743825 return false;
744826 }
745827
746828 bool is_valid = true;
747829
748 // True iff ?, *, or + can follow the previous atom.
830 // True if and only if ?, *, or + can follow the previous atom.
749831 bool prev_repeatable = false;
750832 for (int i = 0; regex[i]; i++) {
751833 if (regex[i] == '\\') { // An escape sequence
821903 return false;
822904 }
823905
824 // Returns true iff regex matches a prefix of str. regex must be a
825 // valid simple regular expression and not start with "^", or the
906 // Returns true if and only if regex matches a prefix of str. regex must
907 // be a valid simple regular expression and not start with "^", or the
826908 // result is undefined.
827909 bool MatchRegexAtHead(const char* regex, const char* str) {
828910 if (*regex == '\0') // An empty regex matches a prefix of anything.
852934 }
853935 }
854936
855 // Returns true iff regex matches any substring of str. regex must be
856 // a valid simple regular expression, or the result is undefined.
937 // Returns true if and only if regex matches any substring of str. regex must
938 // be a valid simple regular expression, or the result is undefined.
857939 //
858940 // The algorithm is recursive, but the recursion depth doesn't exceed
859941 // the regex length, so we won't need to worry about running out of
861943 // exponential with respect to the regex length + the string length,
862944 // but usually it's must faster (often close to linear).
863945 bool MatchRegexAnywhere(const char* regex, const char* str) {
864 if (regex == NULL || str == NULL)
865 return false;
946 if (regex == nullptr || str == nullptr) return false;
866947
867948 if (*regex == '^')
868949 return MatchRegexAtHead(regex + 1, str);
882963 free(const_cast<char*>(full_pattern_));
883964 }
884965
885 // Returns true iff regular expression re matches the entire str.
966 // Returns true if and only if regular expression re matches the entire str.
886967 bool RE::FullMatch(const char* str, const RE& re) {
887968 return re.is_valid_ && MatchRegexAnywhere(re.full_pattern_, str);
888969 }
889970
890 // Returns true iff regular expression re matches a substring of str
891 // (including str itself).
971 // Returns true if and only if regular expression re matches a substring of
972 // str (including str itself).
892973 bool RE::PartialMatch(const char* str, const RE& re) {
893974 return re.is_valid_ && MatchRegexAnywhere(re.pattern_, str);
894975 }
895976
896977 // Initializes an RE from its string representation.
897978 void RE::Init(const char* regex) {
898 pattern_ = full_pattern_ = NULL;
899 if (regex != NULL) {
979 pattern_ = full_pattern_ = nullptr;
980 if (regex != nullptr) {
900981 pattern_ = posix::StrDup(regex);
901982 }
902983
9341015 // Formats a source file path and a line number as they would appear
9351016 // in an error message from the compiler used to compile this code.
9361017 GTEST_API_ ::std::string FormatFileLocation(const char* file, int line) {
937 const std::string file_name(file == NULL ? kUnknownFile : file);
1018 const std::string file_name(file == nullptr ? kUnknownFile : file);
9381019
9391020 if (line < 0) {
9401021 return file_name + ":";
9531034 // to the file location it produces, unlike FormatFileLocation().
9541035 GTEST_API_ ::std::string FormatCompilerIndependentFileLocation(
9551036 const char* file, int line) {
956 const std::string file_name(file == NULL ? kUnknownFile : file);
1037 const std::string file_name(file == nullptr ? kUnknownFile : file);
9571038
9581039 if (line < 0)
9591040 return file_name;
10201101 // code as part of a regular standalone executable, which doesn't
10211102 // run in a Dalvik process (e.g. when running it through 'adb shell').
10221103 //
1023 // The location /sdcard is directly accessible from native code
1024 // and is the only location (unofficially) supported by the Android
1025 // team. It's generally a symlink to the real SD Card mount point
1026 // which can be /mnt/sdcard, /mnt/sdcard0, /system/media/sdcard, or
1027 // other OEM-customized locations. Never rely on these, and always
1028 // use /sdcard.
1029 char name_template[] = "/sdcard/gtest_captured_stream.XXXXXX";
1104 // The location /data/local/tmp is directly accessible from native code.
1105 // '/sdcard' and other variants cannot be relied on, as they are not
1106 // guaranteed to be mounted, or may have a delay in mounting.
1107 char name_template[] = "/data/local/tmp/gtest_captured_stream.XXXXXX";
10301108 # else
10311109 char name_template[] = "/tmp/captured_stream.XXXXXX";
10321110 # endif // GTEST_OS_LINUX_ANDROID
10331111 const int captured_fd = mkstemp(name_template);
1112 if (captured_fd == -1) {
1113 GTEST_LOG_(WARNING)
1114 << "Failed to create tmp file " << name_template
1115 << " for test; does the test have access to the /tmp directory?";
1116 }
10341117 filename_ = name_template;
10351118 # endif // GTEST_OS_WINDOWS
1036 fflush(NULL);
1119 fflush(nullptr);
10371120 dup2(captured_fd, fd_);
10381121 close(captured_fd);
10391122 }
10451128 std::string GetCapturedString() {
10461129 if (uncaptured_fd_ != -1) {
10471130 // Restores the original stream.
1048 fflush(NULL);
1131 fflush(nullptr);
10491132 dup2(uncaptured_fd_, fd_);
10501133 close(uncaptured_fd_);
10511134 uncaptured_fd_ = -1;
10521135 }
10531136
10541137 FILE* const file = posix::FOpen(filename_.c_str(), "r");
1138 if (file == nullptr) {
1139 GTEST_LOG_(FATAL) << "Failed to open tmp file " << filename_
1140 << " for capturing stream.";
1141 }
10551142 const std::string content = ReadEntireFile(file);
10561143 posix::FClose(file);
10571144 return content;
10681155
10691156 GTEST_DISABLE_MSC_DEPRECATED_POP_()
10701157
1071 static CapturedStream* g_captured_stderr = NULL;
1072 static CapturedStream* g_captured_stdout = NULL;
1158 static CapturedStream* g_captured_stderr = nullptr;
1159 static CapturedStream* g_captured_stdout = nullptr;
10731160
10741161 // Starts capturing an output stream (stdout/stderr).
10751162 static void CaptureStream(int fd, const char* stream_name,
10761163 CapturedStream** stream) {
1077 if (*stream != NULL) {
1164 if (*stream != nullptr) {
10781165 GTEST_LOG_(FATAL) << "Only one " << stream_name
10791166 << " capturer can exist at a time.";
10801167 }
10861173 const std::string content = (*captured_stream)->GetCapturedString();
10871174
10881175 delete *captured_stream;
1089 *captured_stream = NULL;
1176 *captured_stream = nullptr;
10901177
10911178 return content;
10921179 }
11451232 }
11461233
11471234 #if GTEST_HAS_DEATH_TEST
1148 static const std::vector<std::string>* g_injected_test_argvs = NULL; // Owned.
1235 static const std::vector<std::string>* g_injected_test_argvs =
1236 nullptr; // Owned.
11491237
11501238 std::vector<std::string> GetInjectableArgvs() {
1151 if (g_injected_test_argvs != NULL) {
1239 if (g_injected_test_argvs != nullptr) {
11521240 return *g_injected_test_argvs;
11531241 }
11541242 return GetArgvs();
11641252 new std::vector<std::string>(new_argvs.begin(), new_argvs.end()));
11651253 }
11661254
1167 #if GTEST_HAS_GLOBAL_STRING
1168 void SetInjectableArgvs(const std::vector< ::string>& new_argvs) {
1169 SetInjectableArgvs(
1170 new std::vector<std::string>(new_argvs.begin(), new_argvs.end()));
1171 }
1172 #endif // GTEST_HAS_GLOBAL_STRING
1173
11741255 void ClearInjectableArgvs() {
11751256 delete g_injected_test_argvs;
1176 g_injected_test_argvs = NULL;
1257 g_injected_test_argvs = nullptr;
11771258 }
11781259 #endif // GTEST_HAS_DEATH_TEST
11791260
12061287 // unchanged and returns false.
12071288 bool ParseInt32(const Message& src_text, const char* str, Int32* value) {
12081289 // Parses the environment variable as a decimal integer.
1209 char* end = NULL;
1290 char* end = nullptr;
12101291 const long long_value = strtol(str, &end, 10); // NOLINT
12111292
12121293 // Has strtol() consumed all characters in the string?
12451326 // Reads and returns the Boolean environment variable corresponding to
12461327 // the given flag; if it's not set, returns default_value.
12471328 //
1248 // The value is considered true iff it's not "0".
1329 // The value is considered true if and only if it's not "0".
12491330 bool BoolFromGTestEnv(const char* flag, bool default_value) {
12501331 #if defined(GTEST_GET_BOOL_FROM_ENV_)
12511332 return GTEST_GET_BOOL_FROM_ENV_(flag, default_value);
12521333 #else
12531334 const std::string env_var = FlagToEnvVar(flag);
12541335 const char* const string_value = posix::GetEnv(env_var.c_str());
1255 return string_value == NULL ?
1256 default_value : strcmp(string_value, "0") != 0;
1336 return string_value == nullptr ? default_value
1337 : strcmp(string_value, "0") != 0;
12571338 #endif // defined(GTEST_GET_BOOL_FROM_ENV_)
12581339 }
12591340
12661347 #else
12671348 const std::string env_var = FlagToEnvVar(flag);
12681349 const char* const string_value = posix::GetEnv(env_var.c_str());
1269 if (string_value == NULL) {
1350 if (string_value == nullptr) {
12701351 // The environment variable is not set.
12711352 return default_value;
12721353 }
12951376 std::string OutputFlagAlsoCheckEnvVar(){
12961377 std::string default_value_for_output_flag = "";
12971378 const char* xml_output_file_env = posix::GetEnv("XML_OUTPUT_FILE");
1298 if (NULL != xml_output_file_env) {
1379 if (nullptr != xml_output_file_env) {
12991380 default_value_for_output_flag = std::string("xml:") + xml_output_file_env;
13001381 }
13011382 return default_value_for_output_flag;
13091390 #else
13101391 const std::string env_var = FlagToEnvVar(flag);
13111392 const char* const value = posix::GetEnv(env_var.c_str());
1312 return value == NULL ? default_value : value;
1393 return value == nullptr ? default_value : value;
13131394 #endif // defined(GTEST_GET_STRING_FROM_ENV_)
13141395 }
13151396
5858 // Prints a segment of bytes in the given object.
5959 GTEST_ATTRIBUTE_NO_SANITIZE_MEMORY_
6060 GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_
61 GTEST_ATTRIBUTE_NO_SANITIZE_HWADDRESS_
6162 GTEST_ATTRIBUTE_NO_SANITIZE_THREAD_
6263 void PrintByteSegmentInObjectTo(const unsigned char* obj_bytes, size_t start,
6364 size_t count, ostream* os) {
8889 // If the object size is bigger than kThreshold, we'll have to omit
8990 // some details by printing only the first and the last kChunkSize
9091 // bytes.
91 // FIXME: let the user control the threshold using a flag.
9292 if (count < kThreshold) {
9393 PrintByteSegmentInObjectTo(obj_bytes, 0, count, os);
9494 } else {
143143 // which is the type of c.
144144 template <typename UnsignedChar, typename Char>
145145 static CharFormat PrintAsCharLiteralTo(Char c, ostream* os) {
146 switch (static_cast<wchar_t>(c)) {
146 wchar_t w_c = static_cast<wchar_t>(c);
147 switch (w_c) {
147148 case L'\0':
148149 *os << "\\0";
149150 break;
175176 *os << "\\v";
176177 break;
177178 default:
178 if (IsPrintableAscii(c)) {
179 if (IsPrintableAscii(w_c)) {
179180 *os << static_cast<char>(c);
180181 return kAsIs;
181182 } else {
235236 if (format == kHexEscape || (1 <= c && c <= 9)) {
236237 // Do nothing.
237238 } else {
238 *os << ", 0x" << String::FormatHexInt(static_cast<UnsignedChar>(c));
239 *os << ", 0x" << String::FormatHexInt(static_cast<int>(c));
239240 }
240241 *os << ")";
241242 }
260261 template <typename CharType>
261262 GTEST_ATTRIBUTE_NO_SANITIZE_MEMORY_
262263 GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_
264 GTEST_ATTRIBUTE_NO_SANITIZE_HWADDRESS_
263265 GTEST_ATTRIBUTE_NO_SANITIZE_THREAD_
264266 static CharFormat PrintCharsAsStringTo(
265267 const CharType* begin, size_t len, ostream* os) {
290292 template <typename CharType>
291293 GTEST_ATTRIBUTE_NO_SANITIZE_MEMORY_
292294 GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_
295 GTEST_ATTRIBUTE_NO_SANITIZE_HWADDRESS_
293296 GTEST_ATTRIBUTE_NO_SANITIZE_THREAD_
294297 static void UniversalPrintCharArray(
295298 const CharType* begin, size_t len, ostream* os) {
326329
327330 // Prints the given C string to the ostream.
328331 void PrintTo(const char* s, ostream* os) {
329 if (s == NULL) {
332 if (s == nullptr) {
330333 *os << "NULL";
331334 } else {
332335 *os << ImplicitCast_<const void*>(s) << " pointing to ";
343346 #if !defined(_MSC_VER) || defined(_NATIVE_WCHAR_T_DEFINED)
344347 // Prints the given wide C string to the ostream.
345348 void PrintTo(const wchar_t* s, ostream* os) {
346 if (s == NULL) {
349 if (s == nullptr) {
347350 *os << "NULL";
348351 } else {
349352 *os << ImplicitCast_<const void*>(s) << " pointing to ";
350 PrintCharsAsStringTo(s, std::wcslen(s), os);
353 PrintCharsAsStringTo(s, wcslen(s), os);
351354 }
352355 }
353356 #endif // wchar_t is native
419422
420423 } // anonymous namespace
421424
422 // Prints a ::string object.
423 #if GTEST_HAS_GLOBAL_STRING
424 void PrintStringTo(const ::string& s, ostream* os) {
425 if (PrintCharsAsStringTo(s.data(), s.size(), os) == kHexEscape) {
426 if (GTEST_FLAG(print_utf8)) {
427 ConditionalPrintAsText(s.data(), s.size(), os);
428 }
429 }
430 }
431 #endif // GTEST_HAS_GLOBAL_STRING
432
433425 void PrintStringTo(const ::std::string& s, ostream* os) {
434426 if (PrintCharsAsStringTo(s.data(), s.size(), os) == kHexEscape) {
435427 if (GTEST_FLAG(print_utf8)) {
438430 }
439431 }
440432
441 // Prints a ::wstring object.
442 #if GTEST_HAS_GLOBAL_WSTRING
443 void PrintWideStringTo(const ::wstring& s, ostream* os) {
444 PrintCharsAsStringTo(s.data(), s.size(), os);
445 }
446 #endif // GTEST_HAS_GLOBAL_WSTRING
447
448433 #if GTEST_HAS_STD_WSTRING
449434 void PrintWideStringTo(const ::std::wstring& s, ostream* os) {
450435 PrintCharsAsStringTo(s.data(), s.size(), os);
4040 // in it.
4141 std::string TestPartResult::ExtractSummary(const char* message) {
4242 const char* const stack_trace = strstr(message, internal::kStackTraceMarker);
43 return stack_trace == NULL ? message :
44 std::string(message, stack_trace);
43 return stack_trace == nullptr ? message : std::string(message, stack_trace);
4544 }
4645
4746 // Prints a TestPartResult object.
4847 std::ostream& operator<<(std::ostream& os, const TestPartResult& result) {
49 return os
50 << result.file_name() << ":" << result.line_number() << ": "
51 << (result.type() == TestPartResult::kSuccess ? "Success" :
52 result.type() == TestPartResult::kFatalFailure ? "Fatal failure" :
53 "Non-fatal failure") << ":\n"
54 << result.message() << std::endl;
48 return os << result.file_name() << ":" << result.line_number() << ": "
49 << (result.type() == TestPartResult::kSuccess
50 ? "Success"
51 : result.type() == TestPartResult::kSkip
52 ? "Skipped"
53 : result.type() == TestPartResult::kFatalFailure
54 ? "Fatal failure"
55 : "Non-fatal failure")
56 << ":\n"
57 << result.message() << std::endl;
5558 }
5659
5760 // Appends a TestPartResult to the array.
6669 internal::posix::Abort();
6770 }
6871
69 return array_[index];
72 return array_[static_cast<size_t>(index)];
7073 }
7174
7275 // Returns the number of TestPartResult objects in the array.
4747 static std::vector<std::string> SplitIntoTestNames(const char* src) {
4848 std::vector<std::string> name_vec;
4949 src = SkipSpaces(src);
50 for (; src != NULL; src = SkipComma(src)) {
50 for (; src != nullptr; src = SkipComma(src)) {
5151 name_vec.push_back(StripTrailingSpaces(GetPrefixUntilComma(src)));
5252 }
5353 return name_vec;
5656 // Verifies that registered_tests match the test names in
5757 // registered_tests_; returns registered_tests if successful, or
5858 // aborts the program otherwise.
59 const char* TypedTestCasePState::VerifyRegisteredTestNames(
59 const char* TypedTestSuitePState::VerifyRegisteredTestNames(
6060 const char* file, int line, const char* registered_tests) {
6161 typedef RegisteredTestsMap::const_iterator RegisteredTestIter;
6262 registered_ = true;
8888 tests.insert(name);
8989 } else {
9090 errors << "No test named " << name
91 << " can be found in this test case.\n";
91 << " can be found in this test suite.\n";
9292 }
9393 }
9494
5353
5454 #if GTEST_OS_LINUX
5555
56 // FIXME: Use autoconf to detect availability of
57 // gettimeofday().
5856 # define GTEST_HAS_GETTIMEOFDAY_ 1
5957
6058 # include <fcntl.h> // NOLINT
6765 # include <unistd.h> // NOLINT
6866 # include <string>
6967
70 #elif GTEST_OS_SYMBIAN
71 # define GTEST_HAS_GETTIMEOFDAY_ 1
72 # include <sys/time.h> // NOLINT
73
7468 #elif GTEST_OS_ZOS
7569 # define GTEST_HAS_GETTIMEOFDAY_ 1
7670 # include <sys/time.h> // NOLINT
8579
8680 #elif GTEST_OS_WINDOWS // We are on Windows proper.
8781
82 # include <windows.h> // NOLINT
83 # undef min
84
85 # include <crtdbg.h> // NOLINT
86 # include <debugapi.h> // NOLINT
8887 # include <io.h> // NOLINT
8988 # include <sys/timeb.h> // NOLINT
9089 # include <sys/types.h> // NOLINT
9291
9392 # if GTEST_OS_WINDOWS_MINGW
9493 // MinGW has gettimeofday() but not _ftime64().
95 // FIXME: Use autoconf to detect availability of
96 // gettimeofday().
97 // FIXME: There are other ways to get the time on
98 // Windows, like GetTickCount() or GetSystemTimeAsFileTime(). MinGW
99 // supports these. consider using them instead.
10094 # define GTEST_HAS_GETTIMEOFDAY_ 1
10195 # include <sys/time.h> // NOLINT
10296 # endif // GTEST_OS_WINDOWS_MINGW
10397
104 // cpplint thinks that the header is already included, so we want to
105 // silence it.
106 # include <windows.h> // NOLINT
107 # undef min
108
10998 #else
11099
111100 // Assume other platforms have gettimeofday().
112 // FIXME: Use autoconf to detect availability of
113 // gettimeofday().
114101 # define GTEST_HAS_GETTIMEOFDAY_ 1
115102
116103 // cpplint thinks that the header is already included, so we want to
159146
160147 // Constants.
161148
162 // A test whose test case name or test name matches this filter is
149 // A test whose test suite name or test name matches this filter is
163150 // disabled and not run.
164151 static const char kDisableTestFilter[] = "DISABLED_*:*/DISABLED_*";
165152
166 // A test case whose name matches this filter is considered a death
167 // test case and will be run before test cases whose name doesn't
153 // A test suite whose name matches this filter is considered a death
154 // test suite and will be run before test suites whose name doesn't
168155 // match this filter.
169 static const char kDeathTestCaseFilter[] = "*DeathTest:*DeathTest/*";
156 static const char kDeathTestSuiteFilter[] = "*DeathTest:*DeathTest/*";
170157
171158 // A test filter that matches everything.
172159 static const char kUniversalFilter[] = "*";
189176 // stack trace.
190177 const char kStackTraceMarker[] = "\nStack trace:\n";
191178
192 // g_help_flag is true iff the --help flag or an equivalent form is
193 // specified on the command line.
179 // g_help_flag is true if and only if the --help flag or an equivalent form
180 // is specified on the command line.
194181 bool g_help_flag = false;
195182
196183 // Utilty function to Open File for Writing
197184 static FILE* OpenFileForWriting(const std::string& output_file) {
198 FILE* fileout = NULL;
185 FILE* fileout = nullptr;
199186 FilePath output_file_path(output_file);
200187 FilePath output_dir(output_file_path.RemoveFileName());
201188
202189 if (output_dir.CreateDirectoriesRecursively()) {
203190 fileout = posix::FOpen(output_file.c_str(), "w");
204191 }
205 if (fileout == NULL) {
192 if (fileout == nullptr) {
206193 GTEST_LOG_(FATAL) << "Unable to open file \"" << output_file << "\"";
207194 }
208195 return fileout;
215202 static const char* GetDefaultFilter() {
216203 const char* const testbridge_test_only =
217204 internal::posix::GetEnv("TESTBRIDGE_TEST_ONLY");
218 if (testbridge_test_only != NULL) {
205 if (testbridge_test_only != nullptr) {
219206 return testbridge_test_only;
220207 }
221208 return kUniversalFilter;
227214 "Run disabled tests too, in addition to the tests normally being run.");
228215
229216 GTEST_DEFINE_bool_(
230 break_on_failure,
231 internal::BoolFromGTestEnv("break_on_failure", false),
232 "True iff a failed assertion should be a debugger break-point.");
233
234 GTEST_DEFINE_bool_(
235 catch_exceptions,
236 internal::BoolFromGTestEnv("catch_exceptions", true),
237 "True iff " GTEST_NAME_
238 " should catch exceptions and treat them as test failures.");
217 break_on_failure, internal::BoolFromGTestEnv("break_on_failure", false),
218 "True if and only if a failed assertion should be a debugger "
219 "break-point.");
220
221 GTEST_DEFINE_bool_(catch_exceptions,
222 internal::BoolFromGTestEnv("catch_exceptions", true),
223 "True if and only if " GTEST_NAME_
224 " should catch exceptions and treat them as test failures.");
239225
240226 GTEST_DEFINE_string_(
241227 color,
282268 "executable's name and, if necessary, made unique by adding "
283269 "digits.");
284270
285 GTEST_DEFINE_bool_(
286 print_time,
287 internal::BoolFromGTestEnv("print_time", true),
288 "True iff " GTEST_NAME_
289 " should display elapsed time in text output.");
290
291 GTEST_DEFINE_bool_(
292 print_utf8,
293 internal::BoolFromGTestEnv("print_utf8", true),
294 "True iff " GTEST_NAME_
295 " prints UTF8 characters as text.");
271 GTEST_DEFINE_bool_(print_time, internal::BoolFromGTestEnv("print_time", true),
272 "True if and only if " GTEST_NAME_
273 " should display elapsed time in text output.");
274
275 GTEST_DEFINE_bool_(print_utf8, internal::BoolFromGTestEnv("print_utf8", true),
276 "True if and only if " GTEST_NAME_
277 " prints UTF8 characters as text.");
296278
297279 GTEST_DEFINE_int32_(
298280 random_seed,
306288 "How many times to repeat each test. Specify a negative number "
307289 "for repeating forever. Useful for shaking out flaky tests.");
308290
309 GTEST_DEFINE_bool_(
310 show_internal_stack_frames, false,
311 "True iff " GTEST_NAME_ " should include internal stack frames when "
312 "printing test failure stack traces.");
313
314 GTEST_DEFINE_bool_(
315 shuffle,
316 internal::BoolFromGTestEnv("shuffle", false),
317 "True iff " GTEST_NAME_
318 " should randomize tests' order on every run.");
291 GTEST_DEFINE_bool_(show_internal_stack_frames, false,
292 "True if and only if " GTEST_NAME_
293 " should include internal stack frames when "
294 "printing test failure stack traces.");
295
296 GTEST_DEFINE_bool_(shuffle, internal::BoolFromGTestEnv("shuffle", false),
297 "True if and only if " GTEST_NAME_
298 " should randomize tests' order on every run.");
319299
320300 GTEST_DEFINE_int32_(
321301 stack_trace_depth,
366346 return state_ % range;
367347 }
368348
369 // GTestIsInitialized() returns true iff the user has initialized
349 // GTestIsInitialized() returns true if and only if the user has initialized
370350 // Google Test. Useful for catching the user mistake of not initializing
371351 // Google Test before calling RUN_ALL_TESTS().
372352 static bool GTestIsInitialized() { return GetArgvs().size() > 0; }
373353
374 // Iterates over a vector of TestCases, keeping a running sum of the
354 // Iterates over a vector of TestSuites, keeping a running sum of the
375355 // results of calling a given int-returning method on each.
376356 // Returns the sum.
377 static int SumOverTestCaseList(const std::vector<TestCase*>& case_list,
378 int (TestCase::*method)() const) {
357 static int SumOverTestSuiteList(const std::vector<TestSuite*>& case_list,
358 int (TestSuite::*method)() const) {
379359 int sum = 0;
380360 for (size_t i = 0; i < case_list.size(); i++) {
381361 sum += (case_list[i]->*method)();
383363 return sum;
384364 }
385365
386 // Returns true iff the test case passed.
387 static bool TestCasePassed(const TestCase* test_case) {
388 return test_case->should_run() && test_case->Passed();
389 }
390
391 // Returns true iff the test case failed.
392 static bool TestCaseFailed(const TestCase* test_case) {
393 return test_case->should_run() && test_case->Failed();
394 }
395
396 // Returns true iff test_case contains at least one test that should
397 // run.
398 static bool ShouldRunTestCase(const TestCase* test_case) {
399 return test_case->should_run();
366 // Returns true if and only if the test suite passed.
367 static bool TestSuitePassed(const TestSuite* test_suite) {
368 return test_suite->should_run() && test_suite->Passed();
369 }
370
371 // Returns true if and only if the test suite failed.
372 static bool TestSuiteFailed(const TestSuite* test_suite) {
373 return test_suite->should_run() && test_suite->Failed();
374 }
375
376 // Returns true if and only if test_suite contains at least one test that
377 // should run.
378 static bool ShouldRunTestSuite(const TestSuite* test_suite) {
379 return test_suite->should_run();
400380 }
401381
402382 // AssertHelper constructor.
422402 ); // NOLINT
423403 }
424404
425 // Mutex for linked pointers.
426 GTEST_API_ GTEST_DEFINE_STATIC_MUTEX_(g_linked_ptr_mutex);
427
428405 // A copy of all command line arguments. Set by InitGoogleTest().
429406 static ::std::vector<std::string> g_argvs;
430407
444421 FilePath GetCurrentExecutableName() {
445422 FilePath result;
446423
447 #if GTEST_OS_WINDOWS
424 #if GTEST_OS_WINDOWS || GTEST_OS_OS2
448425 result.Set(FilePath(GetArgvs()[0]).RemoveExtension("exe"));
449426 #else
450427 result.Set(FilePath(GetArgvs()[0]));
459436 std::string UnitTestOptions::GetOutputFormat() {
460437 const char* const gtest_output_flag = GTEST_FLAG(output).c_str();
461438 const char* const colon = strchr(gtest_output_flag, ':');
462 return (colon == NULL) ?
463 std::string(gtest_output_flag) :
464 std::string(gtest_output_flag, colon - gtest_output_flag);
439 return (colon == nullptr)
440 ? std::string(gtest_output_flag)
441 : std::string(gtest_output_flag,
442 static_cast<size_t>(colon - gtest_output_flag));
465443 }
466444
467445 // Returns the name of the requested output file, or the default if none
474452 format = std::string(kDefaultOutputFormat);
475453
476454 const char* const colon = strchr(gtest_output_flag, ':');
477 if (colon == NULL)
455 if (colon == nullptr)
478456 return internal::FilePath::MakeFileName(
479457 internal::FilePath(
480458 UnitTest::GetInstance()->original_working_dir()),
483461
484462 internal::FilePath output_name(colon + 1);
485463 if (!output_name.IsAbsolutePath())
486 // FIXME: on Windows \some\path is not an absolute
487 // path (as its meaning depends on the current drive), yet the
488 // following logic for turning it into an absolute path is wrong.
489 // Fix it.
490464 output_name = internal::FilePath::ConcatPaths(
491465 internal::FilePath(UnitTest::GetInstance()->original_working_dir()),
492466 internal::FilePath(colon + 1));
500474 return result.string();
501475 }
502476
503 // Returns true iff the wildcard pattern matches the string. The
504 // first ':' or '\0' character in pattern marks the end of it.
477 // Returns true if and only if the wildcard pattern matches the string.
478 // The first ':' or '\0' character in pattern marks the end of it.
505479 //
506480 // This recursive algorithm isn't very efficient, but is clear and
507481 // works well enough for matching test names, which are short.
534508 cur_pattern = strchr(cur_pattern, ':');
535509
536510 // Returns if no more pattern can be found.
537 if (cur_pattern == NULL) {
511 if (cur_pattern == nullptr) {
538512 return false;
539513 }
540514
543517 }
544518 }
545519
546 // Returns true iff the user-specified filter matches the test case
547 // name and the test name.
548 bool UnitTestOptions::FilterMatchesTest(const std::string &test_case_name,
549 const std::string &test_name) {
550 const std::string& full_name = test_case_name + "." + test_name.c_str();
520 // Returns true if and only if the user-specified filter matches the test
521 // suite name and the test name.
522 bool UnitTestOptions::FilterMatchesTest(const std::string& test_suite_name,
523 const std::string& test_name) {
524 const std::string& full_name = test_suite_name + "." + test_name.c_str();
551525
552526 // Split --gtest_filter at '-', if there is one, to separate into
553527 // positive filter and negative filter portions
555529 const char* const dash = strchr(p, '-');
556530 std::string positive;
557531 std::string negative;
558 if (dash == NULL) {
532 if (dash == nullptr) {
559533 positive = GTEST_FLAG(filter).c_str(); // Whole string is a positive filter
560534 negative = "";
561535 } else {
700674 << r;
701675 }
702676
703 if (strstr(r.message(), substr.c_str()) == NULL) {
677 if (strstr(r.message(), substr.c_str()) == nullptr) {
704678 return AssertionFailure() << "Expected: " << expected << " containing \""
705679 << substr << "\"\n"
706680 << " Actual:\n"
769743 per_thread_test_part_result_reporter_.set(reporter);
770744 }
771745
772 // Gets the number of successful test cases.
773 int UnitTestImpl::successful_test_case_count() const {
774 return CountIf(test_cases_, TestCasePassed);
775 }
776
777 // Gets the number of failed test cases.
778 int UnitTestImpl::failed_test_case_count() const {
779 return CountIf(test_cases_, TestCaseFailed);
780 }
781
782 // Gets the number of all test cases.
783 int UnitTestImpl::total_test_case_count() const {
784 return static_cast<int>(test_cases_.size());
785 }
786
787 // Gets the number of all test cases that contain at least one test
746 // Gets the number of successful test suites.
747 int UnitTestImpl::successful_test_suite_count() const {
748 return CountIf(test_suites_, TestSuitePassed);
749 }
750
751 // Gets the number of failed test suites.
752 int UnitTestImpl::failed_test_suite_count() const {
753 return CountIf(test_suites_, TestSuiteFailed);
754 }
755
756 // Gets the number of all test suites.
757 int UnitTestImpl::total_test_suite_count() const {
758 return static_cast<int>(test_suites_.size());
759 }
760
761 // Gets the number of all test suites that contain at least one test
788762 // that should run.
789 int UnitTestImpl::test_case_to_run_count() const {
790 return CountIf(test_cases_, ShouldRunTestCase);
763 int UnitTestImpl::test_suite_to_run_count() const {
764 return CountIf(test_suites_, ShouldRunTestSuite);
791765 }
792766
793767 // Gets the number of successful tests.
794768 int UnitTestImpl::successful_test_count() const {
795 return SumOverTestCaseList(test_cases_, &TestCase::successful_test_count);
769 return SumOverTestSuiteList(test_suites_, &TestSuite::successful_test_count);
770 }
771
772 // Gets the number of skipped tests.
773 int UnitTestImpl::skipped_test_count() const {
774 return SumOverTestSuiteList(test_suites_, &TestSuite::skipped_test_count);
796775 }
797776
798777 // Gets the number of failed tests.
799778 int UnitTestImpl::failed_test_count() const {
800 return SumOverTestCaseList(test_cases_, &TestCase::failed_test_count);
779 return SumOverTestSuiteList(test_suites_, &TestSuite::failed_test_count);
801780 }
802781
803782 // Gets the number of disabled tests that will be reported in the XML report.
804783 int UnitTestImpl::reportable_disabled_test_count() const {
805 return SumOverTestCaseList(test_cases_,
806 &TestCase::reportable_disabled_test_count);
784 return SumOverTestSuiteList(test_suites_,
785 &TestSuite::reportable_disabled_test_count);
807786 }
808787
809788 // Gets the number of disabled tests.
810789 int UnitTestImpl::disabled_test_count() const {
811 return SumOverTestCaseList(test_cases_, &TestCase::disabled_test_count);
790 return SumOverTestSuiteList(test_suites_, &TestSuite::disabled_test_count);
812791 }
813792
814793 // Gets the number of tests to be printed in the XML report.
815794 int UnitTestImpl::reportable_test_count() const {
816 return SumOverTestCaseList(test_cases_, &TestCase::reportable_test_count);
795 return SumOverTestSuiteList(test_suites_, &TestSuite::reportable_test_count);
817796 }
818797
819798 // Gets the number of all tests.
820799 int UnitTestImpl::total_test_count() const {
821 return SumOverTestCaseList(test_cases_, &TestCase::total_test_count);
800 return SumOverTestSuiteList(test_suites_, &TestSuite::total_test_count);
822801 }
823802
824803 // Gets the number of tests that should run.
825804 int UnitTestImpl::test_to_run_count() const {
826 return SumOverTestCaseList(test_cases_, &TestCase::test_to_run_count);
805 return SumOverTestSuiteList(test_suites_, &TestSuite::test_to_run_count);
827806 }
828807
829808 // Returns the current OS stack trace as an std::string.
857836 SYSTEMTIME now_systime;
858837 FILETIME now_filetime;
859838 ULARGE_INTEGER now_int64;
860 // FIXME: Shouldn't this just use
861 // GetSystemTimeAsFileTime()?
862839 GetSystemTime(&now_systime);
863840 if (SystemTimeToFileTime(&now_systime, &now_filetime)) {
864841 now_int64.LowPart = now_filetime.dwLowDateTime;
873850
874851 // MSVC 8 deprecates _ftime64(), so we want to suppress warning 4996
875852 // (deprecated function) there.
876 // FIXME: Use GetTickCount()? Or use
877 // SystemTimeToFileTime()
878853 GTEST_DISABLE_MSC_DEPRECATED_PUSH_()
879854 _ftime64(&now);
880855 GTEST_DISABLE_MSC_DEPRECATED_POP_()
882857 return static_cast<TimeInMillis>(now.time) * 1000 + now.millitm;
883858 #elif GTEST_HAS_GETTIMEOFDAY_
884859 struct timeval now;
885 gettimeofday(&now, NULL);
860 gettimeofday(&now, nullptr);
886861 return static_cast<TimeInMillis>(now.tv_sec) * 1000 + now.tv_usec / 1000;
887862 #else
888863 # error "Don't know how to get the current time on your system."
899874 // value using delete[]. Returns the wide string, or NULL if the
900875 // input is NULL.
901876 LPCWSTR String::AnsiToUtf16(const char* ansi) {
902 if (!ansi) return NULL;
877 if (!ansi) return nullptr;
903878 const int length = strlen(ansi);
904879 const int unicode_length =
905 MultiByteToWideChar(CP_ACP, 0, ansi, length,
906 NULL, 0);
880 MultiByteToWideChar(CP_ACP, 0, ansi, length, nullptr, 0);
907881 WCHAR* unicode = new WCHAR[unicode_length + 1];
908882 MultiByteToWideChar(CP_ACP, 0, ansi, length,
909883 unicode, unicode_length);
916890 // value using delete[]. Returns the ANSI string, or NULL if the
917891 // input is NULL.
918892 const char* String::Utf16ToAnsi(LPCWSTR utf16_str) {
919 if (!utf16_str) return NULL;
920 const int ansi_length =
921 WideCharToMultiByte(CP_ACP, 0, utf16_str, -1,
922 NULL, 0, NULL, NULL);
893 if (!utf16_str) return nullptr;
894 const int ansi_length = WideCharToMultiByte(CP_ACP, 0, utf16_str, -1, nullptr,
895 0, nullptr, nullptr);
923896 char* ansi = new char[ansi_length + 1];
924 WideCharToMultiByte(CP_ACP, 0, utf16_str, -1,
925 ansi, ansi_length, NULL, NULL);
897 WideCharToMultiByte(CP_ACP, 0, utf16_str, -1, ansi, ansi_length, nullptr,
898 nullptr);
926899 ansi[ansi_length] = 0;
927900 return ansi;
928901 }
929902
930903 #endif // GTEST_OS_WINDOWS_MOBILE
931904
932 // Compares two C strings. Returns true iff they have the same content.
905 // Compares two C strings. Returns true if and only if they have the same
906 // content.
933907 //
934908 // Unlike strcmp(), this function can handle NULL argument(s). A NULL
935909 // C string is considered different to any non-NULL C string,
936910 // including the empty string.
937911 bool String::CStringEquals(const char * lhs, const char * rhs) {
938 if ( lhs == NULL ) return rhs == NULL;
939
940 if ( rhs == NULL ) return false;
912 if (lhs == nullptr) return rhs == nullptr;
913
914 if (rhs == nullptr) return false;
941915
942916 return strcmp(lhs, rhs) == 0;
943917 }
944918
945 #if GTEST_HAS_STD_WSTRING || GTEST_HAS_GLOBAL_WSTRING
919 #if GTEST_HAS_STD_WSTRING
946920
947921 // Converts an array of wide chars to a narrow string using the UTF-8
948922 // encoding, and streams the result to the given Message object.
960934 }
961935 }
962936
963 #endif // GTEST_HAS_STD_WSTRING || GTEST_HAS_GLOBAL_WSTRING
937 #endif // GTEST_HAS_STD_WSTRING
964938
965939 void SplitString(const ::std::string& str, char delimiter,
966940 ::std::vector< ::std::string>* dest) {
1010984 }
1011985 #endif // GTEST_HAS_STD_WSTRING
1012986
1013 #if GTEST_HAS_GLOBAL_WSTRING
1014 // Converts the given wide string to a narrow string using the UTF-8
1015 // encoding, and streams the result to this Message object.
1016 Message& Message::operator <<(const ::wstring& wstr) {
1017 internal::StreamWideCharsToMessage(wstr.c_str(), wstr.length(), this);
1018 return *this;
1019 }
1020 #endif // GTEST_HAS_GLOBAL_WSTRING
1021
1022987 // Gets the text streamed to this object so far as an std::string.
1023988 // Each '\0' character in the buffer is replaced with "\\0".
1024989 std::string Message::GetString() const {
1029994 // Used in EXPECT_TRUE/FALSE(assertion_result).
1030995 AssertionResult::AssertionResult(const AssertionResult& other)
1031996 : success_(other.success_),
1032 message_(other.message_.get() != NULL ?
1033 new ::std::string(*other.message_) :
1034 static_cast< ::std::string*>(NULL)) {
1035 }
997 message_(other.message_.get() != nullptr
998 ? new ::std::string(*other.message_)
999 : static_cast< ::std::string*>(nullptr)) {}
10361000
10371001 // Swaps two AssertionResults.
10381002 void AssertionResult::swap(AssertionResult& other) {
10441008 // Returns the assertion's negation. Used with EXPECT/ASSERT_FALSE.
10451009 AssertionResult AssertionResult::operator!() const {
10461010 AssertionResult negation(!success_);
1047 if (message_.get() != NULL)
1048 negation << *message_;
1011 if (message_.get() != nullptr) negation << *message_;
10491012 return negation;
10501013 }
10511014
12711234 for (; edit_i < edits.size(); ++edit_i) {
12721235 if (n_suffix >= context) {
12731236 // Continue only if the next hunk is very close.
1274 std::vector<EditType>::const_iterator it = edits.begin() + edit_i;
1237 auto it = edits.begin() + static_cast<int>(edit_i);
12751238 while (it != edits.end() && *it == kMatch) ++it;
1276 if (it == edits.end() || (it - edits.begin()) - edit_i >= context) {
1239 if (it == edits.end() ||
1240 static_cast<size_t>(it - edits.begin()) - edit_i >= context) {
12771241 // There is no next edit or it is too far away.
12781242 break;
12791243 }
13491313 // lhs_value: "5"
13501314 // rhs_value: "6"
13511315 //
1352 // The ignoring_case parameter is true iff the assertion is a
1316 // The ignoring_case parameter is true if and only if the assertion is a
13531317 // *_STRCASEEQ*. When it's true, the string "Ignoring case" will
13541318 // be inserted into the message.
13551319 AssertionResult EqFailure(const char* lhs_expression,
14121376 const double diff = fabs(val1 - val2);
14131377 if (diff <= abs_error) return AssertionSuccess();
14141378
1415 // FIXME: do not print the value of an expression if it's
1416 // already a literal.
14171379 return AssertionFailure()
14181380 << "The difference between " << expr1 << " and " << expr2
14191381 << " is " << diff << ", which exceeds " << abs_error_expr << ", where\n"
15941556
15951557 // Helper functions for implementing IsSubString() and IsNotSubstring().
15961558
1597 // This group of overloaded functions return true iff needle is a
1598 // substring of haystack. NULL is considered a substring of itself
1599 // only.
1559 // This group of overloaded functions return true if and only if needle
1560 // is a substring of haystack. NULL is considered a substring of
1561 // itself only.
16001562
16011563 bool IsSubstringPred(const char* needle, const char* haystack) {
1602 if (needle == NULL || haystack == NULL)
1603 return needle == haystack;
1604
1605 return strstr(haystack, needle) != NULL;
1564 if (needle == nullptr || haystack == nullptr) return needle == haystack;
1565
1566 return strstr(haystack, needle) != nullptr;
16061567 }
16071568
16081569 bool IsSubstringPred(const wchar_t* needle, const wchar_t* haystack) {
1609 if (needle == NULL || haystack == NULL)
1610 return needle == haystack;
1611
1612 return wcsstr(haystack, needle) != NULL;
1570 if (needle == nullptr || haystack == nullptr) return needle == haystack;
1571
1572 return wcsstr(haystack, needle) != nullptr;
16131573 }
16141574
16151575 // StringType here can be either ::std::string or ::std::wstring.
17231683 // Gets the system's human readable message string for this HRESULT.
17241684 char error_text[kBufSize] = { '\0' };
17251685 DWORD message_length = ::FormatMessageA(kFlags,
1726 0, // no source, we're asking system
1727 hr, // the error
1728 0, // no line width restrictions
1686 0, // no source, we're asking system
1687 static_cast<DWORD>(hr), // the error
1688 0, // no line width restrictions
17291689 error_text, // output buffer
1730 kBufSize, // buf size
1731 NULL); // no arguments for inserts
1690 kBufSize, // buf size
1691 nullptr); // no arguments for inserts
17321692 // Trims tailing white space (FormatMessage leaves a trailing CR-LF)
17331693 for (; message_length && IsSpace(error_text[message_length - 1]);
17341694 --message_length) {
18021762 // to "(Invalid Unicode 0xXXXXXXXX)".
18031763 std::string CodePointToUtf8(UInt32 code_point) {
18041764 if (code_point > kMaxCodePoint4) {
1805 return "(Invalid Unicode 0x" + String::FormatHexInt(code_point) + ")";
1765 return "(Invalid Unicode 0x" + String::FormatHexUInt32(code_point) + ")";
18061766 }
18071767
18081768 char str[5]; // Big enough for the largest valid code point.
18301790
18311791 // The following two functions only make sense if the system
18321792 // uses UTF-16 for wide string encoding. All supported systems
1833 // with 16 bit wchar_t (Windows, Cygwin, Symbian OS) do use UTF-16.
1793 // with 16 bit wchar_t (Windows, Cygwin) do use UTF-16.
18341794
18351795 // Determines if the arguments constitute UTF-16 surrogate pair
18361796 // and thus should be combined into a single Unicode code point
18431803 // Creates a Unicode code point from UTF16 surrogate pair.
18441804 inline UInt32 CreateCodePointFromUtf16SurrogatePair(wchar_t first,
18451805 wchar_t second) {
1806 const auto first_u = static_cast<UInt32>(first);
1807 const auto second_u = static_cast<UInt32>(second);
18461808 const UInt32 mask = (1 << 10) - 1;
1847 return (sizeof(wchar_t) == 2) ?
1848 (((first & mask) << 10) | (second & mask)) + 0x10000 :
1849 // This function should not be called when the condition is
1850 // false, but we provide a sensible default in case it is.
1851 static_cast<UInt32>(first);
1809 return (sizeof(wchar_t) == 2)
1810 ? (((first_u & mask) << 10) | (second_u & mask)) + 0x10000
1811 :
1812 // This function should not be called when the condition is
1813 // false, but we provide a sensible default in case it is.
1814 first_u;
18521815 }
18531816
18541817 // Converts a wide string to a narrow string in UTF-8 encoding.
18551818 // The wide string is assumed to have the following encoding:
1856 // UTF-16 if sizeof(wchar_t) == 2 (on Windows, Cygwin, Symbian OS)
1819 // UTF-16 if sizeof(wchar_t) == 2 (on Windows, Cygwin)
18571820 // UTF-32 if sizeof(wchar_t) == 4 (on Linux)
18581821 // Parameter str points to a null-terminated wide string.
18591822 // Parameter num_chars may additionally limit the number
18901853 // Converts a wide C string to an std::string using the UTF-8 encoding.
18911854 // NULL will be converted to "(null)".
18921855 std::string String::ShowWideCString(const wchar_t * wide_c_str) {
1893 if (wide_c_str == NULL) return "(null)";
1856 if (wide_c_str == nullptr) return "(null)";
18941857
18951858 return internal::WideStringToUtf8(wide_c_str, -1);
18961859 }
18971860
1898 // Compares two wide C strings. Returns true iff they have the same
1899 // content.
1861 // Compares two wide C strings. Returns true if and only if they have the
1862 // same content.
19001863 //
19011864 // Unlike wcscmp(), this function can handle NULL argument(s). A NULL
19021865 // C string is considered different to any non-NULL C string,
19031866 // including the empty string.
19041867 bool String::WideCStringEquals(const wchar_t * lhs, const wchar_t * rhs) {
1905 if (lhs == NULL) return rhs == NULL;
1906
1907 if (rhs == NULL) return false;
1868 if (lhs == nullptr) return rhs == nullptr;
1869
1870 if (rhs == nullptr) return false;
19081871
19091872 return wcscmp(lhs, rhs) == 0;
19101873 }
19401903 << " vs " << PrintToString(s2);
19411904 }
19421905
1943 // Compares two C strings, ignoring case. Returns true iff they have
1906 // Compares two C strings, ignoring case. Returns true if and only if they have
19441907 // the same content.
19451908 //
19461909 // Unlike strcasecmp(), this function can handle NULL argument(s). A
19471910 // NULL C string is considered different to any non-NULL C string,
19481911 // including the empty string.
19491912 bool String::CaseInsensitiveCStringEquals(const char * lhs, const char * rhs) {
1950 if (lhs == NULL)
1951 return rhs == NULL;
1952 if (rhs == NULL)
1953 return false;
1913 if (lhs == nullptr) return rhs == nullptr;
1914 if (rhs == nullptr) return false;
19541915 return posix::StrCaseCmp(lhs, rhs) == 0;
19551916 }
19561917
1957 // Compares two wide C strings, ignoring case. Returns true iff they
1958 // have the same content.
1959 //
1960 // Unlike wcscasecmp(), this function can handle NULL argument(s).
1961 // A NULL C string is considered different to any non-NULL wide C string,
1962 // including the empty string.
1963 // NB: The implementations on different platforms slightly differ.
1964 // On windows, this method uses _wcsicmp which compares according to LC_CTYPE
1965 // environment variable. On GNU platform this method uses wcscasecmp
1966 // which compares according to LC_CTYPE category of the current locale.
1967 // On MacOS X, it uses towlower, which also uses LC_CTYPE category of the
1968 // current locale.
1918 // Compares two wide C strings, ignoring case. Returns true if and only if they
1919 // have the same content.
1920 //
1921 // Unlike wcscasecmp(), this function can handle NULL argument(s).
1922 // A NULL C string is considered different to any non-NULL wide C string,
1923 // including the empty string.
1924 // NB: The implementations on different platforms slightly differ.
1925 // On windows, this method uses _wcsicmp which compares according to LC_CTYPE
1926 // environment variable. On GNU platform this method uses wcscasecmp
1927 // which compares according to LC_CTYPE category of the current locale.
1928 // On MacOS X, it uses towlower, which also uses LC_CTYPE category of the
1929 // current locale.
19691930 bool String::CaseInsensitiveWideCStringEquals(const wchar_t* lhs,
19701931 const wchar_t* rhs) {
1971 if (lhs == NULL) return rhs == NULL;
1972
1973 if (rhs == NULL) return false;
1932 if (lhs == nullptr) return rhs == nullptr;
1933
1934 if (rhs == nullptr) return false;
19741935
19751936 #if GTEST_OS_WINDOWS
19761937 return _wcsicmp(lhs, rhs) == 0;
19811942 // Other unknown OSes may not define it either.
19821943 wint_t left, right;
19831944 do {
1984 left = towlower(*lhs++);
1985 right = towlower(*rhs++);
1945 left = towlower(static_cast<wint_t>(*lhs++));
1946 right = towlower(static_cast<wint_t>(*rhs++));
19861947 } while (left && left == right);
19871948 return left == right;
19881949 #endif // OS selector
19891950 }
19901951
1991 // Returns true iff str ends with the given suffix, ignoring case.
1952 // Returns true if and only if str ends with the given suffix, ignoring case.
19921953 // Any string is considered to end with an empty suffix.
19931954 bool String::EndsWithCaseInsensitive(
19941955 const std::string& str, const std::string& suffix) {
20071968 }
20081969
20091970 // Formats an int value as "%X".
2010 std::string String::FormatHexInt(int value) {
1971 std::string String::FormatHexUInt32(UInt32 value) {
20111972 std::stringstream ss;
20121973 ss << std::hex << std::uppercase << value;
20131974 return ss.str();
1975 }
1976
1977 // Formats an int value as "%X".
1978 std::string String::FormatHexInt(int value) {
1979 return FormatHexUInt32(static_cast<UInt32>(value));
20141980 }
20151981
20161982 // Formats a byte as "%02X".
20291995 const char* const end = start + str.length();
20301996
20311997 std::string result;
2032 result.reserve(2 * (end - start));
1998 result.reserve(static_cast<size_t>(2 * (end - start)));
20331999 for (const char* ch = start; ch != end; ++ch) {
20342000 if (*ch == '\0') {
20352001 result += "\\0"; // Replaces NUL with "\\0";
20592025
20602026 // Creates an empty TestResult.
20612027 TestResult::TestResult()
2062 : death_test_count_(0),
2063 elapsed_time_(0) {
2064 }
2028 : death_test_count_(0), start_timestamp_(0), elapsed_time_(0) {}
20652029
20662030 // D'tor.
20672031 TestResult::~TestResult() {
20732037 const TestPartResult& TestResult::GetTestPartResult(int i) const {
20742038 if (i < 0 || i >= total_part_count())
20752039 internal::posix::Abort();
2076 return test_part_results_.at(i);
2040 return test_part_results_.at(static_cast<size_t>(i));
20772041 }
20782042
20792043 // Returns the i-th test property. i can range from 0 to
20822046 const TestProperty& TestResult::GetTestProperty(int i) const {
20832047 if (i < 0 || i >= test_property_count())
20842048 internal::posix::Abort();
2085 return test_properties_.at(i);
2049 return test_properties_.at(static_cast<size_t>(i));
20862050 }
20872051
20882052 // Clears the test part results.
21302094 // The list of reserved attributes used in the <testsuite> element of XML
21312095 // output.
21322096 static const char* const kReservedTestSuiteAttributes[] = {
2133 "disabled",
2134 "errors",
2135 "failures",
2136 "name",
2137 "tests",
2138 "time"
2139 };
2097 "disabled", "errors", "failures", "name", "tests", "time", "timestamp"};
21402098
21412099 // The list of reserved attributes used in the <testcase> element of XML output.
21422100 static const char* const kReservedTestCaseAttributes[] = {
2143 "classname", "name", "status", "time",
2144 "type_param", "value_param", "file", "line"};
2101 "classname", "name", "status", "time", "type_param",
2102 "value_param", "file", "line"};
2103
2104 // Use a slightly different set for allowed output to ensure existing tests can
2105 // still RecordProperty("result") or "RecordProperty(timestamp")
2106 static const char* const kReservedOutputTestCaseAttributes[] = {
2107 "classname", "name", "status", "time", "type_param",
2108 "value_param", "file", "line", "result", "timestamp"};
21452109
21462110 template <int kSize>
21472111 std::vector<std::string> ArrayAsVector(const char* const (&array)[kSize]) {
21632127 return std::vector<std::string>();
21642128 }
21652129
2130 // TODO(jdesprez): Merge the two getReserved attributes once skip is improved
2131 static std::vector<std::string> GetReservedOutputAttributesForElement(
2132 const std::string& xml_element) {
2133 if (xml_element == "testsuites") {
2134 return ArrayAsVector(kReservedTestSuitesAttributes);
2135 } else if (xml_element == "testsuite") {
2136 return ArrayAsVector(kReservedTestSuiteAttributes);
2137 } else if (xml_element == "testcase") {
2138 return ArrayAsVector(kReservedOutputTestCaseAttributes);
2139 } else {
2140 GTEST_CHECK_(false) << "Unrecognized xml_element provided: " << xml_element;
2141 }
2142 // This code is unreachable but some compilers may not realizes that.
2143 return std::vector<std::string>();
2144 }
2145
21662146 static std::string FormatWordList(const std::vector<std::string>& words) {
21672147 Message word_list;
21682148 for (size_t i = 0; i < words.size(); ++i) {
22062186 elapsed_time_ = 0;
22072187 }
22082188
2209 // Returns true iff the test failed.
2189 // Returns true off the test part was skipped.
2190 static bool TestPartSkipped(const TestPartResult& result) {
2191 return result.skipped();
2192 }
2193
2194 // Returns true if and only if the test was skipped.
2195 bool TestResult::Skipped() const {
2196 return !Failed() && CountIf(test_part_results_, TestPartSkipped) > 0;
2197 }
2198
2199 // Returns true if and only if the test failed.
22102200 bool TestResult::Failed() const {
22112201 for (int i = 0; i < total_part_count(); ++i) {
22122202 if (GetTestPartResult(i).failed())
22152205 return false;
22162206 }
22172207
2218 // Returns true iff the test part fatally failed.
2208 // Returns true if and only if the test part fatally failed.
22192209 static bool TestPartFatallyFailed(const TestPartResult& result) {
22202210 return result.fatally_failed();
22212211 }
22222212
2223 // Returns true iff the test fatally failed.
2213 // Returns true if and only if the test fatally failed.
22242214 bool TestResult::HasFatalFailure() const {
22252215 return CountIf(test_part_results_, TestPartFatallyFailed) > 0;
22262216 }
22272217
2228 // Returns true iff the test part non-fatally failed.
2218 // Returns true if and only if the test part non-fatally failed.
22292219 static bool TestPartNonfatallyFailed(const TestPartResult& result) {
22302220 return result.nonfatally_failed();
22312221 }
22322222
2233 // Returns true iff the test has a non-fatal failure.
2223 // Returns true if and only if the test has a non-fatal failure.
22342224 bool TestResult::HasNonfatalFailure() const {
22352225 return CountIf(test_part_results_, TestPartNonfatallyFailed) > 0;
22362226 }
22932283 // AddTestPartResult.
22942284 UnitTest::GetInstance()->AddTestPartResult(
22952285 result_type,
2296 NULL, // No info about the source file where the exception occurred.
2297 -1, // We have no info on which line caused the exception.
2286 nullptr, // No info about the source file where the exception occurred.
2287 -1, // We have no info on which line caused the exception.
22982288 message,
2299 ""); // No stack trace, either.
2289 ""); // No stack trace, either.
23002290 }
23012291
23022292 } // namespace internal
23032293
2304 // Google Test requires all tests in the same test case to use the same test
2294 // Google Test requires all tests in the same test suite to use the same test
23052295 // fixture class. This function checks if the current test has the
2306 // same fixture class as the first test in the current test case. If
2296 // same fixture class as the first test in the current test suite. If
23072297 // yes, it returns true; otherwise it generates a Google Test failure and
23082298 // returns false.
23092299 bool Test::HasSameFixtureClass() {
23102300 internal::UnitTestImpl* const impl = internal::GetUnitTestImpl();
2311 const TestCase* const test_case = impl->current_test_case();
2312
2313 // Info about the first test in the current test case.
2314 const TestInfo* const first_test_info = test_case->test_info_list()[0];
2301 const TestSuite* const test_suite = impl->current_test_suite();
2302
2303 // Info about the first test in the current test suite.
2304 const TestInfo* const first_test_info = test_suite->test_info_list()[0];
23152305 const internal::TypeId first_fixture_id = first_test_info->fixture_class_id_;
23162306 const char* const first_test_name = first_test_info->name();
23172307
23272317 const bool this_is_TEST = this_fixture_id == internal::GetTestTypeId();
23282318
23292319 if (first_is_TEST || this_is_TEST) {
2330 // Both TEST and TEST_F appear in same test case, which is incorrect.
2320 // Both TEST and TEST_F appear in same test suite, which is incorrect.
23312321 // Tell the user how to fix this.
23322322
23332323 // Gets the name of the TEST and the name of the TEST_F. Note
23392329 first_is_TEST ? this_test_name : first_test_name;
23402330
23412331 ADD_FAILURE()
2342 << "All tests in the same test case must use the same test fixture\n"
2343 << "class, so mixing TEST_F and TEST in the same test case is\n"
2344 << "illegal. In test case " << this_test_info->test_case_name()
2332 << "All tests in the same test suite must use the same test fixture\n"
2333 << "class, so mixing TEST_F and TEST in the same test suite is\n"
2334 << "illegal. In test suite " << this_test_info->test_suite_name()
23452335 << ",\n"
23462336 << "test " << TEST_F_name << " is defined using TEST_F but\n"
23472337 << "test " << TEST_name << " is defined using TEST. You probably\n"
23512341 // Two fixture classes with the same name appear in two different
23522342 // namespaces, which is not allowed. Tell the user how to fix this.
23532343 ADD_FAILURE()
2354 << "All tests in the same test case must use the same test fixture\n"
2355 << "class. However, in test case "
2356 << this_test_info->test_case_name() << ",\n"
2357 << "you defined test " << first_test_name
2358 << " and test " << this_test_name << "\n"
2344 << "All tests in the same test suite must use the same test fixture\n"
2345 << "class. However, in test suite "
2346 << this_test_info->test_suite_name() << ",\n"
2347 << "you defined test " << first_test_name << " and test "
2348 << this_test_name << "\n"
23592349 << "using two different test fixture classes. This can happen if\n"
23602350 << "the two classes are from different namespaces or translation\n"
23612351 << "units and have the same name. You should probably rename one\n"
2362 << "of the classes to put the tests into different test cases.";
2352 << "of the classes to put the tests into different test suites.";
23632353 }
23642354 return false;
23652355 }
23922382 static std::string FormatCxxExceptionMessage(const char* description,
23932383 const char* location) {
23942384 Message message;
2395 if (description != NULL) {
2385 if (description != nullptr) {
23962386 message << "C++ exception with description \"" << description << "\"";
23972387 } else {
23982388 message << "Unknown C++ exception";
24902480 } catch (...) { // NOLINT
24912481 internal::ReportFailureInUnknownLocation(
24922482 TestPartResult::kFatalFailure,
2493 FormatCxxExceptionMessage(NULL, location));
2483 FormatCxxExceptionMessage(nullptr, location));
24942484 }
24952485 return static_cast<Result>(0);
24962486 #else
25102500 internal::UnitTestImpl* const impl = internal::GetUnitTestImpl();
25112501 impl->os_stack_trace_getter()->UponLeavingGTest();
25122502 internal::HandleExceptionsInMethodIfSupported(this, &Test::SetUp, "SetUp()");
2513 // We will run the test only if SetUp() was successful.
2514 if (!HasFatalFailure()) {
2503 // We will run the test only if SetUp() was successful and didn't call
2504 // GTEST_SKIP().
2505 if (!HasFatalFailure() && !IsSkipped()) {
25152506 impl->os_stack_trace_getter()->UponLeavingGTest();
25162507 internal::HandleExceptionsInMethodIfSupported(
25172508 this, &Test::TestBody, "the test body");
25252516 this, &Test::TearDown, "TearDown()");
25262517 }
25272518
2528 // Returns true iff the current test has a fatal failure.
2519 // Returns true if and only if the current test has a fatal failure.
25292520 bool Test::HasFatalFailure() {
25302521 return internal::GetUnitTestImpl()->current_test_result()->HasFatalFailure();
25312522 }
25322523
2533 // Returns true iff the current test has a non-fatal failure.
2524 // Returns true if and only if the current test has a non-fatal failure.
25342525 bool Test::HasNonfatalFailure() {
25352526 return internal::GetUnitTestImpl()->current_test_result()->
25362527 HasNonfatalFailure();
25372528 }
25382529
2530 // Returns true if and only if the current test was skipped.
2531 bool Test::IsSkipped() {
2532 return internal::GetUnitTestImpl()->current_test_result()->Skipped();
2533 }
2534
25392535 // class TestInfo
25402536
25412537 // Constructs a TestInfo object. It assumes ownership of the test factory
25422538 // object.
2543 TestInfo::TestInfo(const std::string& a_test_case_name,
2544 const std::string& a_name,
2545 const char* a_type_param,
2539 TestInfo::TestInfo(const std::string& a_test_suite_name,
2540 const std::string& a_name, const char* a_type_param,
25462541 const char* a_value_param,
25472542 internal::CodeLocation a_code_location,
25482543 internal::TypeId fixture_class_id,
25492544 internal::TestFactoryBase* factory)
2550 : test_case_name_(a_test_case_name),
2545 : test_suite_name_(a_test_suite_name),
25512546 name_(a_name),
2552 type_param_(a_type_param ? new std::string(a_type_param) : NULL),
2553 value_param_(a_value_param ? new std::string(a_value_param) : NULL),
2547 type_param_(a_type_param ? new std::string(a_type_param) : nullptr),
2548 value_param_(a_value_param ? new std::string(a_value_param) : nullptr),
25542549 location_(a_code_location),
25552550 fixture_class_id_(fixture_class_id),
25562551 should_run_(false),
25692564 //
25702565 // Arguments:
25712566 //
2572 // test_case_name: name of the test case
2567 // test_suite_name: name of the test suite
25732568 // name: name of the test
25742569 // type_param: the name of the test's type parameter, or NULL if
25752570 // this is not a typed or a type-parameterized test.
25772572 // or NULL if this is not a value-parameterized test.
25782573 // code_location: code location where the test is defined
25792574 // fixture_class_id: ID of the test fixture class
2580 // set_up_tc: pointer to the function that sets up the test case
2581 // tear_down_tc: pointer to the function that tears down the test case
2575 // set_up_tc: pointer to the function that sets up the test suite
2576 // tear_down_tc: pointer to the function that tears down the test suite
25822577 // factory: pointer to the factory that creates a test object.
25832578 // The newly created TestInfo instance will assume
25842579 // ownership of the factory object.
25852580 TestInfo* MakeAndRegisterTestInfo(
2586 const char* test_case_name,
2587 const char* name,
2588 const char* type_param,
2589 const char* value_param,
2590 CodeLocation code_location,
2591 TypeId fixture_class_id,
2592 SetUpTestCaseFunc set_up_tc,
2593 TearDownTestCaseFunc tear_down_tc,
2594 TestFactoryBase* factory) {
2581 const char* test_suite_name, const char* name, const char* type_param,
2582 const char* value_param, CodeLocation code_location,
2583 TypeId fixture_class_id, SetUpTestSuiteFunc set_up_tc,
2584 TearDownTestSuiteFunc tear_down_tc, TestFactoryBase* factory) {
25952585 TestInfo* const test_info =
2596 new TestInfo(test_case_name, name, type_param, value_param,
2586 new TestInfo(test_suite_name, name, type_param, value_param,
25972587 code_location, fixture_class_id, factory);
25982588 GetUnitTestImpl()->AddTestInfo(set_up_tc, tear_down_tc, test_info);
25992589 return test_info;
26002590 }
26012591
2602 void ReportInvalidTestCaseType(const char* test_case_name,
2603 CodeLocation code_location) {
2592 void ReportInvalidTestSuiteType(const char* test_suite_name,
2593 CodeLocation code_location) {
26042594 Message errors;
26052595 errors
2606 << "Attempted redefinition of test case " << test_case_name << ".\n"
2607 << "All tests in the same test case must use the same test fixture\n"
2608 << "class. However, in test case " << test_case_name << ", you tried\n"
2596 << "Attempted redefinition of test suite " << test_suite_name << ".\n"
2597 << "All tests in the same test suite must use the same test fixture\n"
2598 << "class. However, in test suite " << test_suite_name << ", you tried\n"
26092599 << "to define a test using a fixture class different from the one\n"
26102600 << "used earlier. This can happen if the two fixture classes are\n"
26112601 << "from different namespaces and have the same name. You should\n"
26122602 << "probably rename one of the classes to put the tests into different\n"
2613 << "test cases.";
2603 << "test suites.";
26142604
26152605 GTEST_LOG_(ERROR) << FormatFileLocation(code_location.file.c_str(),
26162606 code_location.line)
26232613 // A predicate that checks the test name of a TestInfo against a known
26242614 // value.
26252615 //
2626 // This is used for implementation of the TestCase class only. We put
2616 // This is used for implementation of the TestSuite class only. We put
26272617 // it in the anonymous namespace to prevent polluting the outer
26282618 // namespace.
26292619 //
26362626 explicit TestNameIs(const char* name)
26372627 : name_(name) {}
26382628
2639 // Returns true iff the test name of test_info matches name_.
2629 // Returns true if and only if the test name of test_info matches name_.
26402630 bool operator()(const TestInfo * test_info) const {
26412631 return test_info && test_info->name() == name_;
26422632 }
26502640 namespace internal {
26512641
26522642 // This method expands all parameterized tests registered with macros TEST_P
2653 // and INSTANTIATE_TEST_CASE_P into regular tests and registers those.
2643 // and INSTANTIATE_TEST_SUITE_P into regular tests and registers those.
26542644 // This will be done just once during the program runtime.
26552645 void UnitTestImpl::RegisterParameterizedTests() {
26562646 if (!parameterized_tests_registered_) {
26842674 factory_, &internal::TestFactoryBase::CreateTest,
26852675 "the test fixture's constructor");
26862676
2687 // Runs the test if the constructor didn't generate a fatal failure.
2677 // Runs the test if the constructor didn't generate a fatal failure or invoke
2678 // GTEST_SKIP().
26882679 // Note that the object will not be null
2689 if (!Test::HasFatalFailure()) {
2680 if (!Test::HasFatalFailure() && !Test::IsSkipped()) {
26902681 // This doesn't throw as all user code that can throw are wrapped into
26912682 // exception handling code.
26922683 test->Run();
26932684 }
26942685
2686 if (test != nullptr) {
26952687 // Deletes the test object.
26962688 impl->os_stack_trace_getter()->UponLeavingGTest();
26972689 internal::HandleExceptionsInMethodIfSupported(
26982690 test, &Test::DeleteSelf_, "the test fixture's destructor");
2699
2691 }
2692
2693 result_.set_start_timestamp(start);
27002694 result_.set_elapsed_time(internal::GetTimeInMillis() - start);
27012695
27022696 // Notifies the unit test event listener that a test has just finished.
27042698
27052699 // Tells UnitTest to stop associating assertion results to this
27062700 // test.
2707 impl->set_current_test_info(NULL);
2708 }
2709
2710 // class TestCase
2711
2712 // Gets the number of successful tests in this test case.
2713 int TestCase::successful_test_count() const {
2701 impl->set_current_test_info(nullptr);
2702 }
2703
2704 // class TestSuite
2705
2706 // Gets the number of successful tests in this test suite.
2707 int TestSuite::successful_test_count() const {
27142708 return CountIf(test_info_list_, TestPassed);
27152709 }
27162710
2717 // Gets the number of failed tests in this test case.
2718 int TestCase::failed_test_count() const {
2711 // Gets the number of successful tests in this test suite.
2712 int TestSuite::skipped_test_count() const {
2713 return CountIf(test_info_list_, TestSkipped);
2714 }
2715
2716 // Gets the number of failed tests in this test suite.
2717 int TestSuite::failed_test_count() const {
27192718 return CountIf(test_info_list_, TestFailed);
27202719 }
27212720
27222721 // Gets the number of disabled tests that will be reported in the XML report.
2723 int TestCase::reportable_disabled_test_count() const {
2722 int TestSuite::reportable_disabled_test_count() const {
27242723 return CountIf(test_info_list_, TestReportableDisabled);
27252724 }
27262725
2727 // Gets the number of disabled tests in this test case.
2728 int TestCase::disabled_test_count() const {
2726 // Gets the number of disabled tests in this test suite.
2727 int TestSuite::disabled_test_count() const {
27292728 return CountIf(test_info_list_, TestDisabled);
27302729 }
27312730
27322731 // Gets the number of tests to be printed in the XML report.
2733 int TestCase::reportable_test_count() const {
2732 int TestSuite::reportable_test_count() const {
27342733 return CountIf(test_info_list_, TestReportable);
27352734 }
27362735
2737 // Get the number of tests in this test case that should run.
2738 int TestCase::test_to_run_count() const {
2736 // Get the number of tests in this test suite that should run.
2737 int TestSuite::test_to_run_count() const {
27392738 return CountIf(test_info_list_, ShouldRunTest);
27402739 }
27412740
27422741 // Gets the number of all tests.
2743 int TestCase::total_test_count() const {
2742 int TestSuite::total_test_count() const {
27442743 return static_cast<int>(test_info_list_.size());
27452744 }
27462745
2747 // Creates a TestCase with the given name.
2746 // Creates a TestSuite with the given name.
27482747 //
27492748 // Arguments:
27502749 //
2751 // name: name of the test case
2752 // a_type_param: the name of the test case's type parameter, or NULL if
2753 // this is not a typed or a type-parameterized test case.
2754 // set_up_tc: pointer to the function that sets up the test case
2755 // tear_down_tc: pointer to the function that tears down the test case
2756 TestCase::TestCase(const char* a_name, const char* a_type_param,
2757 Test::SetUpTestCaseFunc set_up_tc,
2758 Test::TearDownTestCaseFunc tear_down_tc)
2750 // name: name of the test suite
2751 // a_type_param: the name of the test suite's type parameter, or NULL if
2752 // this is not a typed or a type-parameterized test suite.
2753 // set_up_tc: pointer to the function that sets up the test suite
2754 // tear_down_tc: pointer to the function that tears down the test suite
2755 TestSuite::TestSuite(const char* a_name, const char* a_type_param,
2756 internal::SetUpTestSuiteFunc set_up_tc,
2757 internal::TearDownTestSuiteFunc tear_down_tc)
27592758 : name_(a_name),
2760 type_param_(a_type_param ? new std::string(a_type_param) : NULL),
2759 type_param_(a_type_param ? new std::string(a_type_param) : nullptr),
27612760 set_up_tc_(set_up_tc),
27622761 tear_down_tc_(tear_down_tc),
27632762 should_run_(false),
2764 elapsed_time_(0) {
2765 }
2766
2767 // Destructor of TestCase.
2768 TestCase::~TestCase() {
2763 start_timestamp_(0),
2764 elapsed_time_(0) {}
2765
2766 // Destructor of TestSuite.
2767 TestSuite::~TestSuite() {
27692768 // Deletes every Test in the collection.
27702769 ForEach(test_info_list_, internal::Delete<TestInfo>);
27712770 }
27722771
27732772 // Returns the i-th test among all the tests. i can range from 0 to
27742773 // total_test_count() - 1. If i is not in that range, returns NULL.
2775 const TestInfo* TestCase::GetTestInfo(int i) const {
2774 const TestInfo* TestSuite::GetTestInfo(int i) const {
27762775 const int index = GetElementOr(test_indices_, i, -1);
2777 return index < 0 ? NULL : test_info_list_[index];
2776 return index < 0 ? nullptr : test_info_list_[static_cast<size_t>(index)];
27782777 }
27792778
27802779 // Returns the i-th test among all the tests. i can range from 0 to
27812780 // total_test_count() - 1. If i is not in that range, returns NULL.
2782 TestInfo* TestCase::GetMutableTestInfo(int i) {
2781 TestInfo* TestSuite::GetMutableTestInfo(int i) {
27832782 const int index = GetElementOr(test_indices_, i, -1);
2784 return index < 0 ? NULL : test_info_list_[index];
2785 }
2786
2787 // Adds a test to this test case. Will delete the test upon
2788 // destruction of the TestCase object.
2789 void TestCase::AddTestInfo(TestInfo * test_info) {
2783 return index < 0 ? nullptr : test_info_list_[static_cast<size_t>(index)];
2784 }
2785
2786 // Adds a test to this test suite. Will delete the test upon
2787 // destruction of the TestSuite object.
2788 void TestSuite::AddTestInfo(TestInfo* test_info) {
27902789 test_info_list_.push_back(test_info);
27912790 test_indices_.push_back(static_cast<int>(test_indices_.size()));
27922791 }
27932792
2794 // Runs every test in this TestCase.
2795 void TestCase::Run() {
2793 // Runs every test in this TestSuite.
2794 void TestSuite::Run() {
27962795 if (!should_run_) return;
27972796
27982797 internal::UnitTestImpl* const impl = internal::GetUnitTestImpl();
2799 impl->set_current_test_case(this);
2798 impl->set_current_test_suite(this);
28002799
28012800 TestEventListener* repeater = UnitTest::GetInstance()->listeners().repeater();
28022801
2802 // Call both legacy and the new API
2803 repeater->OnTestSuiteStart(*this);
2804 // Legacy API is deprecated but still available
2805 #ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI
28032806 repeater->OnTestCaseStart(*this);
2807 #endif // GTEST_REMOVE_LEGACY_TEST_CASEAPI
2808
28042809 impl->os_stack_trace_getter()->UponLeavingGTest();
28052810 internal::HandleExceptionsInMethodIfSupported(
2806 this, &TestCase::RunSetUpTestCase, "SetUpTestCase()");
2807
2808 const internal::TimeInMillis start = internal::GetTimeInMillis();
2811 this, &TestSuite::RunSetUpTestSuite, "SetUpTestSuite()");
2812
2813 start_timestamp_ = internal::GetTimeInMillis();
28092814 for (int i = 0; i < total_test_count(); i++) {
28102815 GetMutableTestInfo(i)->Run();
28112816 }
2812 elapsed_time_ = internal::GetTimeInMillis() - start;
2817 elapsed_time_ = internal::GetTimeInMillis() - start_timestamp_;
28132818
28142819 impl->os_stack_trace_getter()->UponLeavingGTest();
28152820 internal::HandleExceptionsInMethodIfSupported(
2816 this, &TestCase::RunTearDownTestCase, "TearDownTestCase()");
2817
2821 this, &TestSuite::RunTearDownTestSuite, "TearDownTestSuite()");
2822
2823 // Call both legacy and the new API
2824 repeater->OnTestSuiteEnd(*this);
2825 // Legacy API is deprecated but still available
2826 #ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI
28182827 repeater->OnTestCaseEnd(*this);
2819 impl->set_current_test_case(NULL);
2820 }
2821
2822 // Clears the results of all tests in this test case.
2823 void TestCase::ClearResult() {
2828 #endif // GTEST_REMOVE_LEGACY_TEST_CASEAPI
2829
2830 impl->set_current_test_suite(nullptr);
2831 }
2832
2833 // Clears the results of all tests in this test suite.
2834 void TestSuite::ClearResult() {
28242835 ad_hoc_test_result_.Clear();
28252836 ForEach(test_info_list_, TestInfo::ClearTestResult);
28262837 }
28272838
2828 // Shuffles the tests in this test case.
2829 void TestCase::ShuffleTests(internal::Random* random) {
2839 // Shuffles the tests in this test suite.
2840 void TestSuite::ShuffleTests(internal::Random* random) {
28302841 Shuffle(random, &test_indices_);
28312842 }
28322843
28332844 // Restores the test order to before the first shuffle.
2834 void TestCase::UnshuffleTests() {
2845 void TestSuite::UnshuffleTests() {
28352846 for (size_t i = 0; i < test_indices_.size(); i++) {
28362847 test_indices_[i] = static_cast<int>(i);
28372848 }
28542865 return FormatCountableNoun(test_count, "test", "tests");
28552866 }
28562867
2857 // Formats the count of test cases.
2858 static std::string FormatTestCaseCount(int test_case_count) {
2859 return FormatCountableNoun(test_case_count, "test case", "test cases");
2868 // Formats the count of test suites.
2869 static std::string FormatTestSuiteCount(int test_suite_count) {
2870 return FormatCountableNoun(test_suite_count, "test suite", "test suites");
28602871 }
28612872
28622873 // Converts a TestPartResult::Type enum to human-friendly string
28652876 // between the two when viewing the test result.
28662877 static const char * TestPartResultTypeToString(TestPartResult::Type type) {
28672878 switch (type) {
2879 case TestPartResult::kSkip:
2880 return "Skipped";
28682881 case TestPartResult::kSuccess:
28692882 return "Success";
28702883
29122925 }
29132926
29142927 // class PrettyUnitTestResultPrinter
2915
2916 enum GTestColor {
2917 COLOR_DEFAULT,
2918 COLOR_RED,
2919 COLOR_GREEN,
2920 COLOR_YELLOW
2921 };
2922
29232928 #if GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_MOBILE && \
29242929 !GTEST_OS_WINDOWS_PHONE && !GTEST_OS_WINDOWS_RT && !GTEST_OS_WINDOWS_MINGW
29252930
29732978 case COLOR_RED: return "1";
29742979 case COLOR_GREEN: return "2";
29752980 case COLOR_YELLOW: return "3";
2976 default: return NULL;
2977 };
2981 default:
2982 return nullptr;
2983 }
29782984 }
29792985
29802986 #endif // GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_MOBILE
29812987
2982 // Returns true iff Google Test should use colors in the output.
2988 // Returns true if and only if Google Test should use colors in the output.
29832989 bool ShouldUseColor(bool stdout_is_tty) {
29842990 const char* const gtest_color = GTEST_FLAG(color).c_str();
29852991
30243030 va_list args;
30253031 va_start(args, fmt);
30263032
3027 #if GTEST_OS_WINDOWS_MOBILE || GTEST_OS_SYMBIAN || GTEST_OS_ZOS || \
3028 GTEST_OS_IOS || GTEST_OS_WINDOWS_PHONE || GTEST_OS_WINDOWS_RT
3033 #if GTEST_OS_WINDOWS_MOBILE || GTEST_OS_ZOS || GTEST_OS_IOS || \
3034 GTEST_OS_WINDOWS_PHONE || GTEST_OS_WINDOWS_RT || defined(ESP_PLATFORM)
30293035 const bool use_color = AlwaysFalse();
30303036 #else
30313037 static const bool in_color_mode =
30323038 ShouldUseColor(posix::IsATTY(posix::FileNo(stdout)) != 0);
30333039 const bool use_color = in_color_mode && (color != COLOR_DEFAULT);
3034 #endif // GTEST_OS_WINDOWS_MOBILE || GTEST_OS_SYMBIAN || GTEST_OS_ZOS
3035 // The '!= 0' comparison is necessary to satisfy MSVC 7.1.
3040 #endif // GTEST_OS_WINDOWS_MOBILE || GTEST_OS_ZOS
30363041
30373042 if (!use_color) {
30383043 vprintf(fmt, args);
30783083 const char* const type_param = test_info.type_param();
30793084 const char* const value_param = test_info.value_param();
30803085
3081 if (type_param != NULL || value_param != NULL) {
3086 if (type_param != nullptr || value_param != nullptr) {
30823087 printf(", where ");
3083 if (type_param != NULL) {
3088 if (type_param != nullptr) {
30843089 printf("%s = %s", kTypeParamLabel, type_param);
3085 if (value_param != NULL)
3086 printf(" and ");
3087 }
3088 if (value_param != NULL) {
3090 if (value_param != nullptr) printf(" and ");
3091 }
3092 if (value_param != nullptr) {
30893093 printf("%s = %s", kValueParamLabel, value_param);
30903094 }
30913095 }
30973101 class PrettyUnitTestResultPrinter : public TestEventListener {
30983102 public:
30993103 PrettyUnitTestResultPrinter() {}
3100 static void PrintTestName(const char * test_case, const char * test) {
3101 printf("%s.%s", test_case, test);
3104 static void PrintTestName(const char* test_suite, const char* test) {
3105 printf("%s.%s", test_suite, test);
31023106 }
31033107
31043108 // The following methods override what's in the TestEventListener class.
3105 virtual void OnTestProgramStart(const UnitTest& /*unit_test*/) {}
3106 virtual void OnTestIterationStart(const UnitTest& unit_test, int iteration);
3107 virtual void OnEnvironmentsSetUpStart(const UnitTest& unit_test);
3108 virtual void OnEnvironmentsSetUpEnd(const UnitTest& /*unit_test*/) {}
3109 virtual void OnTestCaseStart(const TestCase& test_case);
3110 virtual void OnTestStart(const TestInfo& test_info);
3111 virtual void OnTestPartResult(const TestPartResult& result);
3112 virtual void OnTestEnd(const TestInfo& test_info);
3113 virtual void OnTestCaseEnd(const TestCase& test_case);
3114 virtual void OnEnvironmentsTearDownStart(const UnitTest& unit_test);
3115 virtual void OnEnvironmentsTearDownEnd(const UnitTest& /*unit_test*/) {}
3116 virtual void OnTestIterationEnd(const UnitTest& unit_test, int iteration);
3117 virtual void OnTestProgramEnd(const UnitTest& /*unit_test*/) {}
3109 void OnTestProgramStart(const UnitTest& /*unit_test*/) override {}
3110 void OnTestIterationStart(const UnitTest& unit_test, int iteration) override;
3111 void OnEnvironmentsSetUpStart(const UnitTest& unit_test) override;
3112 void OnEnvironmentsSetUpEnd(const UnitTest& /*unit_test*/) override {}
3113 #ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_
3114 void OnTestCaseStart(const TestCase& test_case) override;
3115 #else
3116 void OnTestSuiteStart(const TestSuite& test_suite) override;
3117 #endif // OnTestCaseStart
3118
3119 void OnTestStart(const TestInfo& test_info) override;
3120
3121 void OnTestPartResult(const TestPartResult& result) override;
3122 void OnTestEnd(const TestInfo& test_info) override;
3123 #ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_
3124 void OnTestCaseEnd(const TestCase& test_case) override;
3125 #else
3126 void OnTestSuiteEnd(const TestSuite& test_suite) override;
3127 #endif // GTEST_REMOVE_LEGACY_TEST_CASEAPI_
3128
3129 void OnEnvironmentsTearDownStart(const UnitTest& unit_test) override;
3130 void OnEnvironmentsTearDownEnd(const UnitTest& /*unit_test*/) override {}
3131 void OnTestIterationEnd(const UnitTest& unit_test, int iteration) override;
3132 void OnTestProgramEnd(const UnitTest& /*unit_test*/) override {}
31183133
31193134 private:
31203135 static void PrintFailedTests(const UnitTest& unit_test);
3136 static void PrintSkippedTests(const UnitTest& unit_test);
31213137 };
31223138
31233139 // Fired before each iteration of tests starts.
31523168 ColoredPrintf(COLOR_GREEN, "[==========] ");
31533169 printf("Running %s from %s.\n",
31543170 FormatTestCount(unit_test.test_to_run_count()).c_str(),
3155 FormatTestCaseCount(unit_test.test_case_to_run_count()).c_str());
3171 FormatTestSuiteCount(unit_test.test_suite_to_run_count()).c_str());
31563172 fflush(stdout);
31573173 }
31583174
31633179 fflush(stdout);
31643180 }
31653181
3182 #ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_
31663183 void PrettyUnitTestResultPrinter::OnTestCaseStart(const TestCase& test_case) {
31673184 const std::string counts =
31683185 FormatCountableNoun(test_case.test_to_run_count(), "test", "tests");
31693186 ColoredPrintf(COLOR_GREEN, "[----------] ");
31703187 printf("%s from %s", counts.c_str(), test_case.name());
3171 if (test_case.type_param() == NULL) {
3188 if (test_case.type_param() == nullptr) {
31723189 printf("\n");
31733190 } else {
31743191 printf(", where %s = %s\n", kTypeParamLabel, test_case.type_param());
31753192 }
31763193 fflush(stdout);
31773194 }
3195 #else
3196 void PrettyUnitTestResultPrinter::OnTestSuiteStart(
3197 const TestSuite& test_suite) {
3198 const std::string counts =
3199 FormatCountableNoun(test_suite.test_to_run_count(), "test", "tests");
3200 ColoredPrintf(COLOR_GREEN, "[----------] ");
3201 printf("%s from %s", counts.c_str(), test_suite.name());
3202 if (test_suite.type_param() == nullptr) {
3203 printf("\n");
3204 } else {
3205 printf(", where %s = %s\n", kTypeParamLabel, test_suite.type_param());
3206 }
3207 fflush(stdout);
3208 }
3209 #endif // GTEST_REMOVE_LEGACY_TEST_CASEAPI_
31783210
31793211 void PrettyUnitTestResultPrinter::OnTestStart(const TestInfo& test_info) {
31803212 ColoredPrintf(COLOR_GREEN, "[ RUN ] ");
3181 PrintTestName(test_info.test_case_name(), test_info.name());
3213 PrintTestName(test_info.test_suite_name(), test_info.name());
31823214 printf("\n");
31833215 fflush(stdout);
31843216 }
31863218 // Called after an assertion failure.
31873219 void PrettyUnitTestResultPrinter::OnTestPartResult(
31883220 const TestPartResult& result) {
3189 // If the test part succeeded, we don't need to do anything.
3190 if (result.type() == TestPartResult::kSuccess)
3191 return;
3192
3193 // Print failure message from the assertion (e.g. expected this and got that).
3194 PrintTestPartResult(result);
3195 fflush(stdout);
3221 switch (result.type()) {
3222 // If the test part succeeded, or was skipped,
3223 // we don't need to do anything.
3224 case TestPartResult::kSkip:
3225 case TestPartResult::kSuccess:
3226 return;
3227 default:
3228 // Print failure message from the assertion
3229 // (e.g. expected this and got that).
3230 PrintTestPartResult(result);
3231 fflush(stdout);
3232 }
31963233 }
31973234
31983235 void PrettyUnitTestResultPrinter::OnTestEnd(const TestInfo& test_info) {
31993236 if (test_info.result()->Passed()) {
32003237 ColoredPrintf(COLOR_GREEN, "[ OK ] ");
3238 } else if (test_info.result()->Skipped()) {
3239 ColoredPrintf(COLOR_GREEN, "[ SKIPPED ] ");
32013240 } else {
32023241 ColoredPrintf(COLOR_RED, "[ FAILED ] ");
32033242 }
3204 PrintTestName(test_info.test_case_name(), test_info.name());
3243 PrintTestName(test_info.test_suite_name(), test_info.name());
32053244 if (test_info.result()->Failed())
32063245 PrintFullTestCommentIfPresent(test_info);
32073246
32143253 fflush(stdout);
32153254 }
32163255
3256 #ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_
32173257 void PrettyUnitTestResultPrinter::OnTestCaseEnd(const TestCase& test_case) {
32183258 if (!GTEST_FLAG(print_time)) return;
32193259
32203260 const std::string counts =
32213261 FormatCountableNoun(test_case.test_to_run_count(), "test", "tests");
32223262 ColoredPrintf(COLOR_GREEN, "[----------] ");
3223 printf("%s from %s (%s ms total)\n\n",
3224 counts.c_str(), test_case.name(),
3263 printf("%s from %s (%s ms total)\n\n", counts.c_str(), test_case.name(),
32253264 internal::StreamableToString(test_case.elapsed_time()).c_str());
32263265 fflush(stdout);
32273266 }
3267 #else
3268 void PrettyUnitTestResultPrinter::OnTestSuiteEnd(const TestSuite& test_suite) {
3269 if (!GTEST_FLAG(print_time)) return;
3270
3271 const std::string counts =
3272 FormatCountableNoun(test_suite.test_to_run_count(), "test", "tests");
3273 ColoredPrintf(COLOR_GREEN, "[----------] ");
3274 printf("%s from %s (%s ms total)\n\n", counts.c_str(), test_suite.name(),
3275 internal::StreamableToString(test_suite.elapsed_time()).c_str());
3276 fflush(stdout);
3277 }
3278 #endif // GTEST_REMOVE_LEGACY_TEST_CASEAPI_
32283279
32293280 void PrettyUnitTestResultPrinter::OnEnvironmentsTearDownStart(
32303281 const UnitTest& /*unit_test*/) {
32403291 return;
32413292 }
32423293
3243 for (int i = 0; i < unit_test.total_test_case_count(); ++i) {
3244 const TestCase& test_case = *unit_test.GetTestCase(i);
3245 if (!test_case.should_run() || (test_case.failed_test_count() == 0)) {
3294 for (int i = 0; i < unit_test.total_test_suite_count(); ++i) {
3295 const TestSuite& test_suite = *unit_test.GetTestSuite(i);
3296 if (!test_suite.should_run() || (test_suite.failed_test_count() == 0)) {
32463297 continue;
32473298 }
3248 for (int j = 0; j < test_case.total_test_count(); ++j) {
3249 const TestInfo& test_info = *test_case.GetTestInfo(j);
3250 if (!test_info.should_run() || test_info.result()->Passed()) {
3299 for (int j = 0; j < test_suite.total_test_count(); ++j) {
3300 const TestInfo& test_info = *test_suite.GetTestInfo(j);
3301 if (!test_info.should_run() || !test_info.result()->Failed()) {
32513302 continue;
32523303 }
32533304 ColoredPrintf(COLOR_RED, "[ FAILED ] ");
3254 printf("%s.%s", test_case.name(), test_info.name());
3305 printf("%s.%s", test_suite.name(), test_info.name());
32553306 PrintFullTestCommentIfPresent(test_info);
3307 printf("\n");
3308 }
3309 }
3310 }
3311
3312 // Internal helper for printing the list of skipped tests.
3313 void PrettyUnitTestResultPrinter::PrintSkippedTests(const UnitTest& unit_test) {
3314 const int skipped_test_count = unit_test.skipped_test_count();
3315 if (skipped_test_count == 0) {
3316 return;
3317 }
3318
3319 for (int i = 0; i < unit_test.total_test_suite_count(); ++i) {
3320 const TestSuite& test_suite = *unit_test.GetTestSuite(i);
3321 if (!test_suite.should_run() || (test_suite.skipped_test_count() == 0)) {
3322 continue;
3323 }
3324 for (int j = 0; j < test_suite.total_test_count(); ++j) {
3325 const TestInfo& test_info = *test_suite.GetTestInfo(j);
3326 if (!test_info.should_run() || !test_info.result()->Skipped()) {
3327 continue;
3328 }
3329 ColoredPrintf(COLOR_GREEN, "[ SKIPPED ] ");
3330 printf("%s.%s", test_suite.name(), test_info.name());
32563331 printf("\n");
32573332 }
32583333 }
32633338 ColoredPrintf(COLOR_GREEN, "[==========] ");
32643339 printf("%s from %s ran.",
32653340 FormatTestCount(unit_test.test_to_run_count()).c_str(),
3266 FormatTestCaseCount(unit_test.test_case_to_run_count()).c_str());
3341 FormatTestSuiteCount(unit_test.test_suite_to_run_count()).c_str());
32673342 if (GTEST_FLAG(print_time)) {
32683343 printf(" (%s ms total)",
32693344 internal::StreamableToString(unit_test.elapsed_time()).c_str());
32713346 printf("\n");
32723347 ColoredPrintf(COLOR_GREEN, "[ PASSED ] ");
32733348 printf("%s.\n", FormatTestCount(unit_test.successful_test_count()).c_str());
3349
3350 const int skipped_test_count = unit_test.skipped_test_count();
3351 if (skipped_test_count > 0) {
3352 ColoredPrintf(COLOR_GREEN, "[ SKIPPED ] ");
3353 printf("%s, listed below:\n", FormatTestCount(skipped_test_count).c_str());
3354 PrintSkippedTests(unit_test);
3355 }
32743356
32753357 int num_failures = unit_test.failed_test_count();
32763358 if (!unit_test.Passed()) {
33043386 class TestEventRepeater : public TestEventListener {
33053387 public:
33063388 TestEventRepeater() : forwarding_enabled_(true) {}
3307 virtual ~TestEventRepeater();
3389 ~TestEventRepeater() override;
33083390 void Append(TestEventListener *listener);
33093391 TestEventListener* Release(TestEventListener* listener);
33103392
33133395 bool forwarding_enabled() const { return forwarding_enabled_; }
33143396 void set_forwarding_enabled(bool enable) { forwarding_enabled_ = enable; }
33153397
3316 virtual void OnTestProgramStart(const UnitTest& unit_test);
3317 virtual void OnTestIterationStart(const UnitTest& unit_test, int iteration);
3318 virtual void OnEnvironmentsSetUpStart(const UnitTest& unit_test);
3319 virtual void OnEnvironmentsSetUpEnd(const UnitTest& unit_test);
3320 virtual void OnTestCaseStart(const TestCase& test_case);
3321 virtual void OnTestStart(const TestInfo& test_info);
3322 virtual void OnTestPartResult(const TestPartResult& result);
3323 virtual void OnTestEnd(const TestInfo& test_info);
3324 virtual void OnTestCaseEnd(const TestCase& test_case);
3325 virtual void OnEnvironmentsTearDownStart(const UnitTest& unit_test);
3326 virtual void OnEnvironmentsTearDownEnd(const UnitTest& unit_test);
3327 virtual void OnTestIterationEnd(const UnitTest& unit_test, int iteration);
3328 virtual void OnTestProgramEnd(const UnitTest& unit_test);
3398 void OnTestProgramStart(const UnitTest& unit_test) override;
3399 void OnTestIterationStart(const UnitTest& unit_test, int iteration) override;
3400 void OnEnvironmentsSetUpStart(const UnitTest& unit_test) override;
3401 void OnEnvironmentsSetUpEnd(const UnitTest& unit_test) override;
3402 // Legacy API is deprecated but still available
3403 #ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_
3404 void OnTestCaseStart(const TestSuite& parameter) override;
3405 #endif // GTEST_REMOVE_LEGACY_TEST_CASEAPI_
3406 void OnTestSuiteStart(const TestSuite& parameter) override;
3407 void OnTestStart(const TestInfo& test_info) override;
3408 void OnTestPartResult(const TestPartResult& result) override;
3409 void OnTestEnd(const TestInfo& test_info) override;
3410 // Legacy API is deprecated but still available
3411 #ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_
3412 void OnTestCaseEnd(const TestCase& parameter) override;
3413 #endif // GTEST_REMOVE_LEGACY_TEST_CASEAPI_
3414 void OnTestSuiteEnd(const TestSuite& parameter) override;
3415 void OnEnvironmentsTearDownStart(const UnitTest& unit_test) override;
3416 void OnEnvironmentsTearDownEnd(const UnitTest& unit_test) override;
3417 void OnTestIterationEnd(const UnitTest& unit_test, int iteration) override;
3418 void OnTestProgramEnd(const UnitTest& unit_test) override;
33293419
33303420 private:
33313421 // Controls whether events will be forwarded to listeners_. Set to false
33453435 listeners_.push_back(listener);
33463436 }
33473437
3348 // FIXME: Factor the search functionality into Vector::Find.
33493438 TestEventListener* TestEventRepeater::Release(TestEventListener *listener) {
33503439 for (size_t i = 0; i < listeners_.size(); ++i) {
33513440 if (listeners_[i] == listener) {
3352 listeners_.erase(listeners_.begin() + i);
3441 listeners_.erase(listeners_.begin() + static_cast<int>(i));
33533442 return listener;
33543443 }
33553444 }
33563445
3357 return NULL;
3446 return nullptr;
33583447 }
33593448
33603449 // Since most methods are very similar, use macros to reduce boilerplate.
33693458 }
33703459 // This defines a member that forwards the call to all listeners in reverse
33713460 // order.
3372 #define GTEST_REVERSE_REPEATER_METHOD_(Name, Type) \
3373 void TestEventRepeater::Name(const Type& parameter) { \
3374 if (forwarding_enabled_) { \
3375 for (int i = static_cast<int>(listeners_.size()) - 1; i >= 0; i--) { \
3376 listeners_[i]->Name(parameter); \
3377 } \
3378 } \
3379 }
3461 #define GTEST_REVERSE_REPEATER_METHOD_(Name, Type) \
3462 void TestEventRepeater::Name(const Type& parameter) { \
3463 if (forwarding_enabled_) { \
3464 for (size_t i = listeners_.size(); i != 0; i--) { \
3465 listeners_[i - 1]->Name(parameter); \
3466 } \
3467 } \
3468 }
33803469
33813470 GTEST_REPEATER_METHOD_(OnTestProgramStart, UnitTest)
33823471 GTEST_REPEATER_METHOD_(OnEnvironmentsSetUpStart, UnitTest)
3383 GTEST_REPEATER_METHOD_(OnTestCaseStart, TestCase)
3472 // Legacy API is deprecated but still available
3473 #ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_
3474 GTEST_REPEATER_METHOD_(OnTestCaseStart, TestSuite)
3475 #endif // GTEST_REMOVE_LEGACY_TEST_CASEAPI_
3476 GTEST_REPEATER_METHOD_(OnTestSuiteStart, TestSuite)
33843477 GTEST_REPEATER_METHOD_(OnTestStart, TestInfo)
33853478 GTEST_REPEATER_METHOD_(OnTestPartResult, TestPartResult)
33863479 GTEST_REPEATER_METHOD_(OnEnvironmentsTearDownStart, UnitTest)
33873480 GTEST_REVERSE_REPEATER_METHOD_(OnEnvironmentsSetUpEnd, UnitTest)
33883481 GTEST_REVERSE_REPEATER_METHOD_(OnEnvironmentsTearDownEnd, UnitTest)
33893482 GTEST_REVERSE_REPEATER_METHOD_(OnTestEnd, TestInfo)
3390 GTEST_REVERSE_REPEATER_METHOD_(OnTestCaseEnd, TestCase)
3483 // Legacy API is deprecated but still available
3484 #ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_
3485 GTEST_REVERSE_REPEATER_METHOD_(OnTestCaseEnd, TestSuite)
3486 #endif // GTEST_REMOVE_LEGACY_TEST_CASEAPI_
3487 GTEST_REVERSE_REPEATER_METHOD_(OnTestSuiteEnd, TestSuite)
33913488 GTEST_REVERSE_REPEATER_METHOD_(OnTestProgramEnd, UnitTest)
33923489
33933490 #undef GTEST_REPEATER_METHOD_
34053502 void TestEventRepeater::OnTestIterationEnd(const UnitTest& unit_test,
34063503 int iteration) {
34073504 if (forwarding_enabled_) {
3408 for (int i = static_cast<int>(listeners_.size()) - 1; i >= 0; i--) {
3409 listeners_[i]->OnTestIterationEnd(unit_test, iteration);
3505 for (size_t i = listeners_.size(); i > 0; i--) {
3506 listeners_[i - 1]->OnTestIterationEnd(unit_test, iteration);
34103507 }
34113508 }
34123509 }
34183515 public:
34193516 explicit XmlUnitTestResultPrinter(const char* output_file);
34203517
3421 virtual void OnTestIterationEnd(const UnitTest& unit_test, int iteration);
3422 void ListTestsMatchingFilter(const std::vector<TestCase*>& test_cases);
3518 void OnTestIterationEnd(const UnitTest& unit_test, int iteration) override;
3519 void ListTestsMatchingFilter(const std::vector<TestSuite*>& test_suites);
34233520
34243521 // Prints an XML summary of all unit tests.
34253522 static void PrintXmlTestsList(std::ostream* stream,
3426 const std::vector<TestCase*>& test_cases);
3523 const std::vector<TestSuite*>& test_suites);
34273524
34283525 private:
34293526 // Is c a whitespace character that is normalized to a space character
34683565
34693566 // Streams an XML representation of a TestInfo object.
34703567 static void OutputXmlTestInfo(::std::ostream* stream,
3471 const char* test_case_name,
3568 const char* test_suite_name,
34723569 const TestInfo& test_info);
34733570
3474 // Prints an XML representation of a TestCase object
3475 static void PrintXmlTestCase(::std::ostream* stream,
3476 const TestCase& test_case);
3571 // Prints an XML representation of a TestSuite object
3572 static void PrintXmlTestSuite(::std::ostream* stream,
3573 const TestSuite& test_suite);
34773574
34783575 // Prints an XML summary of unit_test to output stream out.
34793576 static void PrintXmlUnitTest(::std::ostream* stream,
35153612 }
35163613
35173614 void XmlUnitTestResultPrinter::ListTestsMatchingFilter(
3518 const std::vector<TestCase*>& test_cases) {
3615 const std::vector<TestSuite*>& test_suites) {
35193616 FILE* xmlout = OpenFileForWriting(output_file_);
35203617 std::stringstream stream;
3521 PrintXmlTestsList(&stream, test_cases);
3618 PrintXmlTestsList(&stream, test_suites);
35223619 fprintf(xmlout, "%s", StringStreamToString(&stream).c_str());
35233620 fclose(xmlout);
35243621 }
35333630 // module will consist of ordinary English text.
35343631 // If this module is ever modified to produce version 1.1 XML output,
35353632 // most invalid characters can be retained using character references.
3536 // FIXME: It might be nice to have a minimally invasive, human-readable
3537 // escaping scheme for invalid characters, rather than dropping them.
35383633 std::string XmlUnitTestResultPrinter::EscapeXml(
35393634 const std::string& str, bool is_attribute) {
35403635 Message m;
35993694 // This is how Google Test concepts map to the DTD:
36003695 //
36013696 // <testsuites name="AllTests"> <-- corresponds to a UnitTest object
3602 // <testsuite name="testcase-name"> <-- corresponds to a TestCase object
3697 // <testsuite name="testcase-name"> <-- corresponds to a TestSuite object
36033698 // <testcase name="test-name"> <-- corresponds to a TestInfo object
36043699 // <failure message="...">...</failure>
36053700 // <failure message="...">...</failure>
36233718 // MINGW <time.h> provides neither localtime_r nor localtime_s, but uses
36243719 // Windows' localtime(), which has a thread-local tm buffer.
36253720 struct tm* tm_ptr = localtime(&seconds); // NOLINT
3626 if (tm_ptr == NULL)
3627 return false;
3721 if (tm_ptr == nullptr) return false;
36283722 *out = *tm_ptr;
36293723 return true;
36303724 #else
3631 return localtime_r(&seconds, out) != NULL;
3725 return localtime_r(&seconds, out) != nullptr;
36323726 #endif
36333727 }
36343728
36543748 *stream << "<![CDATA[";
36553749 for (;;) {
36563750 const char* const next_segment = strstr(segment, "]]>");
3657 if (next_segment != NULL) {
3751 if (next_segment != nullptr) {
36583752 stream->write(
36593753 segment, static_cast<std::streamsize>(next_segment - segment));
36603754 *stream << "]]>]]&gt;<![CDATA[";
36733767 const std::string& name,
36743768 const std::string& value) {
36753769 const std::vector<std::string>& allowed_names =
3676 GetReservedAttributesForElement(element_name);
3770 GetReservedOutputAttributesForElement(element_name);
36773771
36783772 GTEST_CHECK_(std::find(allowed_names.begin(), allowed_names.end(), name) !=
36793773 allowed_names.end())
36843778 }
36853779
36863780 // Prints an XML representation of a TestInfo object.
3687 // FIXME: There is also value in printing properties with the plain printer.
36883781 void XmlUnitTestResultPrinter::OutputXmlTestInfo(::std::ostream* stream,
3689 const char* test_case_name,
3782 const char* test_suite_name,
36903783 const TestInfo& test_info) {
36913784 const TestResult& result = *test_info.result();
3692 const std::string kTestcase = "testcase";
3785 const std::string kTestsuite = "testcase";
36933786
36943787 if (test_info.is_in_another_shard()) {
36953788 return;
36963789 }
36973790
36983791 *stream << " <testcase";
3699 OutputXmlAttribute(stream, kTestcase, "name", test_info.name());
3700
3701 if (test_info.value_param() != NULL) {
3702 OutputXmlAttribute(stream, kTestcase, "value_param",
3792 OutputXmlAttribute(stream, kTestsuite, "name", test_info.name());
3793
3794 if (test_info.value_param() != nullptr) {
3795 OutputXmlAttribute(stream, kTestsuite, "value_param",
37033796 test_info.value_param());
37043797 }
3705 if (test_info.type_param() != NULL) {
3706 OutputXmlAttribute(stream, kTestcase, "type_param", test_info.type_param());
3798 if (test_info.type_param() != nullptr) {
3799 OutputXmlAttribute(stream, kTestsuite, "type_param",
3800 test_info.type_param());
37073801 }
37083802 if (GTEST_FLAG(list_tests)) {
3709 OutputXmlAttribute(stream, kTestcase, "file", test_info.file());
3710 OutputXmlAttribute(stream, kTestcase, "line",
3803 OutputXmlAttribute(stream, kTestsuite, "file", test_info.file());
3804 OutputXmlAttribute(stream, kTestsuite, "line",
37113805 StreamableToString(test_info.line()));
37123806 *stream << " />\n";
37133807 return;
37143808 }
37153809
3716 OutputXmlAttribute(stream, kTestcase, "status",
3810 OutputXmlAttribute(stream, kTestsuite, "status",
37173811 test_info.should_run() ? "run" : "notrun");
3718 OutputXmlAttribute(stream, kTestcase, "time",
3812 OutputXmlAttribute(stream, kTestsuite, "result",
3813 test_info.should_run()
3814 ? (result.Skipped() ? "skipped" : "completed")
3815 : "suppressed");
3816 OutputXmlAttribute(stream, kTestsuite, "time",
37193817 FormatTimeInMillisAsSeconds(result.elapsed_time()));
3720 OutputXmlAttribute(stream, kTestcase, "classname", test_case_name);
3818 OutputXmlAttribute(
3819 stream, kTestsuite, "timestamp",
3820 FormatEpochTimeInMillisAsIso8601(result.start_timestamp()));
3821 OutputXmlAttribute(stream, kTestsuite, "classname", test_suite_name);
37213822
37223823 int failures = 0;
37233824 for (int i = 0; i < result.total_part_count(); ++i) {
37503851 }
37513852 }
37523853
3753 // Prints an XML representation of a TestCase object
3754 void XmlUnitTestResultPrinter::PrintXmlTestCase(std::ostream* stream,
3755 const TestCase& test_case) {
3854 // Prints an XML representation of a TestSuite object
3855 void XmlUnitTestResultPrinter::PrintXmlTestSuite(std::ostream* stream,
3856 const TestSuite& test_suite) {
37563857 const std::string kTestsuite = "testsuite";
37573858 *stream << " <" << kTestsuite;
3758 OutputXmlAttribute(stream, kTestsuite, "name", test_case.name());
3859 OutputXmlAttribute(stream, kTestsuite, "name", test_suite.name());
37593860 OutputXmlAttribute(stream, kTestsuite, "tests",
3760 StreamableToString(test_case.reportable_test_count()));
3861 StreamableToString(test_suite.reportable_test_count()));
37613862 if (!GTEST_FLAG(list_tests)) {
37623863 OutputXmlAttribute(stream, kTestsuite, "failures",
3763 StreamableToString(test_case.failed_test_count()));
3864 StreamableToString(test_suite.failed_test_count()));
37643865 OutputXmlAttribute(
37653866 stream, kTestsuite, "disabled",
3766 StreamableToString(test_case.reportable_disabled_test_count()));
3867 StreamableToString(test_suite.reportable_disabled_test_count()));
37673868 OutputXmlAttribute(stream, kTestsuite, "errors", "0");
37683869 OutputXmlAttribute(stream, kTestsuite, "time",
3769 FormatTimeInMillisAsSeconds(test_case.elapsed_time()));
3770 *stream << TestPropertiesAsXmlAttributes(test_case.ad_hoc_test_result());
3870 FormatTimeInMillisAsSeconds(test_suite.elapsed_time()));
3871 OutputXmlAttribute(
3872 stream, kTestsuite, "timestamp",
3873 FormatEpochTimeInMillisAsIso8601(test_suite.start_timestamp()));
3874 *stream << TestPropertiesAsXmlAttributes(test_suite.ad_hoc_test_result());
37713875 }
37723876 *stream << ">\n";
3773 for (int i = 0; i < test_case.total_test_count(); ++i) {
3774 if (test_case.GetTestInfo(i)->is_reportable())
3775 OutputXmlTestInfo(stream, test_case.name(), *test_case.GetTestInfo(i));
3877 for (int i = 0; i < test_suite.total_test_count(); ++i) {
3878 if (test_suite.GetTestInfo(i)->is_reportable())
3879 OutputXmlTestInfo(stream, test_suite.name(), *test_suite.GetTestInfo(i));
37763880 }
37773881 *stream << " </" << kTestsuite << ">\n";
37783882 }
37933897 stream, kTestsuites, "disabled",
37943898 StreamableToString(unit_test.reportable_disabled_test_count()));
37953899 OutputXmlAttribute(stream, kTestsuites, "errors", "0");
3900 OutputXmlAttribute(stream, kTestsuites, "time",
3901 FormatTimeInMillisAsSeconds(unit_test.elapsed_time()));
37963902 OutputXmlAttribute(
37973903 stream, kTestsuites, "timestamp",
37983904 FormatEpochTimeInMillisAsIso8601(unit_test.start_timestamp()));
3799 OutputXmlAttribute(stream, kTestsuites, "time",
3800 FormatTimeInMillisAsSeconds(unit_test.elapsed_time()));
38013905
38023906 if (GTEST_FLAG(shuffle)) {
38033907 OutputXmlAttribute(stream, kTestsuites, "random_seed",
38083912 OutputXmlAttribute(stream, kTestsuites, "name", "AllTests");
38093913 *stream << ">\n";
38103914
3811 for (int i = 0; i < unit_test.total_test_case_count(); ++i) {
3812 if (unit_test.GetTestCase(i)->reportable_test_count() > 0)
3813 PrintXmlTestCase(stream, *unit_test.GetTestCase(i));
3915 for (int i = 0; i < unit_test.total_test_suite_count(); ++i) {
3916 if (unit_test.GetTestSuite(i)->reportable_test_count() > 0)
3917 PrintXmlTestSuite(stream, *unit_test.GetTestSuite(i));
38143918 }
38153919 *stream << "</" << kTestsuites << ">\n";
38163920 }
38173921
38183922 void XmlUnitTestResultPrinter::PrintXmlTestsList(
3819 std::ostream* stream, const std::vector<TestCase*>& test_cases) {
3923 std::ostream* stream, const std::vector<TestSuite*>& test_suites) {
38203924 const std::string kTestsuites = "testsuites";
38213925
38223926 *stream << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
38233927 *stream << "<" << kTestsuites;
38243928
38253929 int total_tests = 0;
3826 for (size_t i = 0; i < test_cases.size(); ++i) {
3827 total_tests += test_cases[i]->total_test_count();
3930 for (auto test_suite : test_suites) {
3931 total_tests += test_suite->total_test_count();
38283932 }
38293933 OutputXmlAttribute(stream, kTestsuites, "tests",
38303934 StreamableToString(total_tests));
38313935 OutputXmlAttribute(stream, kTestsuites, "name", "AllTests");
38323936 *stream << ">\n";
38333937
3834 for (size_t i = 0; i < test_cases.size(); ++i) {
3835 PrintXmlTestCase(stream, *test_cases[i]);
3938 for (auto test_suite : test_suites) {
3939 PrintXmlTestSuite(stream, *test_suite);
38363940 }
38373941 *stream << "</" << kTestsuites << ">\n";
38383942 }
38773981 public:
38783982 explicit JsonUnitTestResultPrinter(const char* output_file);
38793983
3880 virtual void OnTestIterationEnd(const UnitTest& unit_test, int iteration);
3984 void OnTestIterationEnd(const UnitTest& unit_test, int iteration) override;
38813985
38823986 // Prints an JSON summary of all unit tests.
38833987 static void PrintJsonTestList(::std::ostream* stream,
3884 const std::vector<TestCase*>& test_cases);
3988 const std::vector<TestSuite*>& test_suites);
38853989
38863990 private:
38873991 // Returns an JSON-escaped copy of the input string str.
39044008
39054009 // Streams a JSON representation of a TestInfo object.
39064010 static void OutputJsonTestInfo(::std::ostream* stream,
3907 const char* test_case_name,
4011 const char* test_suite_name,
39084012 const TestInfo& test_info);
39094013
3910 // Prints a JSON representation of a TestCase object
3911 static void PrintJsonTestCase(::std::ostream* stream,
3912 const TestCase& test_case);
4014 // Prints a JSON representation of a TestSuite object
4015 static void PrintJsonTestSuite(::std::ostream* stream,
4016 const TestSuite& test_suite);
39134017
39144018 // Prints a JSON summary of unit_test to output stream out.
39154019 static void PrintJsonUnitTest(::std::ostream* stream,
40084112 String::FormatIntWidth2(time_struct.tm_sec) + "Z";
40094113 }
40104114
4011 static inline std::string Indent(int width) {
4115 static inline std::string Indent(size_t width) {
40124116 return std::string(width, ' ');
40134117 }
40144118
40204124 const std::string& indent,
40214125 bool comma) {
40224126 const std::vector<std::string>& allowed_names =
4023 GetReservedAttributesForElement(element_name);
4127 GetReservedOutputAttributesForElement(element_name);
40244128
40254129 GTEST_CHECK_(std::find(allowed_names.begin(), allowed_names.end(), name) !=
40264130 allowed_names.end())
40404144 const std::string& indent,
40414145 bool comma) {
40424146 const std::vector<std::string>& allowed_names =
4043 GetReservedAttributesForElement(element_name);
4147 GetReservedOutputAttributesForElement(element_name);
40444148
40454149 GTEST_CHECK_(std::find(allowed_names.begin(), allowed_names.end(), name) !=
40464150 allowed_names.end())
40544158
40554159 // Prints a JSON representation of a TestInfo object.
40564160 void JsonUnitTestResultPrinter::OutputJsonTestInfo(::std::ostream* stream,
4057 const char* test_case_name,
4161 const char* test_suite_name,
40584162 const TestInfo& test_info) {
40594163 const TestResult& result = *test_info.result();
4060 const std::string kTestcase = "testcase";
4164 const std::string kTestsuite = "testcase";
40614165 const std::string kIndent = Indent(10);
40624166
40634167 *stream << Indent(8) << "{\n";
4064 OutputJsonKey(stream, kTestcase, "name", test_info.name(), kIndent);
4065
4066 if (test_info.value_param() != NULL) {
4067 OutputJsonKey(stream, kTestcase, "value_param",
4068 test_info.value_param(), kIndent);
4069 }
4070 if (test_info.type_param() != NULL) {
4071 OutputJsonKey(stream, kTestcase, "type_param", test_info.type_param(),
4168 OutputJsonKey(stream, kTestsuite, "name", test_info.name(), kIndent);
4169
4170 if (test_info.value_param() != nullptr) {
4171 OutputJsonKey(stream, kTestsuite, "value_param", test_info.value_param(),
40724172 kIndent);
40734173 }
4174 if (test_info.type_param() != nullptr) {
4175 OutputJsonKey(stream, kTestsuite, "type_param", test_info.type_param(),
4176 kIndent);
4177 }
40744178 if (GTEST_FLAG(list_tests)) {
4075 OutputJsonKey(stream, kTestcase, "file", test_info.file(), kIndent);
4076 OutputJsonKey(stream, kTestcase, "line", test_info.line(), kIndent, false);
4179 OutputJsonKey(stream, kTestsuite, "file", test_info.file(), kIndent);
4180 OutputJsonKey(stream, kTestsuite, "line", test_info.line(), kIndent, false);
40774181 *stream << "\n" << Indent(8) << "}";
40784182 return;
40794183 }
40804184
4081 OutputJsonKey(stream, kTestcase, "status",
4185 OutputJsonKey(stream, kTestsuite, "status",
40824186 test_info.should_run() ? "RUN" : "NOTRUN", kIndent);
4083 OutputJsonKey(stream, kTestcase, "time",
4187 OutputJsonKey(stream, kTestsuite, "result",
4188 test_info.should_run()
4189 ? (result.Skipped() ? "SKIPPED" : "COMPLETED")
4190 : "SUPPRESSED",
4191 kIndent);
4192 OutputJsonKey(stream, kTestsuite, "timestamp",
4193 FormatEpochTimeInMillisAsRFC3339(result.start_timestamp()),
4194 kIndent);
4195 OutputJsonKey(stream, kTestsuite, "time",
40844196 FormatTimeInMillisAsDuration(result.elapsed_time()), kIndent);
4085 OutputJsonKey(stream, kTestcase, "classname", test_case_name, kIndent, false);
4197 OutputJsonKey(stream, kTestsuite, "classname", test_suite_name, kIndent,
4198 false);
40864199 *stream << TestPropertiesAsJson(result, kIndent);
40874200
40884201 int failures = 0;
41094222 *stream << "\n" << Indent(8) << "}";
41104223 }
41114224
4112 // Prints an JSON representation of a TestCase object
4113 void JsonUnitTestResultPrinter::PrintJsonTestCase(std::ostream* stream,
4114 const TestCase& test_case) {
4225 // Prints an JSON representation of a TestSuite object
4226 void JsonUnitTestResultPrinter::PrintJsonTestSuite(
4227 std::ostream* stream, const TestSuite& test_suite) {
41154228 const std::string kTestsuite = "testsuite";
41164229 const std::string kIndent = Indent(6);
41174230
41184231 *stream << Indent(4) << "{\n";
4119 OutputJsonKey(stream, kTestsuite, "name", test_case.name(), kIndent);
4120 OutputJsonKey(stream, kTestsuite, "tests", test_case.reportable_test_count(),
4232 OutputJsonKey(stream, kTestsuite, "name", test_suite.name(), kIndent);
4233 OutputJsonKey(stream, kTestsuite, "tests", test_suite.reportable_test_count(),
41214234 kIndent);
41224235 if (!GTEST_FLAG(list_tests)) {
4123 OutputJsonKey(stream, kTestsuite, "failures", test_case.failed_test_count(),
4124 kIndent);
4236 OutputJsonKey(stream, kTestsuite, "failures",
4237 test_suite.failed_test_count(), kIndent);
41254238 OutputJsonKey(stream, kTestsuite, "disabled",
4126 test_case.reportable_disabled_test_count(), kIndent);
4239 test_suite.reportable_disabled_test_count(), kIndent);
41274240 OutputJsonKey(stream, kTestsuite, "errors", 0, kIndent);
4241 OutputJsonKey(
4242 stream, kTestsuite, "timestamp",
4243 FormatEpochTimeInMillisAsRFC3339(test_suite.start_timestamp()),
4244 kIndent);
41284245 OutputJsonKey(stream, kTestsuite, "time",
4129 FormatTimeInMillisAsDuration(test_case.elapsed_time()),
4246 FormatTimeInMillisAsDuration(test_suite.elapsed_time()),
41304247 kIndent, false);
4131 *stream << TestPropertiesAsJson(test_case.ad_hoc_test_result(), kIndent)
4248 *stream << TestPropertiesAsJson(test_suite.ad_hoc_test_result(), kIndent)
41324249 << ",\n";
41334250 }
41344251
41354252 *stream << kIndent << "\"" << kTestsuite << "\": [\n";
41364253
41374254 bool comma = false;
4138 for (int i = 0; i < test_case.total_test_count(); ++i) {
4139 if (test_case.GetTestInfo(i)->is_reportable()) {
4255 for (int i = 0; i < test_suite.total_test_count(); ++i) {
4256 if (test_suite.GetTestInfo(i)->is_reportable()) {
41404257 if (comma) {
41414258 *stream << ",\n";
41424259 } else {
41434260 comma = true;
41444261 }
4145 OutputJsonTestInfo(stream, test_case.name(), *test_case.GetTestInfo(i));
4262 OutputJsonTestInfo(stream, test_suite.name(), *test_suite.GetTestInfo(i));
41464263 }
41474264 }
41484265 *stream << "\n" << kIndent << "]\n" << Indent(4) << "}";
41804297 *stream << kIndent << "\"" << kTestsuites << "\": [\n";
41814298
41824299 bool comma = false;
4183 for (int i = 0; i < unit_test.total_test_case_count(); ++i) {
4184 if (unit_test.GetTestCase(i)->reportable_test_count() > 0) {
4300 for (int i = 0; i < unit_test.total_test_suite_count(); ++i) {
4301 if (unit_test.GetTestSuite(i)->reportable_test_count() > 0) {
41854302 if (comma) {
41864303 *stream << ",\n";
41874304 } else {
41884305 comma = true;
41894306 }
4190 PrintJsonTestCase(stream, *unit_test.GetTestCase(i));
4307 PrintJsonTestSuite(stream, *unit_test.GetTestSuite(i));
41914308 }
41924309 }
41934310
41954312 }
41964313
41974314 void JsonUnitTestResultPrinter::PrintJsonTestList(
4198 std::ostream* stream, const std::vector<TestCase*>& test_cases) {
4315 std::ostream* stream, const std::vector<TestSuite*>& test_suites) {
41994316 const std::string kTestsuites = "testsuites";
42004317 const std::string kIndent = Indent(2);
42014318 *stream << "{\n";
42024319 int total_tests = 0;
4203 for (size_t i = 0; i < test_cases.size(); ++i) {
4204 total_tests += test_cases[i]->total_test_count();
4320 for (auto test_suite : test_suites) {
4321 total_tests += test_suite->total_test_count();
42054322 }
42064323 OutputJsonKey(stream, kTestsuites, "tests", total_tests, kIndent);
42074324
42084325 OutputJsonKey(stream, kTestsuites, "name", "AllTests", kIndent);
42094326 *stream << kIndent << "\"" << kTestsuites << "\": [\n";
42104327
4211 for (size_t i = 0; i < test_cases.size(); ++i) {
4328 for (size_t i = 0; i < test_suites.size(); ++i) {
42124329 if (i != 0) {
42134330 *stream << ",\n";
42144331 }
4215 PrintJsonTestCase(stream, *test_cases[i]);
4332 PrintJsonTestSuite(stream, *test_suites[i]);
42164333 }
42174334
42184335 *stream << "\n"
42684385 memset(&hints, 0, sizeof(hints));
42694386 hints.ai_family = AF_UNSPEC; // To allow both IPv4 and IPv6 addresses.
42704387 hints.ai_socktype = SOCK_STREAM;
4271 addrinfo* servinfo = NULL;
4388 addrinfo* servinfo = nullptr;
42724389
42734390 // Use the getaddrinfo() to get a linked list of IP addresses for
42744391 // the given host name.
42804397 }
42814398
42824399 // Loop through all the results and connect to the first we can.
4283 for (addrinfo* cur_addr = servinfo; sockfd_ == -1 && cur_addr != NULL;
4400 for (addrinfo* cur_addr = servinfo; sockfd_ == -1 && cur_addr != nullptr;
42844401 cur_addr = cur_addr->ai_next) {
42854402 sockfd_ = socket(
42864403 cur_addr->ai_family, cur_addr->ai_socktype, cur_addr->ai_protocol);
44124529
44134530 TestEventListeners::TestEventListeners()
44144531 : repeater_(new internal::TestEventRepeater()),
4415 default_result_printer_(NULL),
4416 default_xml_generator_(NULL) {
4417 }
4532 default_result_printer_(nullptr),
4533 default_xml_generator_(nullptr) {}
44184534
44194535 TestEventListeners::~TestEventListeners() { delete repeater_; }
44204536
44314547 // NULL if the listener is not found in the list.
44324548 TestEventListener* TestEventListeners::Release(TestEventListener* listener) {
44334549 if (listener == default_result_printer_)
4434 default_result_printer_ = NULL;
4550 default_result_printer_ = nullptr;
44354551 else if (listener == default_xml_generator_)
4436 default_xml_generator_ = NULL;
4552 default_xml_generator_ = nullptr;
44374553 return repeater_->Release(listener);
44384554 }
44394555
44524568 // list.
44534569 delete Release(default_result_printer_);
44544570 default_result_printer_ = listener;
4455 if (listener != NULL)
4456 Append(listener);
4571 if (listener != nullptr) Append(listener);
44574572 }
44584573 }
44594574
44684583 // list.
44694584 delete Release(default_xml_generator_);
44704585 default_xml_generator_ = listener;
4471 if (listener != NULL)
4472 Append(listener);
4586 if (listener != nullptr) Append(listener);
44734587 }
44744588 }
44754589
44934607 // call this before main() starts, from which point on the return
44944608 // value will never change.
44954609 UnitTest* UnitTest::GetInstance() {
4496 // When compiled with MSVC 7.1 in optimized mode, destroying the
4497 // UnitTest object upon exiting the program messes up the exit code,
4498 // causing successful tests to appear failed. We have to use a
4499 // different implementation in this case to bypass the compiler bug.
4500 // This implementation makes the compiler happy, at the cost of
4501 // leaking the UnitTest object.
4502
45034610 // CodeGear C++Builder insists on a public destructor for the
45044611 // default implementation. Use this implementation to keep good OO
45054612 // design with private destructor.
45064613
4507 #if (_MSC_VER == 1310 && !defined(_DEBUG)) || defined(__BORLANDC__)
4614 #if defined(__BORLANDC__)
45084615 static UnitTest* const instance = new UnitTest;
45094616 return instance;
45104617 #else
45114618 static UnitTest instance;
45124619 return &instance;
4513 #endif // (_MSC_VER == 1310 && !defined(_DEBUG)) || defined(__BORLANDC__)
4514 }
4515
4516 // Gets the number of successful test cases.
4620 #endif // defined(__BORLANDC__)
4621 }
4622
4623 // Gets the number of successful test suites.
4624 int UnitTest::successful_test_suite_count() const {
4625 return impl()->successful_test_suite_count();
4626 }
4627
4628 // Gets the number of failed test suites.
4629 int UnitTest::failed_test_suite_count() const {
4630 return impl()->failed_test_suite_count();
4631 }
4632
4633 // Gets the number of all test suites.
4634 int UnitTest::total_test_suite_count() const {
4635 return impl()->total_test_suite_count();
4636 }
4637
4638 // Gets the number of all test suites that contain at least one test
4639 // that should run.
4640 int UnitTest::test_suite_to_run_count() const {
4641 return impl()->test_suite_to_run_count();
4642 }
4643
4644 // Legacy API is deprecated but still available
4645 #ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_
45174646 int UnitTest::successful_test_case_count() const {
4518 return impl()->successful_test_case_count();
4519 }
4520
4521 // Gets the number of failed test cases.
4647 return impl()->successful_test_suite_count();
4648 }
45224649 int UnitTest::failed_test_case_count() const {
4523 return impl()->failed_test_case_count();
4524 }
4525
4526 // Gets the number of all test cases.
4650 return impl()->failed_test_suite_count();
4651 }
45274652 int UnitTest::total_test_case_count() const {
4528 return impl()->total_test_case_count();
4529 }
4530
4531 // Gets the number of all test cases that contain at least one test
4532 // that should run.
4653 return impl()->total_test_suite_count();
4654 }
45334655 int UnitTest::test_case_to_run_count() const {
4534 return impl()->test_case_to_run_count();
4535 }
4656 return impl()->test_suite_to_run_count();
4657 }
4658 #endif // GTEST_REMOVE_LEGACY_TEST_CASEAPI_
45364659
45374660 // Gets the number of successful tests.
45384661 int UnitTest::successful_test_count() const {
45394662 return impl()->successful_test_count();
4663 }
4664
4665 // Gets the number of skipped tests.
4666 int UnitTest::skipped_test_count() const {
4667 return impl()->skipped_test_count();
45404668 }
45414669
45424670 // Gets the number of failed tests.
45744702 return impl()->elapsed_time();
45754703 }
45764704
4577 // Returns true iff the unit test passed (i.e. all test cases passed).
4705 // Returns true if and only if the unit test passed (i.e. all test suites
4706 // passed).
45784707 bool UnitTest::Passed() const { return impl()->Passed(); }
45794708
4580 // Returns true iff the unit test failed (i.e. some test case failed
4581 // or something outside of all tests failed).
4709 // Returns true if and only if the unit test failed (i.e. some test suite
4710 // failed or something outside of all tests failed).
45824711 bool UnitTest::Failed() const { return impl()->Failed(); }
45834712
4584 // Gets the i-th test case among all the test cases. i can range from 0 to
4585 // total_test_case_count() - 1. If i is not in that range, returns NULL.
4713 // Gets the i-th test suite among all the test suites. i can range from 0 to
4714 // total_test_suite_count() - 1. If i is not in that range, returns NULL.
4715 const TestSuite* UnitTest::GetTestSuite(int i) const {
4716 return impl()->GetTestSuite(i);
4717 }
4718
4719 // Legacy API is deprecated but still available
4720 #ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_
45864721 const TestCase* UnitTest::GetTestCase(int i) const {
45874722 return impl()->GetTestCase(i);
45884723 }
4724 #endif // GTEST_REMOVE_LEGACY_TEST_CASEAPI_
45894725
45904726 // Returns the TestResult containing information on test failures and
4591 // properties logged outside of individual test cases.
4727 // properties logged outside of individual test suites.
45924728 const TestResult& UnitTest::ad_hoc_test_result() const {
45934729 return *impl()->ad_hoc_test_result();
45944730 }
45954731
4596 // Gets the i-th test case among all the test cases. i can range from 0 to
4597 // total_test_case_count() - 1. If i is not in that range, returns NULL.
4598 TestCase* UnitTest::GetMutableTestCase(int i) {
4599 return impl()->GetMutableTestCase(i);
4732 // Gets the i-th test suite among all the test suites. i can range from 0 to
4733 // total_test_suite_count() - 1. If i is not in that range, returns NULL.
4734 TestSuite* UnitTest::GetMutableTestSuite(int i) {
4735 return impl()->GetMutableSuiteCase(i);
46004736 }
46014737
46024738 // Returns the list of event listeners that can be used to track events
46164752 // We don't protect this under mutex_, as we only support calling it
46174753 // from the main thread.
46184754 Environment* UnitTest::AddEnvironment(Environment* env) {
4619 if (env == NULL) {
4620 return NULL;
4755 if (env == nullptr) {
4756 return nullptr;
46214757 }
46224758
46234759 impl_->environments().push_back(env);
46414777 if (impl_->gtest_trace_stack().size() > 0) {
46424778 msg << "\n" << GTEST_NAME_ << " trace:";
46434779
4644 for (int i = static_cast<int>(impl_->gtest_trace_stack().size());
4645 i > 0; --i) {
4780 for (size_t i = impl_->gtest_trace_stack().size(); i > 0; --i) {
46464781 const internal::TraceInfo& trace = impl_->gtest_trace_stack()[i - 1];
46474782 msg << "\n" << internal::FormatFileLocation(trace.file, trace.line)
46484783 << " " << trace.message;
46494784 }
46504785 }
46514786
4652 if (os_stack_trace.c_str() != NULL && !os_stack_trace.empty()) {
4787 if (os_stack_trace.c_str() != nullptr && !os_stack_trace.empty()) {
46534788 msg << internal::kStackTraceMarker << os_stack_trace;
46544789 }
46554790
4656 const TestPartResult result =
4657 TestPartResult(result_type, file_name, line_number,
4658 msg.GetString().c_str());
4791 const TestPartResult result = TestPartResult(
4792 result_type, file_name, line_number, msg.GetString().c_str());
46594793 impl_->GetTestPartResultReporterForCurrentThread()->
46604794 ReportTestPartResult(result);
46614795
4662 if (result_type != TestPartResult::kSuccess) {
4796 if (result_type != TestPartResult::kSuccess &&
4797 result_type != TestPartResult::kSkip) {
46634798 // gtest_break_on_failure takes precedence over
46644799 // gtest_throw_on_failure. This allows a user to set the latter
46654800 // in the code (perhaps in order to use Google Test assertions
46774812 // with clang/gcc we can achieve the same effect on x86 by invoking int3
46784813 asm("int3");
46794814 #else
4680 // Dereference NULL through a volatile pointer to prevent the compiler
4815 // Dereference nullptr through a volatile pointer to prevent the compiler
46814816 // from removing. We use this rather than abort() or __builtin_trap() for
4682 // portability: Symbian doesn't implement abort() well, and some debuggers
4683 // don't correctly trap abort().
4684 *static_cast<volatile int*>(NULL) = 1;
4817 // portability: some debuggers don't correctly trap abort().
4818 *static_cast<volatile int*>(nullptr) = 1;
46854819 #endif // GTEST_OS_WINDOWS
46864820 } else if (GTEST_FLAG(throw_on_failure)) {
46874821 #if GTEST_HAS_EXCEPTIONS
46964830 }
46974831
46984832 // Adds a TestProperty to the current TestResult object when invoked from
4699 // inside a test, to current TestCase's ad_hoc_test_result_ when invoked
4700 // from SetUpTestCase or TearDownTestCase, or to the global property set
4833 // inside a test, to current TestSuite's ad_hoc_test_result_ when invoked
4834 // from SetUpTestSuite or TearDownTestSuite, or to the global property set
47014835 // when invoked elsewhere. If the result already contains a property with
47024836 // the same key, the value will be updated.
47034837 void UnitTest::RecordProperty(const std::string& key,
47364870 // that understands the premature-exit-file protocol to report the
47374871 // test as having failed.
47384872 const internal::ScopedPrematureExitFile premature_exit_file(
4739 in_death_test_child_process ?
4740 NULL : internal::posix::GetEnv("TEST_PREMATURE_EXIT_FILE"));
4873 in_death_test_child_process
4874 ? nullptr
4875 : internal::posix::GetEnv("TEST_PREMATURE_EXIT_FILE"));
47414876
47424877 // Captures the value of GTEST_FLAG(catch_exceptions). This value will be
47434878 // used for the duration of the program.
47624897 _set_error_mode(_OUT_TO_STDERR);
47634898 # endif
47644899
4765 # if _MSC_VER >= 1400 && !GTEST_OS_WINDOWS_MOBILE
4900 # if defined(_MSC_VER) && !GTEST_OS_WINDOWS_MOBILE
47664901 // In the debug version, Visual Studio pops up a separate dialog
47674902 // offering a choice to debug the aborted program. We need to suppress
47684903 // this dialog or it will pop up for every EXPECT/ASSERT_DEATH statement
47694904 // executed. Google Test will notify the user of any unexpected
47704905 // failure via stderr.
4771 //
4772 // VC++ doesn't define _set_abort_behavior() prior to the version 8.0.
4773 // Users of prior VC versions shall suffer the agony and pain of
4774 // clicking through the countless debug dialogs.
4775 // FIXME: find a way to suppress the abort dialog() in the
4776 // debug mode when compiled with VC 7.1 or lower.
47774906 if (!GTEST_FLAG(break_on_failure))
47784907 _set_abort_behavior(
47794908 0x0, // Clear the following flags:
47804909 _WRITE_ABORT_MSG | _CALL_REPORTFAULT); // pop-up window, core dump.
47814910 # endif
4911
4912 // In debug mode, the Windows CRT can crash with an assertion over invalid
4913 // input (e.g. passing an invalid file descriptor). The default handling
4914 // for these assertions is to pop up a dialog and wait for user input.
4915 // Instead ask the CRT to dump such assertions to stderr non-interactively.
4916 if (!IsDebuggerPresent()) {
4917 (void)_CrtSetReportMode(_CRT_ASSERT,
4918 _CRTDBG_MODE_FILE | _CRTDBG_MODE_DEBUG);
4919 (void)_CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDERR);
4920 }
47824921 }
47834922 #endif // GTEST_OS_WINDOWS
47844923
47944933 return impl_->original_working_dir_.c_str();
47954934 }
47964935
4797 // Returns the TestCase object for the test that's currently running,
4936 // Returns the TestSuite object for the test that's currently running,
47984937 // or NULL if no test is running.
4938 const TestSuite* UnitTest::current_test_suite() const
4939 GTEST_LOCK_EXCLUDED_(mutex_) {
4940 internal::MutexLock lock(&mutex_);
4941 return impl_->current_test_suite();
4942 }
4943
4944 // Legacy API is still available but deprecated
4945 #ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_
47994946 const TestCase* UnitTest::current_test_case() const
48004947 GTEST_LOCK_EXCLUDED_(mutex_) {
48014948 internal::MutexLock lock(&mutex_);
4802 return impl_->current_test_case();
4803 }
4949 return impl_->current_test_suite();
4950 }
4951 #endif
48044952
48054953 // Returns the TestInfo object for the test that's currently running,
48064954 // or NULL if no test is running.
48134961 // Returns the random seed used at the start of the current test run.
48144962 int UnitTest::random_seed() const { return impl_->random_seed(); }
48154963
4816 // Returns ParameterizedTestCaseRegistry object used to keep track of
4964 // Returns ParameterizedTestSuiteRegistry object used to keep track of
48174965 // value-parameterized tests and instantiate and register them.
4818 internal::ParameterizedTestCaseRegistry&
4819 UnitTest::parameterized_test_registry()
4820 GTEST_LOCK_EXCLUDED_(mutex_) {
4966 internal::ParameterizedTestSuiteRegistry&
4967 UnitTest::parameterized_test_registry() GTEST_LOCK_EXCLUDED_(mutex_) {
48214968 return impl_->parameterized_test_registry();
48224969 }
48234970
48514998 UnitTestImpl::UnitTestImpl(UnitTest* parent)
48524999 : parent_(parent),
48535000 GTEST_DISABLE_MSC_WARNINGS_PUSH_(4355 /* using this in initializer */)
4854 default_global_test_part_result_reporter_(this),
5001 default_global_test_part_result_reporter_(this),
48555002 default_per_thread_test_part_result_reporter_(this),
4856 GTEST_DISABLE_MSC_WARNINGS_POP_()
4857 global_test_part_result_repoter_(
5003 GTEST_DISABLE_MSC_WARNINGS_POP_() global_test_part_result_repoter_(
48585004 &default_global_test_part_result_reporter_),
48595005 per_thread_test_part_result_reporter_(
48605006 &default_per_thread_test_part_result_reporter_),
48615007 parameterized_test_registry_(),
48625008 parameterized_tests_registered_(false),
4863 last_death_test_case_(-1),
4864 current_test_case_(NULL),
4865 current_test_info_(NULL),
5009 last_death_test_suite_(-1),
5010 current_test_suite_(nullptr),
5011 current_test_info_(nullptr),
48665012 ad_hoc_test_result_(),
4867 os_stack_trace_getter_(NULL),
5013 os_stack_trace_getter_(nullptr),
48685014 post_flag_parse_init_performed_(false),
48695015 random_seed_(0), // Will be overridden by the flag before first use.
4870 random_(0), // Will be reseeded before first use.
5016 random_(0), // Will be reseeded before first use.
48715017 start_timestamp_(0),
48725018 elapsed_time_(0),
48735019 #if GTEST_HAS_DEATH_TEST
48795025 }
48805026
48815027 UnitTestImpl::~UnitTestImpl() {
4882 // Deletes every TestCase.
4883 ForEach(test_cases_, internal::Delete<TestCase>);
5028 // Deletes every TestSuite.
5029 ForEach(test_suites_, internal::Delete<TestSuite>);
48845030
48855031 // Deletes every Environment.
48865032 ForEach(environments_, internal::Delete<Environment>);
48895035 }
48905036
48915037 // Adds a TestProperty to the current TestResult object when invoked in a
4892 // context of a test, to current test case's ad_hoc_test_result when invoke
4893 // from SetUpTestCase/TearDownTestCase, or to the global property set
5038 // context of a test, to current test suite's ad_hoc_test_result when invoke
5039 // from SetUpTestSuite/TearDownTestSuite, or to the global property set
48945040 // otherwise. If the result already contains a property with the same key,
48955041 // the value will be updated.
48965042 void UnitTestImpl::RecordProperty(const TestProperty& test_property) {
48975043 std::string xml_element;
48985044 TestResult* test_result; // TestResult appropriate for property recording.
48995045
4900 if (current_test_info_ != NULL) {
5046 if (current_test_info_ != nullptr) {
49015047 xml_element = "testcase";
49025048 test_result = &(current_test_info_->result_);
4903 } else if (current_test_case_ != NULL) {
5049 } else if (current_test_suite_ != nullptr) {
49045050 xml_element = "testsuite";
4905 test_result = &(current_test_case_->ad_hoc_test_result_);
5051 test_result = &(current_test_suite_->ad_hoc_test_result_);
49065052 } else {
49075053 xml_element = "testsuites";
49085054 test_result = &ad_hoc_test_result_;
49145060 // Disables event forwarding if the control is currently in a death test
49155061 // subprocess. Must not be called before InitGoogleTest.
49165062 void UnitTestImpl::SuppressTestEventsIfInSubprocess() {
4917 if (internal_run_death_test_flag_.get() != NULL)
5063 if (internal_run_death_test_flag_.get() != nullptr)
49185064 listeners()->SuppressEventForwarding();
49195065 }
49205066 #endif // GTEST_HAS_DEATH_TEST
49965142 }
49975143 }
49985144
4999 // A predicate that checks the name of a TestCase against a known
5145 // A predicate that checks the name of a TestSuite against a known
50005146 // value.
50015147 //
50025148 // This is used for implementation of the UnitTest class only. We put
50035149 // it in the anonymous namespace to prevent polluting the outer
50045150 // namespace.
50055151 //
5006 // TestCaseNameIs is copyable.
5007 class TestCaseNameIs {
5152 // TestSuiteNameIs is copyable.
5153 class TestSuiteNameIs {
50085154 public:
50095155 // Constructor.
5010 explicit TestCaseNameIs(const std::string& name)
5011 : name_(name) {}
5012
5013 // Returns true iff the name of test_case matches name_.
5014 bool operator()(const TestCase* test_case) const {
5015 return test_case != NULL && strcmp(test_case->name(), name_.c_str()) == 0;
5156 explicit TestSuiteNameIs(const std::string& name) : name_(name) {}
5157
5158 // Returns true if and only if the name of test_suite matches name_.
5159 bool operator()(const TestSuite* test_suite) const {
5160 return test_suite != nullptr &&
5161 strcmp(test_suite->name(), name_.c_str()) == 0;
50165162 }
50175163
50185164 private:
50195165 std::string name_;
50205166 };
50215167
5022 // Finds and returns a TestCase with the given name. If one doesn't
5168 // Finds and returns a TestSuite with the given name. If one doesn't
50235169 // exist, creates one and returns it. It's the CALLER'S
50245170 // RESPONSIBILITY to ensure that this function is only called WHEN THE
50255171 // TESTS ARE NOT SHUFFLED.
50265172 //
50275173 // Arguments:
50285174 //
5029 // test_case_name: name of the test case
5030 // type_param: the name of the test case's type parameter, or NULL if
5031 // this is not a typed or a type-parameterized test case.
5032 // set_up_tc: pointer to the function that sets up the test case
5033 // tear_down_tc: pointer to the function that tears down the test case
5034 TestCase* UnitTestImpl::GetTestCase(const char* test_case_name,
5035 const char* type_param,
5036 Test::SetUpTestCaseFunc set_up_tc,
5037 Test::TearDownTestCaseFunc tear_down_tc) {
5038 // Can we find a TestCase with the given name?
5039 const std::vector<TestCase*>::const_reverse_iterator test_case =
5040 std::find_if(test_cases_.rbegin(), test_cases_.rend(),
5041 TestCaseNameIs(test_case_name));
5042
5043 if (test_case != test_cases_.rend())
5044 return *test_case;
5175 // test_suite_name: name of the test suite
5176 // type_param: the name of the test suite's type parameter, or NULL if
5177 // this is not a typed or a type-parameterized test suite.
5178 // set_up_tc: pointer to the function that sets up the test suite
5179 // tear_down_tc: pointer to the function that tears down the test suite
5180 TestSuite* UnitTestImpl::GetTestSuite(
5181 const char* test_suite_name, const char* type_param,
5182 internal::SetUpTestSuiteFunc set_up_tc,
5183 internal::TearDownTestSuiteFunc tear_down_tc) {
5184 // Can we find a TestSuite with the given name?
5185 const auto test_suite =
5186 std::find_if(test_suites_.rbegin(), test_suites_.rend(),
5187 TestSuiteNameIs(test_suite_name));
5188
5189 if (test_suite != test_suites_.rend()) return *test_suite;
50455190
50465191 // No. Let's create one.
5047 TestCase* const new_test_case =
5048 new TestCase(test_case_name, type_param, set_up_tc, tear_down_tc);
5049
5050 // Is this a death test case?
5051 if (internal::UnitTestOptions::MatchesFilter(test_case_name,
5052 kDeathTestCaseFilter)) {
5053 // Yes. Inserts the test case after the last death test case
5054 // defined so far. This only works when the test cases haven't
5192 auto* const new_test_suite =
5193 new TestSuite(test_suite_name, type_param, set_up_tc, tear_down_tc);
5194
5195 // Is this a death test suite?
5196 if (internal::UnitTestOptions::MatchesFilter(test_suite_name,
5197 kDeathTestSuiteFilter)) {
5198 // Yes. Inserts the test suite after the last death test suite
5199 // defined so far. This only works when the test suites haven't
50555200 // been shuffled. Otherwise we may end up running a death test
50565201 // after a non-death test.
5057 ++last_death_test_case_;
5058 test_cases_.insert(test_cases_.begin() + last_death_test_case_,
5059 new_test_case);
5202 ++last_death_test_suite_;
5203 test_suites_.insert(test_suites_.begin() + last_death_test_suite_,
5204 new_test_suite);
50605205 } else {
50615206 // No. Appends to the end of the list.
5062 test_cases_.push_back(new_test_case);
5063 }
5064
5065 test_case_indices_.push_back(static_cast<int>(test_case_indices_.size()));
5066 return new_test_case;
5207 test_suites_.push_back(new_test_suite);
5208 }
5209
5210 test_suite_indices_.push_back(static_cast<int>(test_suite_indices_.size()));
5211 return new_test_suite;
50675212 }
50685213
50695214 // Helpers for setting up / tearing down the given environment. They
50815226 // All other functions called from RunAllTests() may safely assume that
50825227 // parameterized tests are ready to be counted and run.
50835228 bool UnitTestImpl::RunAllTests() {
5084 // True iff Google Test is initialized before RUN_ALL_TESTS() is called.
5229 // True if and only if Google Test is initialized before RUN_ALL_TESTS() is
5230 // called.
50855231 const bool gtest_is_initialized_before_run_all_tests = GTestIsInitialized();
50865232
50875233 // Do not run any test if the --help flag was specified.
50975243 // protocol.
50985244 internal::WriteToShardStatusFileIfNeeded();
50995245
5100 // True iff we are in a subprocess for running a thread-safe-style
5246 // True if and only if we are in a subprocess for running a thread-safe-style
51015247 // death test.
51025248 bool in_subprocess_for_death_test = false;
51035249
51045250 #if GTEST_HAS_DEATH_TEST
5105 in_subprocess_for_death_test = (internal_run_death_test_flag_.get() != NULL);
5251 in_subprocess_for_death_test =
5252 (internal_run_death_test_flag_.get() != nullptr);
51065253 # if defined(GTEST_EXTRA_DEATH_TEST_CHILD_SETUP_)
51075254 if (in_subprocess_for_death_test) {
51085255 GTEST_EXTRA_DEATH_TEST_CHILD_SETUP_();
51295276 random_seed_ = GTEST_FLAG(shuffle) ?
51305277 GetRandomSeedFromFlag(GTEST_FLAG(random_seed)) : 0;
51315278
5132 // True iff at least one test has failed.
5279 // True if and only if at least one test has failed.
51335280 bool failed = false;
51345281
51355282 TestEventListener* repeater = listeners()->repeater();
51415288 // when we are inside the subprocess of a death test.
51425289 const int repeat = in_subprocess_for_death_test ? 1 : GTEST_FLAG(repeat);
51435290 // Repeats forever if the repeat count is negative.
5144 const bool forever = repeat < 0;
5145 for (int i = 0; forever || i != repeat; i++) {
5291 const bool gtest_repeat_forever = repeat < 0;
5292 for (int i = 0; gtest_repeat_forever || i != repeat; i++) {
51465293 // We want to preserve failures generated by ad-hoc test
51475294 // assertions executed before RUN_ALL_TESTS().
51485295 ClearNonAdHocTestResult();
51495296
51505297 const TimeInMillis start = GetTimeInMillis();
51515298
5152 // Shuffles test cases and tests if requested.
5299 // Shuffles test suites and tests if requested.
51535300 if (has_tests_to_run && GTEST_FLAG(shuffle)) {
5154 random()->Reseed(random_seed_);
5301 random()->Reseed(static_cast<UInt32>(random_seed_));
51555302 // This should be done before calling OnTestIterationStart(),
51565303 // such that a test event listener can see the actual test order
51575304 // in the event.
51615308 // Tells the unit test event listeners that the tests are about to start.
51625309 repeater->OnTestIterationStart(*parent_, i);
51635310
5164 // Runs each test case if there is at least one test to run.
5311 // Runs each test suite if there is at least one test to run.
51655312 if (has_tests_to_run) {
51665313 // Sets up all environments beforehand.
51675314 repeater->OnEnvironmentsSetUpStart(*parent_);
51685315 ForEach(environments_, SetUpEnvironment);
51695316 repeater->OnEnvironmentsSetUpEnd(*parent_);
51705317
5171 // Runs the tests only if there was no fatal failure during global
5172 // set-up.
5173 if (!Test::HasFatalFailure()) {
5174 for (int test_index = 0; test_index < total_test_case_count();
5318 // Runs the tests only if there was no fatal failure or skip triggered
5319 // during global set-up.
5320 if (Test::IsSkipped()) {
5321 // Emit diagnostics when global set-up calls skip, as it will not be
5322 // emitted by default.
5323 TestResult& test_result =
5324 *internal::GetUnitTestImpl()->current_test_result();
5325 for (int j = 0; j < test_result.total_part_count(); ++j) {
5326 const TestPartResult& test_part_result =
5327 test_result.GetTestPartResult(j);
5328 if (test_part_result.type() == TestPartResult::kSkip) {
5329 const std::string& result = test_part_result.message();
5330 printf("%s\n", result.c_str());
5331 }
5332 }
5333 fflush(stdout);
5334 } else if (!Test::HasFatalFailure()) {
5335 for (int test_index = 0; test_index < total_test_suite_count();
51755336 test_index++) {
5176 GetMutableTestCase(test_index)->Run();
5337 GetMutableSuiteCase(test_index)->Run();
51775338 }
51785339 }
51795340
52335394 // be created, prints an error and exits.
52345395 void WriteToShardStatusFileIfNeeded() {
52355396 const char* const test_shard_file = posix::GetEnv(kTestShardStatusFile);
5236 if (test_shard_file != NULL) {
5397 if (test_shard_file != nullptr) {
52375398 FILE* const file = posix::FOpen(test_shard_file, "w");
5238 if (file == NULL) {
5399 if (file == nullptr) {
52395400 ColoredPrintf(COLOR_RED,
52405401 "Could not write to the test shard status file \"%s\" "
52415402 "specified by the %s environment variable.\n",
52705431 << "Invalid environment variables: you have "
52715432 << kTestShardIndex << " = " << shard_index
52725433 << ", but have left " << kTestTotalShards << " unset.\n";
5273 ColoredPrintf(COLOR_RED, msg.GetString().c_str());
5434 ColoredPrintf(COLOR_RED, "%s", msg.GetString().c_str());
52745435 fflush(stdout);
52755436 exit(EXIT_FAILURE);
52765437 } else if (total_shards != -1 && shard_index == -1) {
52785439 << "Invalid environment variables: you have "
52795440 << kTestTotalShards << " = " << total_shards
52805441 << ", but have left " << kTestShardIndex << " unset.\n";
5281 ColoredPrintf(COLOR_RED, msg.GetString().c_str());
5442 ColoredPrintf(COLOR_RED, "%s", msg.GetString().c_str());
52825443 fflush(stdout);
52835444 exit(EXIT_FAILURE);
52845445 } else if (shard_index < 0 || shard_index >= total_shards) {
52875448 << kTestShardIndex << " < " << kTestTotalShards
52885449 << ", but you have " << kTestShardIndex << "=" << shard_index
52895450 << ", " << kTestTotalShards << "=" << total_shards << ".\n";
5290 ColoredPrintf(COLOR_RED, msg.GetString().c_str());
5451 ColoredPrintf(COLOR_RED, "%s", msg.GetString().c_str());
52915452 fflush(stdout);
52925453 exit(EXIT_FAILURE);
52935454 }
53005461 // and aborts.
53015462 Int32 Int32FromEnvOrDie(const char* var, Int32 default_val) {
53025463 const char* str_val = posix::GetEnv(var);
5303 if (str_val == NULL) {
5464 if (str_val == nullptr) {
53045465 return default_val;
53055466 }
53065467
53135474 }
53145475
53155476 // Given the total number of shards, the shard index, and the test id,
5316 // returns true iff the test should be run on this shard. The test id is
5317 // some arbitrary but unique non-negative integer assigned to each test
5477 // returns true if and only if the test should be run on this shard. The test id
5478 // is some arbitrary but unique non-negative integer assigned to each test
53185479 // method. Assumes that 0 <= shard_index < total_shards.
53195480 bool ShouldRunTestOnShard(int total_shards, int shard_index, int test_id) {
53205481 return (test_id % total_shards) == shard_index;
53225483
53235484 // Compares the name of each test with the user-specified filter to
53245485 // decide whether the test should be run, then records the result in
5325 // each TestCase and TestInfo object.
5486 // each TestSuite and TestInfo object.
53265487 // If shard_tests == true, further filters tests based on sharding
53275488 // variables in the environment - see
53285489 // https://github.com/google/googletest/blob/master/googletest/docs/advanced.md
53395500 // this shard.
53405501 int num_runnable_tests = 0;
53415502 int num_selected_tests = 0;
5342 for (size_t i = 0; i < test_cases_.size(); i++) {
5343 TestCase* const test_case = test_cases_[i];
5344 const std::string &test_case_name = test_case->name();
5345 test_case->set_should_run(false);
5346
5347 for (size_t j = 0; j < test_case->test_info_list().size(); j++) {
5348 TestInfo* const test_info = test_case->test_info_list()[j];
5503 for (auto* test_suite : test_suites_) {
5504 const std::string& test_suite_name = test_suite->name();
5505 test_suite->set_should_run(false);
5506
5507 for (size_t j = 0; j < test_suite->test_info_list().size(); j++) {
5508 TestInfo* const test_info = test_suite->test_info_list()[j];
53495509 const std::string test_name(test_info->name());
5350 // A test is disabled if test case name or test name matches
5510 // A test is disabled if test suite name or test name matches
53515511 // kDisableTestFilter.
5352 const bool is_disabled =
5353 internal::UnitTestOptions::MatchesFilter(test_case_name,
5354 kDisableTestFilter) ||
5355 internal::UnitTestOptions::MatchesFilter(test_name,
5356 kDisableTestFilter);
5512 const bool is_disabled = internal::UnitTestOptions::MatchesFilter(
5513 test_suite_name, kDisableTestFilter) ||
5514 internal::UnitTestOptions::MatchesFilter(
5515 test_name, kDisableTestFilter);
53575516 test_info->is_disabled_ = is_disabled;
53585517
5359 const bool matches_filter =
5360 internal::UnitTestOptions::FilterMatchesTest(test_case_name,
5361 test_name);
5518 const bool matches_filter = internal::UnitTestOptions::FilterMatchesTest(
5519 test_suite_name, test_name);
53625520 test_info->matches_filter_ = matches_filter;
53635521
53645522 const bool is_runnable =
53755533 num_selected_tests += is_selected;
53765534
53775535 test_info->should_run_ = is_selected;
5378 test_case->set_should_run(test_case->should_run() || is_selected);
5536 test_suite->set_should_run(test_suite->should_run() || is_selected);
53795537 }
53805538 }
53815539 return num_selected_tests;
53865544 // max_length characters, only prints the first max_length characters
53875545 // and "...".
53885546 static void PrintOnOneLine(const char* str, int max_length) {
5389 if (str != NULL) {
5547 if (str != nullptr) {
53905548 for (int i = 0; *str != '\0'; ++str) {
53915549 if (i >= max_length) {
53925550 printf("...");
54085566 // Print at most this many characters for each type/value parameter.
54095567 const int kMaxParamLength = 250;
54105568
5411 for (size_t i = 0; i < test_cases_.size(); i++) {
5412 const TestCase* const test_case = test_cases_[i];
5413 bool printed_test_case_name = false;
5414
5415 for (size_t j = 0; j < test_case->test_info_list().size(); j++) {
5416 const TestInfo* const test_info =
5417 test_case->test_info_list()[j];
5569 for (auto* test_suite : test_suites_) {
5570 bool printed_test_suite_name = false;
5571
5572 for (size_t j = 0; j < test_suite->test_info_list().size(); j++) {
5573 const TestInfo* const test_info = test_suite->test_info_list()[j];
54185574 if (test_info->matches_filter_) {
5419 if (!printed_test_case_name) {
5420 printed_test_case_name = true;
5421 printf("%s.", test_case->name());
5422 if (test_case->type_param() != NULL) {
5575 if (!printed_test_suite_name) {
5576 printed_test_suite_name = true;
5577 printf("%s.", test_suite->name());
5578 if (test_suite->type_param() != nullptr) {
54235579 printf(" # %s = ", kTypeParamLabel);
54245580 // We print the type parameter on a single line to make
54255581 // the output easy to parse by a program.
5426 PrintOnOneLine(test_case->type_param(), kMaxParamLength);
5582 PrintOnOneLine(test_suite->type_param(), kMaxParamLength);
54275583 }
54285584 printf("\n");
54295585 }
54305586 printf(" %s", test_info->name());
5431 if (test_info->value_param() != NULL) {
5587 if (test_info->value_param() != nullptr) {
54325588 printf(" # %s = ", kValueParamLabel);
54335589 // We print the value parameter on a single line to make the
54345590 // output easy to parse by a program.
54475603 if (output_format == "xml") {
54485604 XmlUnitTestResultPrinter(
54495605 UnitTestOptions::GetAbsolutePathToOutputFile().c_str())
5450 .PrintXmlTestsList(&stream, test_cases_);
5606 .PrintXmlTestsList(&stream, test_suites_);
54515607 } else if (output_format == "json") {
54525608 JsonUnitTestResultPrinter(
54535609 UnitTestOptions::GetAbsolutePathToOutputFile().c_str())
5454 .PrintJsonTestList(&stream, test_cases_);
5610 .PrintJsonTestList(&stream, test_suites_);
54555611 }
54565612 fprintf(fileout, "%s", StringStreamToString(&stream).c_str());
54575613 fclose(fileout);
54755631 // otherwise, creates an OsStackTraceGetter, makes it the current
54765632 // getter, and returns it.
54775633 OsStackTraceGetterInterface* UnitTestImpl::os_stack_trace_getter() {
5478 if (os_stack_trace_getter_ == NULL) {
5634 if (os_stack_trace_getter_ == nullptr) {
54795635 #ifdef GTEST_OS_STACK_TRACE_GETTER_
54805636 os_stack_trace_getter_ = new GTEST_OS_STACK_TRACE_GETTER_;
54815637 #else
54885644
54895645 // Returns the most specific TestResult currently running.
54905646 TestResult* UnitTestImpl::current_test_result() {
5491 if (current_test_info_ != NULL) {
5647 if (current_test_info_ != nullptr) {
54925648 return &current_test_info_->result_;
54935649 }
5494 if (current_test_case_ != NULL) {
5495 return &current_test_case_->ad_hoc_test_result_;
5650 if (current_test_suite_ != nullptr) {
5651 return &current_test_suite_->ad_hoc_test_result_;
54965652 }
54975653 return &ad_hoc_test_result_;
54985654 }
54995655
5500 // Shuffles all test cases, and the tests within each test case,
5656 // Shuffles all test suites, and the tests within each test suite,
55015657 // making sure that death tests are still run first.
55025658 void UnitTestImpl::ShuffleTests() {
5503 // Shuffles the death test cases.
5504 ShuffleRange(random(), 0, last_death_test_case_ + 1, &test_case_indices_);
5505
5506 // Shuffles the non-death test cases.
5507 ShuffleRange(random(), last_death_test_case_ + 1,
5508 static_cast<int>(test_cases_.size()), &test_case_indices_);
5509
5510 // Shuffles the tests inside each test case.
5511 for (size_t i = 0; i < test_cases_.size(); i++) {
5512 test_cases_[i]->ShuffleTests(random());
5513 }
5514 }
5515
5516 // Restores the test cases and tests to their order before the first shuffle.
5659 // Shuffles the death test suites.
5660 ShuffleRange(random(), 0, last_death_test_suite_ + 1, &test_suite_indices_);
5661
5662 // Shuffles the non-death test suites.
5663 ShuffleRange(random(), last_death_test_suite_ + 1,
5664 static_cast<int>(test_suites_.size()), &test_suite_indices_);
5665
5666 // Shuffles the tests inside each test suite.
5667 for (auto& test_suite : test_suites_) {
5668 test_suite->ShuffleTests(random());
5669 }
5670 }
5671
5672 // Restores the test suites and tests to their order before the first shuffle.
55175673 void UnitTestImpl::UnshuffleTests() {
5518 for (size_t i = 0; i < test_cases_.size(); i++) {
5519 // Unshuffles the tests in each test case.
5520 test_cases_[i]->UnshuffleTests();
5521 // Resets the index of each test case.
5522 test_case_indices_[i] = static_cast<int>(i);
5674 for (size_t i = 0; i < test_suites_.size(); i++) {
5675 // Unshuffles the tests in each test suite.
5676 test_suites_[i]->UnshuffleTests();
5677 // Resets the index of each test suite.
5678 test_suite_indices_[i] = static_cast<int>(i);
55235679 }
55245680 }
55255681
55785734 static const char* ParseFlagValue(const char* str, const char* flag,
55795735 bool def_optional) {
55805736 // str and flag must not be NULL.
5581 if (str == NULL || flag == NULL) return NULL;
5737 if (str == nullptr || flag == nullptr) return nullptr;
55825738
55835739 // The flag must start with "--" followed by GTEST_FLAG_PREFIX_.
55845740 const std::string flag_str = std::string("--") + GTEST_FLAG_PREFIX_ + flag;
55855741 const size_t flag_len = flag_str.length();
5586 if (strncmp(str, flag_str.c_str(), flag_len) != 0) return NULL;
5742 if (strncmp(str, flag_str.c_str(), flag_len) != 0) return nullptr;
55875743
55885744 // Skips the flag name.
55895745 const char* flag_end = str + flag_len;
55965752 // If def_optional is true and there are more characters after the
55975753 // flag name, or if def_optional is false, there must be a '=' after
55985754 // the flag name.
5599 if (flag_end[0] != '=') return NULL;
5755 if (flag_end[0] != '=') return nullptr;
56005756
56015757 // Returns the string after "=".
56025758 return flag_end + 1;
56175773 const char* const value_str = ParseFlagValue(str, flag, true);
56185774
56195775 // Aborts if the parsing failed.
5620 if (value_str == NULL) return false;
5776 if (value_str == nullptr) return false;
56215777
56225778 // Converts the string value to a bool.
56235779 *value = !(*value_str == '0' || *value_str == 'f' || *value_str == 'F');
56345790 const char* const value_str = ParseFlagValue(str, flag, false);
56355791
56365792 // Aborts if the parsing failed.
5637 if (value_str == NULL) return false;
5793 if (value_str == nullptr) return false;
56385794
56395795 // Sets *value to the value of the flag.
56405796 return ParseInt32(Message() << "The value of flag --" << flag,
56525808 const char* const value_str = ParseFlagValue(str, flag, false);
56535809
56545810 // Aborts if the parsing failed.
5655 if (value_str == NULL) return false;
5811 if (value_str == nullptr) return false;
56565812
56575813 // Sets *value to the value of the flag.
56585814 *value = value_str;
56835839 // @Y changes the color to yellow.
56845840 // @D changes to the default terminal text color.
56855841 //
5686 // FIXME: Write tests for this once we add stdout
5687 // capturing to Google Test.
56885842 static void PrintColorEncoded(const char* str) {
56895843 GTestColor color = COLOR_DEFAULT; // The current color.
56905844
56945848 // next segment.
56955849 for (;;) {
56965850 const char* p = strchr(str, '@');
5697 if (p == NULL) {
5851 if (p == nullptr) {
56985852 ColoredPrintf(color, "%s", str);
56995853 return;
57005854 }
57525906 " @G--" GTEST_FLAG_PREFIX_ "output=@Y(@Gjson@Y|@Gxml@Y)[@G:@YDIRECTORY_PATH@G"
57535907 GTEST_PATH_SEP_ "@Y|@G:@YFILE_PATH]@D\n"
57545908 " Generate a JSON or XML report in the given directory or with the given\n"
5755 " file name. @YFILE_PATH@D defaults to @Gtest_details.xml@D.\n"
5909 " file name. @YFILE_PATH@D defaults to @Gtest_detail.xml@D.\n"
57565910 # if GTEST_CAN_STREAM_RESULTS_
57575911 " @G--" GTEST_FLAG_PREFIX_ "stream_result_to=@YHOST@G:@YPORT@D\n"
57585912 " Stream test results to the given server.\n"
58946048 void ParseGoogleTestFlagsOnly(int* argc, char** argv) {
58956049 ParseGoogleTestFlagsOnlyImpl(argc, argv);
58966050
5897 // Fix the value of *_NSGetArgc() on macOS, but iff
6051 // Fix the value of *_NSGetArgc() on macOS, but if and only if
58986052 // *_NSGetArgv() == argv
58996053 // Only applicable to char** version of argv
59006054 #if GTEST_OS_MAC
59626116 #endif // defined(GTEST_CUSTOM_INIT_GOOGLE_TEST_FUNCTION_)
59636117 }
59646118
6119 // This overloaded version can be used on Arduino/embedded platforms where
6120 // there is no argc/argv.
6121 void InitGoogleTest() {
6122 // Since Arduino doesn't have a command line, fake out the argc/argv arguments
6123 int argc = 1;
6124 const auto arg0 = "dummy";
6125 char* argv0 = const_cast<char*>(arg0);
6126 char** argv = &argv0;
6127
6128 #if defined(GTEST_CUSTOM_INIT_GOOGLE_TEST_FUNCTION_)
6129 GTEST_CUSTOM_INIT_GOOGLE_TEST_FUNCTION_(&argc, argv);
6130 #else // defined(GTEST_CUSTOM_INIT_GOOGLE_TEST_FUNCTION_)
6131 internal::InitGoogleTestImpl(&argc, argv);
6132 #endif // defined(GTEST_CUSTOM_INIT_GOOGLE_TEST_FUNCTION_)
6133 }
6134
59656135 std::string TempDir() {
59666136 #if defined(GTEST_CUSTOM_TEMPDIR_FUNCTION_)
59676137 return GTEST_CUSTOM_TEMPDIR_FUNCTION_();
59716141 return "\\temp\\";
59726142 #elif GTEST_OS_WINDOWS
59736143 const char* temp_dir = internal::posix::GetEnv("TEMP");
5974 if (temp_dir == NULL || temp_dir[0] == '\0')
6144 if (temp_dir == nullptr || temp_dir[0] == '\0')
59756145 return "\\temp\\";
59766146 else if (temp_dir[strlen(temp_dir) - 1] == '\\')
59776147 return temp_dir;
2626 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
2727 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2828
29 #include <stdio.h>
29 #include <cstdio>
3030 #include "gtest/gtest.h"
31
32 #ifdef ARDUINO
33 void setup() {
34 testing::InitGoogleTest();
35 }
36
37 void loop() { RUN_ALL_TESTS(); }
38
39 #else
3140
3241 GTEST_API_ int main(int argc, char **argv) {
3342 printf("Running main() from %s\n", __FILE__);
3443 testing::InitGoogleTest(&argc, argv);
3544 return RUN_ALL_TESTS();
3645 }
46 #endif
00 #pragma once
1
2 namespace testing {
3 namespace internal {
4 enum GTestColor {
5 COLOR_DEFAULT,
6 COLOR_RED,
7 COLOR_GREEN,
8 COLOR_YELLOW
9 };
10
11 void ColoredPrintf(GTestColor color, const char* fmt, ...);
12 }
13 }
141
152 #define WARNING(...) \
163 ColoredPrintf(testing::internal::COLOR_YELLOW, "[ WARNING ] "), \