VirtualBox

source: vbox/trunk/src/libs/libxml2-2.12.6/Makefile.am

Last change on this file was 104106, checked in by vboxsync, 8 weeks ago

libxml2-2.9.14: Applied and adjusted our libxml2 changes to 2.9.14. bugref:10640

  • Property svn:eol-style set to native
File size: 14.7 KB
Line 
1## Process this file with automake to produce Makefile.in
2
3ACLOCAL_AMFLAGS = -I m4
4
5SUBDIRS = include . doc example xstc
6if WITH_PYTHON
7SUBDIRS += python
8endif
9if WITH_GLOB
10SUBDIRS += fuzz
11endif
12
13DIST_SUBDIRS = include . doc example fuzz python xstc
14
15AM_CPPFLAGS = -I$(top_builddir)/include -I$(srcdir)/include -DSYSCONFDIR='"$(sysconfdir)"'
16
17check_PROGRAMS = \
18 runsuite \
19 runtest \
20 runxmlconf \
21 testModule \
22 testThreads \
23 testapi \
24 testchar \
25 testdict \
26 testlimits \
27 testparser \
28 testrecurse
29
30bin_PROGRAMS = xmllint xmlcatalog
31
32bin_SCRIPTS = xml2-config
33
34lib_LTLIBRARIES = libxml2.la
35libxml2_la_CFLAGS = $(AM_CFLAGS) $(XML_PRIVATE_CFLAGS)
36libxml2_la_LIBADD = $(XML_PRIVATE_LIBS)
37
38libxml2_la_LDFLAGS = $(AM_LDFLAGS) -no-undefined \
39 -version-info $(LIBXML_VERSION_INFO) \
40 $(MODULE_PLATFORM_LIBS)
41if USE_VERSION_SCRIPT
42libxml2_la_LDFLAGS += $(VERSION_SCRIPT_FLAGS)$(srcdir)/libxml2.syms
43endif
44
45libxml2_la_SOURCES = buf.c chvalid.c dict.c entities.c encoding.c error.c \
46 globals.c hash.c list.c parser.c parserInternals.c \
47 SAX2.c threads.c tree.c uri.c valid.c xmlIO.c \
48 xmlmemory.c xmlstring.c
49if WITH_C14N_SOURCES
50libxml2_la_SOURCES += c14n.c
51endif
52if WITH_CATALOG_SOURCES
53libxml2_la_SOURCES += catalog.c
54endif
55if WITH_DEBUG_SOURCES
56libxml2_la_SOURCES += debugXML.c
57endif
58if WITH_FTP_SOURCES
59libxml2_la_SOURCES += nanoftp.c
60endif
61if WITH_HTML_SOURCES
62libxml2_la_SOURCES += HTMLparser.c HTMLtree.c
63endif
64if WITH_HTTP_SOURCES
65libxml2_la_SOURCES += nanohttp.c
66endif
67if WITH_LEGACY_SOURCES
68libxml2_la_SOURCES += legacy.c
69if WITH_SAX1_SOURCES
70libxml2_la_SOURCES += SAX.c
71endif
72endif
73if WITH_LZMA_SOURCES
74libxml2_la_SOURCES += xzlib.c
75endif
76if WITH_MODULES_SOURCES
77libxml2_la_SOURCES += xmlmodule.c
78endif
79if WITH_OUTPUT_SOURCES
80libxml2_la_SOURCES += xmlsave.c
81endif
82if WITH_PATTERN_SOURCES
83libxml2_la_SOURCES += pattern.c
84endif
85if WITH_READER_SOURCES
86libxml2_la_SOURCES += xmlreader.c
87endif
88if WITH_REGEXPS_SOURCES
89libxml2_la_SOURCES += xmlregexp.c xmlunicode.c
90endif
91if WITH_SCHEMAS_SOURCES
92libxml2_la_SOURCES += relaxng.c xmlschemas.c xmlschemastypes.c
93if !WITH_XPATH_SOURCES
94libxml2_la_SOURCES += xpath.c
95endif
96endif
97if WITH_SCHEMATRON_SOURCES
98libxml2_la_SOURCES += schematron.c
99endif
100if WITH_TRIO_SOURCES
101libxml2_la_SOURCES += triostr.c trio.c
102endif
103if WITH_WRITER_SOURCES
104libxml2_la_SOURCES += xmlwriter.c
105endif
106if WITH_XINCLUDE_SOURCES
107libxml2_la_SOURCES += xinclude.c
108endif
109if WITH_XPATH_SOURCES
110libxml2_la_SOURCES += xpath.c
111endif
112if WITH_XPTR_SOURCES
113libxml2_la_SOURCES += xlink.c xpointer.c
114endif
115
116DEPS = $(top_builddir)/libxml2.la
117LDADDS = $(top_builddir)/libxml2.la
118
119
120m4datadir = $(datadir)/aclocal
121dist_m4data_DATA = libxml.m4
122
123runtest_SOURCES=runtest.c
124runtest_CFLAGS = $(AM_CFLAGS) $(THREAD_CFLAGS)
125runtest_DEPENDENCIES = $(DEPS)
126runtest_LDADD= $(BASE_THREAD_LIBS) $(THREAD_LIBS) $(LDADDS)
127
128testrecurse_SOURCES=testrecurse.c
129testrecurse_DEPENDENCIES = $(DEPS)
130testrecurse_LDADD= $(LDADDS)
131
132testlimits_SOURCES=testlimits.c
133testlimits_DEPENDENCIES = $(DEPS)
134testlimits_LDADD= $(LDADDS)
135
136testchar_SOURCES=testchar.c
137testchar_DEPENDENCIES = $(DEPS)
138testchar_LDADD= $(LDADDS)
139
140testdict_SOURCES=testdict.c
141testdict_DEPENDENCIES = $(DEPS)
142testdict_LDADD= $(LDADDS)
143
144testparser_SOURCES=testparser.c
145testparser_DEPENDENCIES = $(DEPS)
146testparser_LDADD= $(LDADDS)
147
148runsuite_SOURCES=runsuite.c
149runsuite_DEPENDENCIES = $(DEPS)
150runsuite_LDADD= $(LDADDS)
151
152xmllint_SOURCES=xmllint.c
153xmllint_CFLAGS = $(AM_CFLAGS) $(RDL_CFLAGS) $(ICONV_CFLAGS)
154xmllint_DEPENDENCIES = $(DEPS)
155xmllint_LDADD= $(RDL_LIBS) $(LDADDS)
156
157xmlcatalog_SOURCES=xmlcatalog.c
158xmlcatalog_CFLAGS = $(AM_CFLAGS) $(RDL_CFLAGS) $(ICONV_CFLAGS)
159xmlcatalog_DEPENDENCIES = $(DEPS)
160xmlcatalog_LDADD = $(RDL_LIBS) $(LDADDS)
161
162testThreads_SOURCES = testThreads.c
163testThreads_CFLAGS = $(AM_CFLAGS) $(THREAD_CFLAGS)
164testThreads_DEPENDENCIES = $(DEPS)
165testThreads_LDADD= $(BASE_THREAD_LIBS) $(THREAD_LIBS) $(LDADDS)
166
167testModule_SOURCES=testModule.c
168testModule_DEPENDENCIES = $(DEPS)
169testModule_LDADD= $(LDADDS)
170
171noinst_LTLIBRARIES = testdso.la
172testdso_la_SOURCES = testdso.c
173testdso_la_LDFLAGS = $(AM_LDFLAGS) \
174 -module -no-undefined -avoid-version -rpath $(libdir)
175
176# that one forces the rebuild when "make rebuild" is run on doc/
177rebuild_testapi:
178 -@(if [ "$(PYTHON)" != "" ] ; then \
179 $(PYTHON) $(srcdir)/gentest.py $(srcdir) ; fi )
180
181testapi_SOURCES=testapi.c
182testapi_DEPENDENCIES = $(DEPS)
183testapi_LDADD= $(LDADDS)
184
185runxmlconf_SOURCES=runxmlconf.c
186runxmlconf_DEPENDENCIES = $(DEPS)
187runxmlconf_LDADD= $(LDADDS)
188
189#testOOM_SOURCES=testOOM.c testOOMlib.h testOOMlib.c
190#testOOM_DEPENDENCIES = $(DEPS)
191#testOOM_LDADD= $(LDADDS)
192
193check-local:
194 [ -d test ] || $(LN_S) $(srcdir)/test .
195 [ -d result ] || $(LN_S) $(srcdir)/result .
196 $(CHECKER) ./runtest$(EXEEXT)
197 $(CHECKER) ./testrecurse$(EXEEXT)
198 $(CHECKER) ./testapi$(EXEEXT)
199 $(CHECKER) ./testchar$(EXEEXT)
200 $(CHECKER) ./testdict$(EXEEXT)
201 $(CHECKER) ./testparser$(EXEEXT)
202 $(CHECKER) ./testModule$(EXEEXT)
203 $(CHECKER) ./testThreads$(EXEEXT)
204 $(CHECKER) ./runxmlconf$(EXEEXT)
205 $(CHECKER) ./runsuite$(EXEEXT)
206
207# Compatibility name of the check target
208runtests: check
209
210check-valgrind valgrind:
211 @echo '## Running the regression tests under Valgrind'
212 @echo '## Go get a cup of coffee it is gonna take a while ...'
213 $(MAKE) CHECKER='valgrind -q' check
214
215asan:
216 @echo '## rebuilding for ASAN'
217 ./configure CFLAGS="-fsanitize=address,undefined -Wformat -Werror=format-security -Werror=array-bounds -g" CXXFLAGS="-fsanitize=address,undefined -Wformat -Werror=format-security -Werror=array-bounds -g" LDFLAGS="-fsanitize=address,undefined" CC="clang" CXX="clang++" --disable-shared ; OptimOff ; $(MAKE) clean ; $(MAKE)
218
219# Old test suite. This should be ported to C.
220
221OLD_TESTS = Timingtests
222if WITH_CATALOG_SOURCES
223OLD_TESTS += Catatests
224endif
225if WITH_DEBUG_SOURCES
226OLD_TESTS += Scripttests
227endif
228if WITH_SCHEMAS_SOURCES
229if WITH_PYTHON
230OLD_TESTS += RelaxNGPythonTests SchemasPythonTests
231endif
232endif
233if WITH_SCHEMATRON_SOURCES
234OLD_TESTS += Schematrontests
235endif
236if WITH_VALID_SOURCES
237OLD_TESTS += VTimingtests
238endif
239
240tests: $(OLD_TESTS)
241
242Scripttests : xmllint$(EXEEXT)
243 @echo "## Scripts regression tests"
244 @echo "## Some of the base computations may be different if srcdir != ."
245 -@(for i in $(srcdir)/test/scripts/*.script ; do \
246 name=`basename $$i .script`; \
247 xml=$(srcdir)/test/scripts/`basename $$i .script`.xml; \
248 if [ -f $$xml ] ; then \
249 if [ ! -f $(srcdir)/result/scripts/$$name ] ; then \
250 echo New test file $$name ; \
251 $(CHECKER) $(top_builddir)/xmllint --shell $$xml < $$i > $(srcdir)/result/scripts/$$name 2> $(srcdir)/result/scripts/$$name.err ; \
252 else \
253 log=`$(CHECKER) $(top_builddir)/xmllint --shell $$xml < $$i > result.$$name 2> result.$$name.err ; \
254 diff $(srcdir)/result/scripts/$$name result.$$name ; \
255 diff $(srcdir)/result/scripts/$$name.err result.$$name.err` ; \
256 if [ -n "$$log" ] ; then echo $$name result ; echo "$$log" ; fi ; \
257 rm result.$$name result.$$name.err ; \
258 fi ; fi ; done)
259
260Catatests : xmlcatalog$(EXEEXT)
261 @echo "## Catalog regression tests"
262 -@(for i in $(srcdir)/test/catalogs/*.script ; do \
263 name=`basename $$i .script`; \
264 xml=$(srcdir)/test/catalogs/`basename $$i .script`.xml; \
265 if [ -f $$xml ] ; then \
266 if [ ! -f $(srcdir)/result/catalogs/$$name ] ; then \
267 echo New test file $$name ; \
268 $(CHECKER) $(top_builddir)/xmlcatalog --shell $$xml < $$i 2>&1 > $(srcdir)/result/catalogs/$$name ; \
269 else \
270 log=`$(CHECKER) $(top_builddir)/xmlcatalog --shell $$xml < $$i 2>&1 > result.$$name ; \
271 diff $(srcdir)/result/catalogs/$$name result.$$name` ; \
272 if [ -n "$$log" ] ; then echo $$name result ; echo "$$log" ; fi ; \
273 rm result.$$name ; \
274 fi ; fi ; done)
275 -@(for i in $(srcdir)/test/catalogs/*.script ; do \
276 name=`basename $$i .script`; \
277 sgml=$(srcdir)/test/catalogs/`basename $$i .script`.sgml; \
278 if [ -f $$sgml ] ; then \
279 if [ ! -f $(srcdir)/result/catalogs/$$name ] ; then \
280 echo New test file $$name ; \
281 $(CHECKER) $(top_builddir)/xmlcatalog --shell $$sgml < $$i > $(srcdir)/result/catalogs/$$name ; \
282 else \
283 log=`$(CHECKER) $(top_builddir)/xmlcatalog --shell $$sgml < $$i > result.$$name ; \
284 diff $(srcdir)/result/catalogs/$$name result.$$name` ; \
285 if [ -n "$$log" ] ; then echo $$name result ; echo "$$log" ; fi ; \
286 rm result.$$name ; \
287 fi ; fi ; done)
288 @echo "## Add and del operations on XML Catalogs"
289 -@($(CHECKER) $(top_builddir)/xmlcatalog --create --noout $(srcdir)/result/catalogs/mycatalog; \
290 $(CHECKER) $(top_builddir)/xmlcatalog --noout --add public Pubid sysid $(srcdir)/result/catalogs/mycatalog; \
291 $(CHECKER) $(top_builddir)/xmlcatalog --noout --add public Pubid2 sysid2 $(srcdir)/result/catalogs/mycatalog; \
292 $(CHECKER) $(top_builddir)/xmlcatalog --noout --add public Pubid3 sysid3 $(srcdir)/result/catalogs/mycatalog; \
293 diff result/catalogs/mycatalog.full $(srcdir)/result/catalogs/mycatalog; \
294 $(CHECKER) $(top_builddir)/xmlcatalog --noout --del sysid $(srcdir)/result/catalogs/mycatalog; \
295 $(CHECKER) $(top_builddir)/xmlcatalog --noout --del sysid3 $(srcdir)/result/catalogs/mycatalog; \
296 $(CHECKER) $(top_builddir)/xmlcatalog --noout --del sysid2 $(srcdir)/result/catalogs/mycatalog; \
297 diff result/catalogs/mycatalog.empty $(srcdir)/result/catalogs/mycatalog; \
298 rm -f $(srcdir)/result/catalogs/mycatalog)
299
300dba100000.xml: dbgenattr.pl
301 @echo "## generating dba100000.xml"
302 @($(PERL) $(top_srcdir)/dbgenattr.pl 100000 > dba100000.xml)
303
304Timingtests: xmllint$(EXEEXT) dba100000.xml
305 @echo "## Timing tests to try to detect performance"
306 @echo "## as well a memory usage breakage when streaming"
307 @echo "## 1/ using the file interface"
308 @echo "## 2/ using the memory interface"
309 @echo "## 3/ repeated DOM parsing"
310 @echo "## 4/ repeated DOM validation"
311 -@($(top_builddir)/xmllint --stream --timing dba100000.xml; \
312 if [ "$$MEM" != "" ] ; then echo Using $$MEM bytes ; fi ; \
313 exit 0)
314 -@($(top_builddir)/xmllint --stream --timing --memory dba100000.xml; \
315 if [ "$$MEM" != "" ] ; then echo Using $$MEM bytes ; fi ; \
316 exit 0)
317 -@($(top_builddir)/xmllint --noout --timing --repeat $(srcdir)/test/valid/REC-xml-19980210.xml; \
318 if [ "$$MEM" != "" ] ; then echo Using $$MEM bytes ; fi ; \
319 exit 0)
320
321VTimingtests: xmllint$(EXEEXT)
322 -@($(top_builddir)/xmllint --noout --timing --valid --repeat $(srcdir)/test/valid/REC-xml-19980210.xml; \
323 if [ "$$MEM" != "" ] ; then echo Using $$MEM bytes ; fi ; \
324 exit 0)
325
326Schematrontests: xmllint$(EXEEXT)
327 @echo "## Schematron regression tests"
328 -@(for i in $(srcdir)/test/schematron/*.sct ; do \
329 name=`basename $$i | sed 's+\.sct++'`; \
330 for j in $(srcdir)/test/schematron/"$$name"_*.xml ; do \
331 if [ -f $$j ] ; then \
332 xno=`basename $$j | sed 's+.*_\(.*\).xml+\1+'`; \
333 if [ ! -f $(srcdir)/result/schematron/"$$name"_"$$xno" ]; \
334 then \
335 echo New test file "$$name"_"$$xno" ; \
336 $(CHECKER) $(top_builddir)/xmllint$(EXEEXT) --schematron $$i $$j \
337 > $(srcdir)/result/schematron/"$$name"_"$$xno" \
338 2> $(srcdir)/result/schematron/"$$name"_"$$xno".err; \
339 else \
340 log=`$(CHECKER) $(top_builddir)/xmllint$(EXEEXT) --schematron $$i $$j \
341 > res.$$name 2> err.$$name;\
342 diff $(srcdir)/result/schematron/"$$name"_"$$xno" \
343 res.$$name;\
344 diff $(srcdir)/result/schematron/"$$name"_"$$xno".err \
345 err.$$name | grep -v "error detected at";\
346 grep Unimplemented err.$$name`; \
347 if [ -n "$$log" ] ; then echo "$$name"_"$$xno" result ; echo "$$log" ; fi ; \
348 rm res.$$name err.$$name ; \
349 fi ; fi ; \
350 done; done)
351
352RelaxNGPythonTests:
353 @(if [ -x $(PYTHON) ] ; then \
354 PYTHONPATH=$(top_builddir)/python:$(top_builddir)/python/.libs:$$PYTHONPATH ; \
355 export PYTHONPATH; \
356 LD_LIBRARY_PATH="$(top_builddir)/.libs:$$LD_LIBRARY_PATH" ; \
357 export LD_LIBRARY_PATH; \
358 echo "## Relax-NG Python based test suite 1" ; \
359 $(CHECKER) $(PYTHON) $(srcdir)/check-relaxng-test-suite.py ; \
360 echo "## Relax-NG Python based test suite 2" ; \
361 $(CHECKER) $(PYTHON) $(srcdir)/check-relaxng-test-suite2.py ; \
362 fi)
363
364SchemasPythonTests:
365 @(if [ -x $(PYTHON) ] ; then \
366 PYTHONPATH=$(top_builddir)/python:$(top_builddir)/python/.libs:$$PYTHONPATH; \
367 export PYTHONPATH; \
368 LD_LIBRARY_PATH="$(top_builddir)/.libs:$$LD_LIBRARY_PATH" ; \
369 export LD_LIBRARY_PATH; \
370 echo "## XML Schemas datatypes Python based test suite" ; \
371 echo "## It is normal to see 11 errors reported" ; \
372 $(CHECKER) $(PYTHON) $(srcdir)/check-xsddata-test-suite.py ; \
373 fi)
374 @(if [ -x $(PYTHON) -a -d xstc ] ; then cd xstc ; $(MAKE) CHECKER="$(CHECKER)" pytests ; fi)
375
376cleanup:
377 -@(find . -name .\#\* -exec rm {} \;)
378 -@(find . -name \*.gcda -o -name \*.gcno -exec rm -f {} \;)
379 -@(find . -name \*.orig -o -name \*.rej -o -name \*.old -exec rm -f {} \;)
380
381dist-hook: cleanup
382 (cd $(srcdir) ; tar -cf - --exclude .git win32 os400 vms test result) | (cd $(distdir); tar xf -)
383
384CLEANFILES = runsuite.log runxmlconf.log test.out *.gcda *.gcno *.res
385DISTCLEANFILES = COPYING missing.lst
386
387EXTRA_DIST = Copyright check-xml-test-suite.py gentest.py \
388 check-relaxng-test-suite.py check-relaxng-test-suite2.py \
389 check-xsddata-test-suite.py check-xinclude-test-suite.py \
390 example/Makefile.am example/gjobread.c example/gjobs.xml \
391 libxml2-config.cmake.in autogen.sh \
392 trionan.c trionan.h triostr.c triostr.h trio.c trio.h \
393 triop.h triodef.h libxml.h \
394 genUnicode.py \
395 dbgen.pl dbgenattr.pl \
396 libxml2.syms timsort.h \
397 README.zOS README.md \
398 CMakeLists.txt config.h.cmake.in libxml2-config.cmake.cmake.in
399
400
401pkgconfigdir = $(libdir)/pkgconfig
402pkgconfig_DATA = libxml-2.0.pc
403
404cmakedir = $(libdir)/cmake/libxml2
405cmake_DATA = libxml2-config.cmake
406
407#
408# Install the tests program sources as examples
409#
410examplesdir = $(docdir)/examples
411examples_DATA = xmllint.c
412
413tst: tst.c
414 $(CC) $(CFLAGS) -Iinclude -o tst tst.c .libs/libxml2.a -lpthread -lm -lz -llzma
415
416sparse: clean
417 $(MAKE) CC=cgcc
418
419#
420# Coverage support, largely borrowed from libvirt
421# Both binaries comes from the lcov package in Fedora
422#
423LCOV = /usr/bin/lcov
424GENHTML = /usr/bin/genhtml
425
426cov: clean-cov
427 if [ "`echo $(AM_LDFLAGS) | grep coverage`" = "" ] ; then \
428 echo not configured with coverage; exit 1 ; fi
429 if [ ! -x $(LCOV) -o ! -x $(GENHTML) ] ; then \
430 echo Need $(LCOV) and $(GENHTML) excecutables; exit 1 ; fi
431 -@($(MAKE) check)
432 -@(./runsuite$(EXEEXT))
433 mkdir $(top_builddir)/coverage
434 $(LCOV) -c -o $(top_builddir)/coverage/libxml2.info.tmp -d $(top_srcdir)
435 $(LCOV) -r $(top_builddir)/coverage/libxml2.info.tmp -o $(top_builddir)/coverage/libxml2.info *usr*
436 rm $(top_builddir)/coverage/libxml2.info.tmp
437 $(GENHTML) -s -t "libxml2" -o $(top_builddir)/coverage --legend $(top_builddir)/coverage/libxml2.info
438 echo "Coverage report is in $(top_builddir)/coverage/index.html"
439
440clean-cov:
441 rm -rf $(top_builddir)/coverage
442
Note: See TracBrowser for help on using the repository browser.

© 2023 Oracle
ContactPrivacy policyTerms of Use