1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2024-12-25 23:21:26 +03:00
Commit Graph

482 Commits

Author SHA1 Message Date
Nick Wellnhofer
82bd2c3736 python: Fix memory leak checks
xmlInitParser doesn't allocate memory anymore, so the checks can be
simplified.
2022-11-27 02:11:07 +01:00
Chun-wei Fan
707ade225c Visual Studio builds: Allow silencing deprecation warnings
Define XML_IGNORE_DEPRECATION_WARNINGS and the corresponding XML_POP_WARNINGS
for Visual Studio, and consequently define XML_IGNORE_FPTR_CAST_WARNINGS so
that we do not get a compiler warning on Visual Studio by doing a
__pragma(warning(pop)) without a corresponding __pragma(warning(push)).

Also correct the documentation a bit for XML_POP_WARNINGS.
2022-11-23 11:04:38 +08:00
Nick Wellnhofer
97c0a9cff7 tests: Fix use-after-free in Python tests
The nodeset must be freed before the document.

Fixes #443.
2022-11-22 17:01:39 +01:00
Chun-wei Fan
d7e698fca8 python/setup.py.in: Improve Windows import patching
Move up the altImport function so that we ensure that it can be referred
to and streamline it a bit, since we no longer attempt to build the
libxslt Python bits here, at least on Windows.
2022-11-21 12:01:03 +08:00
Nick Wellnhofer
ea8f7c92a9 autotools: Disable parallel Python build
Makefile rules with multiple output files don't work reliably with
parallel builds. There are several ways to fix this issue with GNU Make,
but they aren't portable. I'd be really interested in a totally
reliable, cross-platform solution to this problem.

.NOTPARALLEL is also understood by BSD make, at least.
2022-09-06 01:07:24 +02:00
Nick Wellnhofer
9d19c169bb python: Don't output missing generators during build 2022-09-06 01:07:24 +02:00
Nick Wellnhofer
ad6f10a81b Fix Python build on Windows
Build Python bindings with -no-undefined on Windows. Remove libs that
should already be set by PKG_CHECK_MODULE.
2022-09-04 18:36:04 +02:00
Nick Wellnhofer
0d90125859 Fix Windows compiler warnings in python/types.c 2022-09-04 18:36:04 +02:00
Nick Wellnhofer
71736b4e9a Fix libxml_PyFileGet
Broken in commit 75cdb6dd.
2022-09-04 18:36:04 +02:00
Nick Wellnhofer
513d65fee8 Use AM_CFLAGS and AM_LDFLAGS consistently 2022-09-02 18:33:36 +02:00
Nick Wellnhofer
75cdb6dd55 Fix unused variable warning in python/types.c 2022-09-02 18:33:36 +02:00
Nick Wellnhofer
ce8f3d1195 Fix libxml_PyFileGet with stdout on macOS
macOS returns O_RDWR for standard file descriptors, but fails to write
to stdout or stderr when opened with fdopen(dup_fd, "rw").
2022-08-30 00:10:05 +02:00
Nick Wellnhofer
b1a0961858 Migrate from PyEval_ to PyObject_
PyEval_ functions are deprecated.

Fixes #208.
2022-08-29 17:21:19 +02:00
Nick Wellnhofer
b0916e0e96 Also clean *.pyc files for Python 2 2022-08-26 17:57:58 +02:00
Nick Wellnhofer
58fc89e8a9 Deprecate internal parser functions 2022-08-25 21:04:57 +02:00
Nick Wellnhofer
a308c0cdf7 Deprecate old HTML SAX API 2022-08-25 21:04:57 +02:00
Nick Wellnhofer
51035c539e Generate deprecation warnings for old SAX API 2022-08-25 20:17:03 +02:00
Nick Wellnhofer
7f7961df25 Remove generated files from distribution
- libxml2.spec
- libxml-2.0.pc
- xml2-config
- include/libxml/xmlversion.h
- python/libxml2.py
- python/libxml2-export.c
- python/libxml2-py.c
- python/libxml2-py.h
- python/libxml2class.py
- python/libxml2class.txt
- python/setup.py
2022-08-25 14:35:31 +02:00
Nick Wellnhofer
75b5bc2b0a Deprecate some global variables
Most of these should be completely unused.
2022-08-24 00:31:10 +02:00
Nick Wellnhofer
d8f05db8f6 Fix Python tests on macOS 2022-06-20 01:49:38 +02:00
Nick Wellnhofer
670701075b Add configuration flag for XPointer locations support
Add a new configuration flag that controls whether the outdated support
for XPointer locations (ranges and points) is enabled.

    --with-xptr-locs          # Autotools
    LIBXML2_WITH_XPTR_LOCS    # CMake

