diff options
author | DongHun Kwak <dh0128.kwak@samsung.com> | 2022-09-13 11:22:24 +0900 |
---|---|---|
committer | DongHun Kwak <dh0128.kwak@samsung.com> | 2022-09-13 11:22:24 +0900 |
commit | f2b1186ae61291c1c33777000254ff664623f18e (patch) | |
tree | ba0fc9959a1c435c0c92f6367b1a9f4243fd6426 /python | |
parent | aee72dbc8a3bc08ead76cb808ffa332aa413f2d7 (diff) | |
download | libxslt-f2b1186ae61291c1c33777000254ff664623f18e.tar.gz libxslt-f2b1186ae61291c1c33777000254ff664623f18e.tar.bz2 libxslt-f2b1186ae61291c1c33777000254ff664623f18e.zip |
Imported Upstream version 1.1.36upstream/1.1.36
Diffstat (limited to 'python')
-rw-r--r-- | python/Makefile.am | 51 | ||||
-rwxr-xr-x | python/generator.py | 2 | ||||
-rw-r--r-- | python/libxslt.c | 1 | ||||
-rw-r--r-- | python/tests/Makefile.am | 24 | ||||
-rwxr-xr-x | python/tests/basic.py | 2 | ||||
-rwxr-xr-x | python/tests/exslt.py | 2 | ||||
-rw-r--r-- | python/tests/extelem.py | 2 | ||||
-rwxr-xr-x | python/tests/extfunc.py | 2 | ||||
-rwxr-xr-x | python/tests/pyxsltproc.py | 2 | ||||
-rw-r--r-- | python/types.c | 3 |
10 files changed, 28 insertions, 63 deletions
diff --git a/python/Makefile.am b/python/Makefile.am index 17a0d17c..24ede9c3 100644 --- a/python/Makefile.am +++ b/python/Makefile.am @@ -1,13 +1,6 @@ # Makefile for libxml2 python library -AUTOMAKE_OPTIONS = 1.4 foreign -SUBDIRS= . tests - -AM_CFLAGS = $(LIBXML_CFLAGS) - -DOCS_DIR = $(datadir)/doc/libxslt-python-$(LIBXSLT_VERSION) -# libxsltclass.txt is generated -DOCS= +SUBDIRS = . tests EXTRA_DIST = \ libxslt.c \ @@ -16,54 +9,44 @@ EXTRA_DIST = \ libxml_wrap.h \ libxslt_wrap.h \ libxsl.py \ - libxslt-python-api.xml \ - $(DOCS) - -libxsltmod_la_LDFLAGS = -module -avoid-version + libxslt-python-api.xml if WITH_PYTHON -mylibs = \ - $(top_builddir)/libxslt/libxslt.la \ - $(top_builddir)/libexslt/libexslt.la - -all-local: libxslt.py -python_LTLIBRARIES = libxsltmod.la +pyexec_LTLIBRARIES = libxsltmod.la libxsltmod_la_CPPFLAGS = \ - -I$(PYTHON_INCLUDES) \ -I$(top_srcdir)/libxslt \ -I$(top_srcdir) \ - -I../libexslt + -I../libexslt \ + $(PYTHON_CFLAGS) $(LIBXML_CFLAGS) libxsltmod_la_SOURCES = libxslt.c types.c nodist_libxsltmod_la_SOURCES = libxslt-py.c -libxsltmod_la_LIBADD = $(mylibs) $(PYTHON_LIBS) +libxsltmod_la_LIBADD = \ + $(top_builddir)/libxslt/libxslt.la \ + $(top_builddir)/libexslt/libexslt.la \ + $(PYTHON_LIBS) $(LIBXML_LIBS) +libxsltmod_la_LDFLAGS = -module -avoid-version libxslt.py: $(srcdir)/libxsl.py libxsltclass.py cat $(srcdir)/libxsl.py libxsltclass.py > $@ -install-data-local: - $(MKDIR_P) $(DESTDIR)$(pythondir) - $(INSTALL) -m 0644 libxslt.py $(DESTDIR)$(pythondir) - $(MKDIR_P) $(DESTDIR)$(DOCS_DIR) - @(for doc in $(DOCS) ; \ - do $(INSTALL) -m 0644 $(srcdir)/$$doc $(DESTDIR)$(DOCS_DIR) ; done) - -uninstall-local: - rm -f $(DESTDIR)$(pythondir)/libxslt.py - rm -rf $(DESTDIR)$(DOCS_DIR) +python_PYTHON = libxslt.py GENERATE = generator.py API_DESC = $(top_srcdir)/doc/libxslt-api.xml $(srcdir)/libxslt-python-api.xml -GENERATED= libxsltclass.py \ +GENERATED = libxsltclass.py \ libxslt-export.c \ libxslt-py.c \ libxslt-py.h \ libxsltclass.txt +# Generated sources +all-local: libxslt.py + $(GENERATED): gen_prog -gen_prog: $(srcdir)/$(GENERATE) $(API_DESC) +gen_prog: $(srcdir)/$(GENERATE) $(API_DESC) SRCDIR=$(srcdir) $(PYTHON) $(srcdir)/$(GENERATE) touch gen_prog @@ -74,4 +57,4 @@ endif tests test: all cd tests && $(MAKE) tests -CLEANFILES= $(GENERATED) *.o libxslt.so *.pyc libxslt.py gen_prog +CLEANFILES = $(GENERATED) *.o libxslt.so *.pyc libxslt.py gen_prog diff --git a/python/generator.py b/python/generator.py index df9fecec..025e58a1 100755 --- a/python/generator.py +++ b/python/generator.py @@ -1,4 +1,4 @@ -#!/usr/bin/python -u +#!/usr/bin/env python # # generate python wrappers from the XML API description # diff --git a/python/libxslt.c b/python/libxslt.c index 685e49d1..353939e3 100644 --- a/python/libxslt.c +++ b/python/libxslt.c @@ -1279,7 +1279,6 @@ void initlibxsltmod(void) { * Specific XSLT initializations */ libxslt_xsltErrorInitialize(); - xmlInitMemory(); xmlLoadExtDtdDefaultValue = XML_DETECT_IDS | XML_COMPLETE_ATTRS; xmlDefaultSAXHandler.cdataBlock = NULL; /* diff --git a/python/tests/Makefile.am b/python/tests/Makefile.am index cb186745..c633ce66 100644 --- a/python/tests/Makefile.am +++ b/python/tests/Makefile.am @@ -1,23 +1,13 @@ -EXAMPLE_DIR = $(datadir)/doc/libxslt-python-$(LIBXSLT_VERSION)/examples - -TESTSPY= \ +if WITH_PYTHON +TESTSPY = \ basic.py \ exslt.py \ extelem.py \ extfunc.py -XMLS= \ - test.xml \ - test.xsl - -EXTRAS= \ - pyxsltproc.py +exampledir = $(docdir)/python/examples +dist_example_DATA = test.xml test.xsl pyxsltproc.py $(TESTSPY) -EXTRA_DIST = $(TESTSPY) $(XMLS) $(EXTRAS) - -CLEANFILES = *.pyc core - -if WITH_PYTHON tests: $(TESTSPY) @(PYTHONPATH="`pwd`/..:`pwd`/../.libs:$(srcdir)/.."; \ if test "x$(LIBXML_SRC)" != "x" ; then \ @@ -32,8 +22,4 @@ else tests: endif -install-data-local: - $(MKDIR_P) $(DESTDIR)$(EXAMPLE_DIR) - -(for test in $(TESTSPY) $(XMLS) $(EXTRAS); \ - do $(INSTALL) -m 0644 $(srcdir)/$$test $(DESTDIR)$(EXAMPLE_DIR) ; done) - +CLEANFILES = *.pyc core diff --git a/python/tests/basic.py b/python/tests/basic.py index 7d9f9867..46355de7 100755 --- a/python/tests/basic.py +++ b/python/tests/basic.py @@ -1,4 +1,4 @@ -#!/usr/bin/python -u +#!/usr/bin/env python import sys import libxml2 # Memory debug specific diff --git a/python/tests/exslt.py b/python/tests/exslt.py index de5e42bf..b859d187 100755 --- a/python/tests/exslt.py +++ b/python/tests/exslt.py @@ -1,4 +1,4 @@ -#!/usr/bin/python -u +#!/usr/bin/env python import sys import libxml2 # Memory debug specific diff --git a/python/tests/extelem.py b/python/tests/extelem.py index 0e1bf4bf..2528a399 100644 --- a/python/tests/extelem.py +++ b/python/tests/extelem.py @@ -1,4 +1,4 @@ -#!/usr/bin/python -u +#!/usr/bin/env python import sys import string import libxml2 diff --git a/python/tests/extfunc.py b/python/tests/extfunc.py index a775494a..0853a55e 100755 --- a/python/tests/extfunc.py +++ b/python/tests/extfunc.py @@ -1,4 +1,4 @@ -#!/usr/bin/python -u +#!/usr/bin/env python import sys import string import libxml2 diff --git a/python/tests/pyxsltproc.py b/python/tests/pyxsltproc.py index 43108c23..f2469243 100755 --- a/python/tests/pyxsltproc.py +++ b/python/tests/pyxsltproc.py @@ -1,4 +1,4 @@ -#!/usr/bin/python -u +#!/usr/bin/env python # # The exercise of rewriting xsltproc on top of the python # bindings, not complete yet and shows up the things missing diff --git a/python/types.c b/python/types.c index 583b2929..1617cb96 100644 --- a/python/types.c +++ b/python/types.c @@ -491,9 +491,6 @@ libxml_xmlXPathObjectPtrWrap(xmlXPathObjectPtr obj) case XPATH_STRING: ret = PY_IMPORT_STRING((char *) obj->stringval); break; - case XPATH_POINT: - case XPATH_RANGE: - case XPATH_LOCATIONSET: default: #ifdef DEBUG printf("Unable to convert XPath object type %d\n", obj->type); |