The latest spec for what it essentially an XPath extension seems to be
this working draft from 2002:

    https://www.w3.org/TR/xptr-xpointer/

The xpointer() scheme is listed as "being reviewed" in the XPointer
registry since at least 2006. libxml2 seems to be the only modern
software that tries to implement this spec, but the code has many bugs
and quality issues.

The flag defaults to "off" and support for this extensions has to be
requested explicitly. The relevant API functions are deprecated.
2022-04-21 02:41:58 +02:00
Nick Wellnhofer
cacf65556c Fix compiler warnings in Python code
Add more deprecated functions to avoid compiler warnings when building
the Python bindings.
2022-04-13 16:43:15 +02:00
David Seifert
a62b31f43f
Use portable python shebangs
* In conda or Gentoo Prefix, we don't want to use the system python and
  instead rely on PATH lookup.
2022-04-06 19:57:30 +02:00
Nick Wellnhofer
3f74e42bae Simplify 'make check' targets 2022-04-04 05:41:51 +02:00
David Seifert
0137d9879b
python/tests: open() relative to test scripts 2022-03-30 22:00:50 +02:00
David Seifert
438209f3e1
python/Makefile.am: nest python docs in $(docdir) 2022-03-30 16:51:15 +02:00
David Seifert
9e30435358
python/Makefile.am: rely on global AM_INIT_AUTOMAKE
* Even Debian oldoldstable has Automake 1.15 available nowadays.
2022-03-30 16:51:14 +02:00
David Seifert
d9335077dd
Use AM_PATH_PYTHON/PKG_CHECK_MODULES for python bindings
* `AM_PATH_PYTHON` is a much more common idiom for building
  and installing python modules than writing your own.
* It also makes cross-compiling the python bindings possible.
  Previously the `PYTHON_CFLAGS`/`PYTHON_LIBS` would have been
  based on the `--build` python and not the `--host` python.
  By using `pkg-config`, we can always redirect the python-X.Y.pc.

Bug: https://bugs.gentoo.org/582130
2022-03-29 13:37:16 +02:00
Nick Wellnhofer
40483d0ce2 Deprecate module init and cleanup functions
These functions shouldn't be part of the public API. Most init
functions are only thread-safe when called from xmlInitParser. Global
variables should only be cleaned up by calling xmlCleanupParser.
2022-03-06 15:59:43 +01:00
Nick Wellnhofer
4a8c71eb7c Remove DOCBparser
This code has been broken and deprecated since version 2.6.0, released
in 2003. Because of a bug in commit 961b535c, DOCBparser.c was never
compiled since 2012. I couldn't find a Debian package using any of its
symbols, so it seems safe to remove this module.
2022-03-04 22:56:21 +01:00
Nick Wellnhofer
ebc5009793 Warn when using deprecated functions from Python bindings
This requires Python code to be run with -Wd.
2022-03-01 13:57:16 +01:00
Nick Wellnhofer
5bc5f0762f Fix build with older Python versions
ModuleNotFoundError is only available since Python 3.6. Use the
superclass ImportError instead. Fixes commit 3cc64a89.

Fixes #347.
2022-02-24 18:41:23 +01:00
Nick Wellnhofer
b057239b3f More fixes to --without-valid build
Fix runtest and Python bindings when building --without-valid.

The Python tests still fail. There doesn't seem to be a mechanism to
disable tests depending on feature flags.
2022-02-22 11:52:38 +01:00
Nick Wellnhofer
004fe9de53 Deprecate IDREF-related functions in valid.h
These functions are only needed internally for validation.

xmlGetRefs is inherently unsafe because the ref table isn't updated
if attributes are removed (unlike the ids table).

None of the Ubuntu 20.04 packages depending on libxml2 use any of these
functions (except xmlFreeRefTable in libxslt), so it seems perfectly
safe to deprecate them.

Remove xmlIsRef and xmlRemoveRef from the Python bindings.
2022-02-20 21:49:05 +01:00
Nick Wellnhofer
f2ad86fa60 Remove SVN keyword anchors 2022-02-17 19:05:26 +01:00
Nick Wellnhofer
1089111142 Redirect links to xmlsoft.org
Documentation and releases are now available on gitlab.gnome.org.
2022-02-13 23:10:00 +01:00
Chun-wei Fan
3cc64a88d4 setup.py.in: Try to import setuptools
This way, we can build binary wheels easily if needed
2022-01-16 15:18:06 +01:00
Chun-wei Fan
dbfe6151ff Python distutils: Make DLL packaging more flexible
This updates setup.py.in to pack the DLLs according to the options we specified
to configure.js or CMake (or, even configure, although autotools builds are not
likely to build the libxml2 Python module via distutils).

At this point, we can pack only the DLLs that libxml2 really depends on, and
pack the libxslt DLLs only if we really built the libxslt Python modules.

Also make the DLL filenames more easily configured
2022-01-16 15:18:06 +01:00
Chun-wei Fan
1b7d4e2bcc tstmem.py: Try importing from libxmlmods.libxml2mod if needed
Distutils builds place libxml2mod.pyd under the libxmlmods subdir, so try this
directory if 'import libxml2mod' failed.
2022-01-16 15:18:06 +01:00
Chun-wei Fan
6e169c1490 python: Port python 3.x module to Windows
On Windows, we don't have fcntl() which helps us to find out how a file was
opened, so we need to resort to the Windows API NtQueryInformationFile() in
ntdll.dll to help us, and compare the file access modes as appropriate to
deduce the modes we want to pass into fdopen().

As all official Python 3.x releases are built against newer Windows CRTs that
toughen checks on the validity of the file descriptor when we convert the fd to
a native Windows File Handle using _get_osfhandle(), we need to define an empty
handler so that the program does not abort if the fd that was passed in was
invalid; instead, we just return NULL if _get_osfhandle() could not return us a
valid Windows File Handle.
2022-01-16 15:18:06 +01:00
David King
9a9dd31ba6 Fix memory leak in libxml_C14NDocSaveTo
Found by Coverity.

https://bugzilla.redhat.com/show_bug.cgi?id=1938806
2022-01-16 14:22:26 +01:00
David King
d68c163723 Fix memory leak in libxml_saveNodeTo
Found by Coverity.

https://bugzilla.redhat.com/show_bug.cgi?id=1938806
2022-01-16 14:20:57 +01:00
Sam James
a0f9211b52 python/Makefile.am: use *_LIBADD, not *_LDFLAGS for LIBS
This fixes over-linking in the built Python modules with various libraries.

*_LIBADD is intended for adding additional libraries for linking, while
*_LDFLAGS is for miscellaneous extra flags (possibly user-supplied).

If using -Wl,-as-needed within user-supplied LDFLAGS, it is passed too
late (after the library link line) and therefore has no effect.

Notes:

* Noticed while working on Gentoo's migration to libxcrypt because
libxml2's Python modules were linking to libcrypt (and other libraries)
unexpectedly.

* It was suggested we could actually stop linking explicitly with all
of Python's libraries / don't copy its LDFLAGS, but this resolves
the original issue downstream and is a separate discussion. I couldn't
find any clear documentation for/against such a change.

Bug: https://bugs.gentoo.org/798942
Signed-off-by: Sam James <sam@gentoo.org>
2022-01-16 13:58:43 +01:00
Nick Wellnhofer
de5b624f10 Fix handling of unexpected EOF in xmlParseContent
Readd the XML_ERR_TAG_NOT_FINISHED error on unexpected EOF which was
removed in commit 62150ed2.

This commit also introduced a regression for direct users of
xmlParseContent. Unclosed tags weren't checked.
2021-05-08 20:47:36 +02:00
Nick Wellnhofer
3e80560d4b Fix line numbers in error messages for mismatched tags
Commit 62150ed2 introduced a small regression in the error messages for
mismatched tags. This typically only affected messages after the first
mismatch, but with custom SAX handlers all line numbers would be off.

This also fixes line numbers in the SAX push parser which were never
handled correctly.
2021-05-07 11:48:11 +02:00
Victor Stinner
ac5e99911a Convert python/libxml.c to PY_SSIZE_T_CLEAN
Define PY_SSIZE_T_CLEAN macro in python/libxml.c and cast the string
length (int len) explicitly to Py_ssize_t when passing a string to a
function call using PyObject_CallMethod() with the "s#" format.
2020-11-19 18:09:22 +01:00
Victor Stinner
f42a0524c6 Build the Python extension with PY_SSIZE_T_CLEAN
The Python extension module now uses Py_ssize_t rather than int for
string lengths. This change makes the extension compatible with
Python 3.10.

Fixes #203.
2020-11-19 18:09:22 +01:00
Miro Hrončok
e4fb368418 Parenthesize Py<type>_Check() in ifs
In C, if expressions should be parenthesized.
PyLong_Check, PyUnicode_Check etc. happened to expand to a parenthesized
expression before, but that's not API to rely on.

Since Python 3.9.0a4 it needs to be parenthesized explicitly.

Fixes https://gitlab.gnome.org/GNOME/libxml2/issues/149
2020-03-10 14:21:27 +01:00
Nick Wellnhofer
20c60886e4 Fix typos
Resolves #133.
2020-03-08 17:41:53 +01:00
Pieter van Oostrum
8f62ac92b2 Updated Python test reader2.py
Added all test cases that have a non-empty error in result/valid/*.xml.err
Restructured to make it easier extensible with new test cases
Added coding cookie because there is non-ASCII in the error messages
2020-01-02 13:50:10 +01:00
Pieter van Oostrum
8c3e52ebd9 Updated python/tests/tstLastError.py
libxml2.registerErrorHandler(None,None):
None is not acceptable as first argument
failUnlessEqual replaced by assertEqual
2020-01-02 13:49:31 +01:00
Nick Wellnhofer
d188eb921a Make sure that Python tests exit with error code
Closes #108.
2019-10-21 12:45:37 +02:00
Jared Yanovich
2a350ee9b4 Large batch of typo fixes
Closes #109.
2019-09-30 18:04:38 +02:00
Nick Wellnhofer
9d461ac7d0 Adjust expected error in Python tests
Closes #107.
2019-09-26 16:17:31 +02:00
Nick Wellnhofer
7f40ed01f7 Fix Python bindings under Windows
- Correct linker flags for MinGW-w64
- Adjust PATH to find libxml2.dll when running tests
2019-01-06 14:32:28 +01:00
Patrick Welche
d910e99c32 python: remove single use of _PyVerify_fd
_PyVerify_fd disappeared from python with:

  https://hg.python.org/cpython/rev/e88e2049b793

https://bugzilla.gnome.org/show_bug.cgi?id=776815
2018-03-05 16:29:58 +01:00
Nick Wellnhofer
0c91391683 Remove generated file python/setup.py from version control 2017-10-07 15:22:57 +02:00
Daniel Veillard
4b4d3d8516 Release of libxml2-2.9.6
* configure.ac doc/xml.html doc/news.html: updated for release
2017-10-06 09:00:53 +02:00
Daniel Veillard
2960178fe8 Release of libxml2-2.9.5
* configure.ac, doc/xslt.html: updated for the release
* doc/*, python/setup.py, testapi.c: regenerated
2017-09-04 15:38:47 +02:00
Patrick Monnerat
d1f9062486 small changes for OS/400
OS/400 version V5R3 is not supported by IBM anymore.
In addition, the iSeries system I have here for development has been changed
and the new system is not able to compile for an OS version lower than V6R1.

Thus I made some updates to the libxml2 os400 scripts accordingly:

- Oldest supported OS version is now V6R1.
- Adjust ILE/RPG wrappers comments.
- Update copyright year range.
- Do not log compiler informational messages.
2017-07-27 11:20:02 +08:00
Nick Wellnhofer
83212ff4be Fix expected error output in Python tests 2017-06-01 14:31:28 +02:00
Daniel Veillard
8effcb578e Fix apibuild for a recently added construct
commit c71f9305a9 added __XML_EXTERNC
cpp construct which not understood by apibuild, leading to make dist
failures, ask to ignore that construct.
2016-05-09 10:31:09 +08:00
Jan Pokorný
bb654feb9a Fix typos: dictio{ nn -> n }ar{y,ies}
Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
2016-04-15 22:22:48 +08:00
Michael Stahl
65112cb36a python 3: libxml2.c wrappers create Unicode str already
... so stop decoding these, which only results in
"TypeError: 'str' does not support the buffer interface".
2016-03-11 16:18:13 +08:00
Daniel Veillard
6657afe83a Release of libxml2-2.9.3
* configure.ac: updated
* doc/*: regenerated
2015-11-20 17:55:11 +08:00
Daniel Veillard
726f67e2f1 Release of libxml2-2.9.2 2014-10-16 15:40:16 +08:00
Roumen Petrov
c2450d8ba3 fix some tabs mixing incompatible with python3 2014-10-16 11:46:35 +08:00
Daniel Veillard
af62eb4fab Python generator bug raised by the const change
the doc methode for xmlDocGetRootElement wasn't generated anymore
2014-10-13 16:40:56 +08:00
John Beck
6bea543eca python/tests/sync.py assumes Python dictionaries are ordered
For https://bugzilla.gnome.org/show_bug.cgi?id=734017

Solaris has had libxml2 version 2.9.1 for a while, with Python versions 2.6 and
2.7.  While preparing to also build a module for Python 3.4, we ran into an
issue with the test case sync.py failing. The failure involved parsing a
string that included a Python dictionary, then complaining when the order of
the parsed result did not match the original order.  But Python dictionaries
are unordered by definition; see section 5.5 of
https://docs.python.org/2/tutorial/datastructures.html .  For whatever reason,
Python 2.6 and 2.7 always happened to report the pair of values back in their
original order, but with Python 3.4 the order is random.  The attached patch
allows for either order; it also fixes a typo that was repeated several times
thanks to the magic of copy & paste.
2014-10-06 18:26:27 +08:00
Ron Angeles
b3e488b0d9 Add methods for python3 iterator
xmlCoreDepthFirstItertor and xmlCoreBreadthFirstItertr only
implement a python2-compatible iterator interface. The next()
method has been changed to __next__(). An alias has been
defined to keep python2 compatibility.
2014-10-03 17:01:24 +08:00
Daniel Veillard
4b61cf61e7 fix some tabs mixing incompatible with python3
Patrick Welche <prlw1@cam.ac.uk> raised this issue
2013-10-02 22:18:21 +08:00
Arfrever Frehtes Taifersar Arahesis
6dd7775f35 Another round of fixes for older versions of Python 2013-07-12 11:18:11 +08:00
Alexandre Rostovtsev
6c9c611bee python: fix drv_libxml2.py for python3 compatibility
https://bugzilla.gnome.org/show_bug.cgi?id=703979
2013-07-11 15:16:02 +08:00
Armin K
6eea2f2c60 python: Fix compiler warnings when building python3 bindings 2013-06-03 22:03:28 +02:00
Petr Sumbera
722923bc9b Fix for compilation with python 2.6.8
Remap PyCapsule to PyCObject based on the macro being available
instead of using the python version
2013-05-03 22:25:38 +08:00
dcb
10ec19ab0a Fix missing break on last() function for attributes
pointed out by cppcheck
2013-05-02 16:11:46 +08:00
Daniel Veillard
f4e5a6994e Release of libxml2-2.9.1
* configure.in: bumped version
* doc/*: updated the symbols file and regenerated
2013-04-19 15:36:36 +08:00
Daniel Veillard
c0a8dd14f8 Fix a linking error for python bindings
Showing up apparently in Debian BTS distro
https://bugzilla.gnome.org/show_bug.cgi?id=685515
2013-04-19 15:02:33 +08:00
Daniel Veillard
bf4a8f0ea8 Fix python bindings with versions older than 2.7
Need fixing on the Capsule usage, the lack of PyBytes,
lack of io module and the way to access exception details.
2013-04-02 10:27:57 +08:00
Daniel Veillard
87f3287d9b Fix tree iterators broken by 2to3 script 2013-04-01 13:33:42 +08:00
Daniel Veillard
2cb6bf8eb0 update all tests for Python3 and Python2 2013-03-30 22:33:06 +08:00
Daniel Veillard
6f18465189 A few more fixes for python 3 affecting libxml2.py
need a few changes to the generator and the libxml.py stub
2013-03-30 22:33:06 +08:00
Daniel Veillard
3798c4adbb Fix compilation on Python3
while still compiling on recent Python2:
  - change the handling of files, tweak the generator, get the fd
    instead of the FILE *, dup it and fdopen based on mode, add a
    Release function on Python3 and call to flush from the generated
    python stubs
  - switch to using Capsules instead of CObjects
  - fix PyString to PyBytes
  - fix PyInt to PyLong
  - tweak the module registration to compile on both versions
  - drop PyInstance check for passed xmlNodes and instead check
    attributes presence

Daniel
2013-03-30 22:33:06 +08:00
Daniel Veillard
3cb1ae26ec First pass at starting porting to python3 2013-03-30 22:33:06 +08:00
Daniel Veillard
a5e513a552 Fix a uneeded and wrong extra link parameter 2013-03-30 22:33:06 +08:00
Shaun McCance
519bc6a3ab Add support for xpathRegisterVariable in Python 2013-03-27 15:55:36 +08:00
Alexey Neyman
d749528aa9 Silent the new python test on input
Just make it silent if there is no error
2013-02-27 13:11:47 +08:00
Alexey Neyman
a9016c4927 Fix a few problems with setEntityLoader
1. Setting entity loader does not increment the refcount on the Python object
passed in. This works only if the object is not deleted. For example, the
following code results in segmentation fault in Python interpreter when
attempting to process any document:

[[[
def register_entity_loader():
    def entity_loader(URL, ID, ctxt):
        ...
    libxml2.setEntityLoader(entity_loader

register_entity_loader()
]]]

2. setEntityLoader() does not verify if the passed object is callable. If it
is not, current implementation attempts to call it anyway and failing that,
silently moves on to default entity loader. Attached patch makes
setEntityLoader raise ValueError exception if non-callable object is
passed.

3. In debug mode, pythonExternalEntityLoader() outputs the result object to
stderr, while the messages before and after the object (description + newline)
go to stdout. Attached patch makes them all go to stdout.
2013-02-25 16:07:09 +08:00
Alexey Neyman
48da90bc4a Python binding for xmlRegisterInputCallback
It is possible to make xmlIO handle any protocol by means of
xmlRegisterInputCallback(). However, that function is currently only
available in C API. So, the natural solution seems to be implementing Python
bindings for the xmlRegisterInputCallback.

* python/generator.py: skip xmlPopInputCallbacks
* python/libxml.c python/libxml.py python/libxml_wrap.h: implement the
  wrappers
* python/tests/input_callback.py python/tests/Makefile.am: also add a test case
2013-02-25 15:54:25 +08:00
Alexey Neyman
e32ceb93f4 Python bindings: DOM casts everything to xmlNode
I noticed another issue with Python bindings of libxml: the access methods do
not cast the pointers to specific classes such as xmlDtd, xmlEntityDecl, etc.
For example, with the following document:

<?xml version="1.0"?>
<!DOCTYPE root [<!ELEMENT root EMPTY>]>
<root/>

the following script:

import libxml2
doc = libxml2.readFile("c.xml", None, libxml2.XML_PARSE_DTDLOAD)
print repr(doc.children)

prints:

<xmlNode (root) object at 0xb74963ec>

With properly cast nodes, it outputs the following:

<xmlDtd (root) object at 0xb746352c>

The latter object (xmlDtd) enables one to use DTD-specific methods such as
debugDumpDTD(), copyDTD(), and so on.
2013-02-21 16:00:03 +08:00
Daniel Veillard
f8e3db0445 Big space and tab cleanup
Remove all space before tabs and space and tabs at end of lines.
2012-09-11 13:26:36 +08:00
Csaba Raduly
429d3a0aae Allow to set the quoting character of an xmlWriter
It's otherwise impossible to set the quoting character of
attribute values of an xmlWriter.
2012-09-11 11:52:46 +08:00
Daniel Veillard
857104cd49 Remove all .cvsignore as they are not used anymore
For https://bugzilla.gnome.org/show_bug.cgi?id=682985
suggested by Adrian Bunk <bunk@stusta.de>
2012-09-04 14:25:23 +08:00
Akira TAGOH
961b535c10 Bug 676544 - fails to build with --without-sax1
Added some ifdef'd LIBXML_SAX1_ENABLED to make it buildable with
--without-sax1 configure option.
2012-08-28 22:03:16 +08:00
Daniel Richard G
d10a72ce8c Bundles all generated files for python into the distribution
So end users building the Python module don't need to
regenerate any source files. some clean-up too.
2012-08-14 12:50:25 +08:00
Roumen Petrov
c3b1d09ba2 clean redefinition of {v}snprintf in C-source
as those from *config.h are preferable (e.g. win32config.h)
2012-08-13 16:57:30 +08:00
Daniel Veillard
aa017c54dd Release candidate 1 of libxml2-2.9.0
* configure.in libxml.spec.in python/setup.py: bumped release numbers
* doc//*: regenerated as part of the release
2012-08-10 10:42:56 +08:00
Daniel Richard G
5d6c02ba61 Various "make distcheck" and portability fixups 2nd part
doc/examples/Makefile.am:

* Use $(VAR), not @VAR@

* Use $(MKDIR_P) instead of $(mkinstalldirs), as the latter is an
* obsolete
  name

* Added $(srcdir) qualification to the various test program invocations
* in
  the "tests" target. More work is needed here (notably, when the
  reference output contains the path to the input file), but this gets
  things a lot closer to working correctly in an out-of-source build.

doc/examples/reader4.res:

* Added "./" path qualifiers so that the reader4 test continues to pass
  cleanly for in-source builds

python/tests/Makefile.am:

* Symlink in test input files for out-of-source builds
2012-08-07 10:05:34 +08:00
Daniel Richard G
5706b6d876 Various "make distcheck" and portability fixups
Makefile.am:

* Don't use @VAR@, use $(VAR). Autoconf's AC_SUBST provides us the Make
   variable, it allows overriding the value at the command line, and
   (notably) it avoids a Make parse error in the libxml2_la_LDFLAGS
   assignment when @MODULE_PLATFORM_LIBS@ is empty

* Changed how the THREADS_W32 mechanism switches the build between
   testThreads.c and testThreadsWin32.c as appropriate; using AM_CONDITIONAL
   allows this to work cleanly and plays well with dependencies

* testapi.c should be specified as BUILT_SOURCES

* Create symlinks to the test/ and result/ subdirs so that the runtests
   target is usable in out-of-source-tree builds

* Don't do MAKEFLAGS+=--silent as this is not portable to non-GNU Makes

* Fixed incorrect find(1) syntax in the "cleanup" rule, and doing "rm -f"
   instead of just "rm" is good form

* (DIST)CLEANFILES needed a bit more coverage to allow "make distcheck" to
   pass

configure.in:

* Need AC_PROG_LN_S to create test/ and result/ symlinks in Makefile.am

* AC_LIBTOOL_WIN32_DLL and AM_PROG_LIBTOOL are obsolete; these have been
   superceded by LT_INIT

* Don't rebuild docs by default, as this requires GNU Make (as
   implemented)

* Check for uint32_t as some platforms don't provide it

* Check for some more functions, and undefine HAVE_MMAP if we don't also
   HAVE_MUNMAP (one system I tested on actually needed this)

* Changed THREADS_W32 from a filename insert into an Automake conditional

* The "Copyright" file will not be in the current directory if builddir !=
   srcdir

doc/Makefile.am:

* EXTRA_DIST cannot use wildcards when they refer to generated files; this
   breaks dependencies. What I did was define EXTRA_DIST_wc, which uses GNU
   Make $(wildcard) directives to build up a list of files, and EXTRA_DIST,
   as a literal expansion of EXTRA_DIST_wc. I also added a new rule,
   "check-extra-dist", to simplify checking that the two variables are
   equivalent. (Note that this works only when builddir == srcdir)

   (I can implement this differently if desired; this is just one way of
   doing it)

* Don't define an "all" target; this steps on Automake's toes

* Fixed up the "libxml2-api.xml ..." rule by using $(wildcard) for
   dependencies (as Make doesn't process the wildcards otherwise) and
   qualifying appropriate files with $(srcdir)

   (Note that $(srcdir) is not needed in the dependencies, thanks to VPATH,
   which we can count on as this is GNU-Make-only code anyway)

doc/devhelp/Makefile.am:

* Qualified appropriate files with $(srcdir)

* Added an "uninstall-local" rule so that "make distcheck" passes

doc/examples/Makefile.am:

* Rather than use a wildcard that doesn't work, use a substitution that
   most Make programs can handle

doc/examples/index.py:

* Do the same here

include/libxml/nanoftp.h:

* Some platforms (e.g. MSVC 6) already #define INVALID_SOCKET:

     user@host:/cygdrive/c/Program Files/Microsoft Visual Studio/VC98/\
     Include$ grep -R INVALID_SOCKET .
     ./WINSOCK.H:#define INVALID_SOCKET  (SOCKET)(~0)
     ./WINSOCK2.H:#define INVALID_SOCKET  (SOCKET)(~0)

include/libxml/xmlversion.h.in:

* Support ancient GCCs (I was actually able to build the library with 2.5
   but for this bit)

python/Makefile.am:

* Expanded CLEANFILES to allow "make distcheck" to pass

python/tests/Makefile.am:

* Define CLEANFILES instead of a "clean" rule, and added tmp.xml to allow
   "make distcheck" to pass

testRelax.c:

* Use HAVE_MMAP instead of the less explicit HAVE_SYS_MMAN_H (as some
   systems have the header but not the function)

testSchemas.c:

* Use HAVE_MMAP instead of the less explicit HAVE_SYS_MMAN_H

testapi.c:

* Don't use putenv() if it's not available

threads.c:

* This fixes the following build error on Solaris 8:

     libtool: compile:  cc -DHAVE_CONFIG_H -I. -I./include -I./include \
     -D_REENTRANT -D__EXTENSIONS__ -D_REENTRANT -Dsparc -Xa -mt -v \
     -xarch=v9 -xcrossfile -xO5 -c threads.c  -KPIC -DPIC -o threads.o
     "threads.c", line 442: controlling expressions must have scalar type
     "threads.c", line 512: controlling expressions must have scalar type
     cc: acomp failed for threads.c
     *** Error code 1

trio.c:

* Define isascii() if the system doesn't provide it

trio.h:

* The trio library's HAVE_CONFIG_H header is not the same as LibXML2's
   HAVE_CONFIG_H header; this change is needed to avoid a double-inclusion

win32/configure.js:

* Added support for the LZMA compression option

win32/Makefile.{bcb,mingw,msvc}:

* Added appropriate bits to support WITH_LZMA=1

* Install the header files under $(INCPREFIX)\libxml2\libxml instead of
   $(INCPREFIX)\libxml, to mirror the install location on Unix+Autotools

xml2-config.in:

* @MODULE_PLATFORM_LIBS@ (usually "-ldl") needs to be in there in order for
   `xml2-config --libs` to provide a complete set of dependencies

xmllint.c:

* Use HAVE_MMAP instead of the less-explicit HAVE_SYS_MMAN_H
2012-08-06 11:32:54 +08:00
Daniel Veillard
c943f708f1 Release of libxml2-2.8.0
- Makefile.am: don't package .git
- configure.in : update to new release
- doc/xml.html: added the new release
- doc/* testapi.c: regenerated
2012-05-23 17:10:59 +08:00