mirror of
https://gitlab.gnome.org/GNOME/libxslt
synced 2025-07-31 02:43:06 +03:00
Fixed the python Makefiles, corrected a bug showing up on ia64, changed
* configure.in libxslt.spec.in python/Makefile.am python/generator.py python/libxsl.py python/libxslt.c python/tests/Makefile.am: Fixed the python Makefiles, corrected a bug showing up on ia64, changed the name of the python internal module too Daniel
This commit is contained in:
@ -1,3 +1,10 @@
|
|||||||
|
Sat Feb 9 19:04:01 CET 2002 Daniel Veillard <daniel@veillard.com>
|
||||||
|
|
||||||
|
* configure.in libxslt.spec.in python/Makefile.am python/generator.py
|
||||||
|
python/libxsl.py python/libxslt.c python/tests/Makefile.am:
|
||||||
|
Fixed the python Makefiles, corrected a bug showing up on ia64,
|
||||||
|
changed the name of the python internal module too
|
||||||
|
|
||||||
Fri Feb 8 17:01:10 CET 2002 Daniel Veillard <daniel@veillard.com>
|
Fri Feb 8 17:01:10 CET 2002 Daniel Veillard <daniel@veillard.com>
|
||||||
|
|
||||||
* Copyright Makefile.am configure.in libxslt.spec.in: change the
|
* Copyright Makefile.am configure.in libxslt.spec.in: change the
|
||||||
|
@ -152,14 +152,14 @@ if test "$with_python" != "no" ; then
|
|||||||
echo Found Python version $PYTHON_VERSION
|
echo Found Python version $PYTHON_VERSION
|
||||||
LIBXML2_PYTHON=`python -c "try : import libxml2 ; print 1
|
LIBXML2_PYTHON=`python -c "try : import libxml2 ; print 1
|
||||||
except: print 0"`
|
except: print 0"`
|
||||||
if test "$LIBXML2_PYTHON" == "1"
|
if test "$LIBXML2_PYTHON" = "1"
|
||||||
then
|
then
|
||||||
echo Found libxml2-python module
|
echo Found libxml2-python module
|
||||||
else
|
else
|
||||||
echo Missing libxml2-python
|
echo Missing libxml2-python
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
if test "$PYTHON_VERSION" != "" -a "$LIBXML2_PYTHON" == "1"
|
if test "$PYTHON_VERSION" != "" -a "$LIBXML2_PYTHON" = "1"
|
||||||
then
|
then
|
||||||
if test -r $with_python/include/python$PYTHON_VERSION/Python.h -a \
|
if test -r $with_python/include/python$PYTHON_VERSION/Python.h -a \
|
||||||
-d $with_python/lib/python$PYTHON_VERSION/site-packages
|
-d $with_python/lib/python$PYTHON_VERSION/site-packages
|
||||||
@ -342,7 +342,7 @@ if test "${LOGNAME}" = "veillard" -a "`pwd`" = "/u/veillard/XSLT" ; then
|
|||||||
LIBXML_LIBS="../../XML/.libs/libxml2.a -lz"
|
LIBXML_LIBS="../../XML/.libs/libxml2.a -lz"
|
||||||
DV_LINK="1"
|
DV_LINK="1"
|
||||||
XSLTPROCDV="xsltproc.dv"
|
XSLTPROCDV="xsltproc.dv"
|
||||||
PYTHONSODV="_libxslt.so.dv"
|
# PYTHONSODV="libxsltmod.so.dv"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
AC_SUBST(XSLTPROCDV)
|
AC_SUBST(XSLTPROCDV)
|
||||||
|
@ -10,6 +10,7 @@ URL: http://xmlsoft.org/XSLT/
|
|||||||
Requires: libxml2 >= @LIBXML_REQUIRED_VERSION@
|
Requires: libxml2 >= @LIBXML_REQUIRED_VERSION@
|
||||||
BuildRequires: libxml2-devel >= @LIBXML_REQUIRED_VERSION@
|
BuildRequires: libxml2-devel >= @LIBXML_REQUIRED_VERSION@
|
||||||
BuildRequires: python python-devel
|
BuildRequires: python python-devel
|
||||||
|
BuildRequires: libxml2-python
|
||||||
Prefix: %{_prefix}
|
Prefix: %{_prefix}
|
||||||
Docdir: %{_docdir}
|
Docdir: %{_docdir}
|
||||||
|
|
||||||
@ -130,10 +131,12 @@ rm -rf $RPM_BUILD_ROOT
|
|||||||
|
|
||||||
%doc AUTHORS ChangeLog NEWS README Copyright FEATURES
|
%doc AUTHORS ChangeLog NEWS README Copyright FEATURES
|
||||||
%{prefix}/lib/python*/site-packages/libxslt.py
|
%{prefix}/lib/python*/site-packages/libxslt.py
|
||||||
%{prefix}/lib/python*/site-packages/_libxslt.so
|
%{prefix}/lib/python*/site-packages/libxsltmod.so
|
||||||
%doc python/TODO
|
%doc python/TODO
|
||||||
%doc python/libxsltclass.txt
|
%doc python/libxsltclass.txt
|
||||||
%doc python/tests/*.py
|
%doc python/tests/*.py
|
||||||
|
%doc python/tests/*.xml
|
||||||
|
%doc python/tests/*.xsl
|
||||||
|
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
@ -218,7 +218,7 @@ xsltAttrTemplateValueProcess(xsltTransformContextPtr ctxt, const xmlChar *str) {
|
|||||||
|
|
||||||
if (str == NULL) return(NULL);
|
if (str == NULL) return(NULL);
|
||||||
if (*str == 0)
|
if (*str == 0)
|
||||||
return(xmlStrndup("", 0));
|
return(xmlStrndup((xmlChar *)"", 0));
|
||||||
|
|
||||||
cur = str;
|
cur = str;
|
||||||
while (*cur != 0) {
|
while (*cur != 0) {
|
||||||
|
@ -1,11 +1,15 @@
|
|||||||
|
# Makefile for libxml2 python library
|
||||||
|
AUTOMAKE_OPTIONS = 1.4 foreign
|
||||||
|
|
||||||
SUBDIRS= . tests
|
SUBDIRS= . tests
|
||||||
|
|
||||||
LIBS=-L../libxslt/.libs -L../libxslt -lxslt -L../libexslt/.libs -L../libexslt -lexslt # $(PYTHON_SITE_PACKAGES)/_libxml.so $(LIBXML_LIBS)
|
INCLUDES = \
|
||||||
INCLUDES=-I/usr/include/python$(PYTHON_VERSION) -I$(PYTHON_INCLUDES) $(LIBXML_CFLAGS) -I$(top_srcdir)
|
-I/usr/include/python$(PYTHON_VERSION) \
|
||||||
SHCFLAGS=$(INCLUDES) -Wall -fPIC -g
|
-I$(PYTHON_INCLUDES) \
|
||||||
LINK_FLAGS= -shared
|
$(LIBXML_CFLAGS) \
|
||||||
DOCS_DIR = $(prefix)/share/doc/libxslt-python-$(LIBXML_VERSION)
|
-I$(top_srcdir)
|
||||||
|
|
||||||
|
DOCS_DIR = $(prefix)/share/doc/libxslt-python-$(LIBXML_VERSION)
|
||||||
DOCS = TODO libxsltclass.txt
|
DOCS = TODO libxsltclass.txt
|
||||||
|
|
||||||
EXTRA_DIST = \
|
EXTRA_DIST = \
|
||||||
@ -19,37 +23,39 @@ EXTRA_DIST = \
|
|||||||
$(DOCS)
|
$(DOCS)
|
||||||
|
|
||||||
if WITH_PYTHON
|
if WITH_PYTHON
|
||||||
all: _libxslt.so libxslt.py $(PYTHONSODV)
|
mylibs = \
|
||||||
|
$(top_builddir)/libxslt/libxslt.la \
|
||||||
|
$(top_builddir)/libexslt/libexslt.la
|
||||||
|
|
||||||
|
all: libxsltmod.so libxslt.py $(PYTHONSODV)
|
||||||
|
|
||||||
|
LDADD = -lxslt -lexslt
|
||||||
|
CFLAGS = -Wall -g
|
||||||
|
|
||||||
|
pythondir = $(prefix)/lib/python${PYTHON_VERSION}/site-packages
|
||||||
|
python_PROGRAMS = libxsltmod.so
|
||||||
|
|
||||||
|
libxsltmod_so_SOURCES =
|
||||||
|
libxsltmod_so_LDFLAGS = $(mylibs) $(LIBS) -shared -Wl,-soname,libxsltmod.so
|
||||||
|
|
||||||
|
noinst_LTLIBRARIES = libxsltmodule.la
|
||||||
|
libxsltmodule_la_SOURCES = libxslt.c types.c libxslt-py.c
|
||||||
|
|
||||||
|
libxsltmod.so: $(libxsltmodule_la_OBJECTS)
|
||||||
|
-@rm -f .libs/libxsltmod.so
|
||||||
|
$(LINK) -o $@ $(libxsltmodule_la_OBJECTS) $(libxsltmod_so_LDFLAGS)
|
||||||
|
-@(if [ -r .libs/libxsltmod.so ] ; then cp .libs/libxsltmod.so . ; fi)
|
||||||
|
|
||||||
|
|
||||||
libxslt.py: $(srcdir)/libxsl.py libxsltclass.py
|
libxslt.py: $(srcdir)/libxsl.py libxsltclass.py
|
||||||
cat $(srcdir)/libxsl.py libxsltclass.py > libxslt.py
|
cat $(srcdir)/libxsl.py libxsltclass.py > libxslt.py
|
||||||
|
|
||||||
_libxslt.so: libxslt.o libxslt-py.o types.o
|
|
||||||
$(CC) $(LINK_FLAGS) libxslt.o libxslt-py.o types.o $(LIBS) -o _libxslt.so
|
|
||||||
|
|
||||||
_libxslt.so.dv: libxslt.o libxslt-py.o types.o
|
|
||||||
rm -f _libxslt.so
|
|
||||||
$(CC) $(LINK_FLAGS) -o _libxslt.so libxslt.o libxslt-py.o types.o -L../libxslt/.libs -L../libxslt -lxslt -L../libexslt/.libs -L../libexslt -lexslt # $(HOME)/XML/python/_libxml.so $(HOME)/XML/.libs/libxml2.a
|
|
||||||
|
|
||||||
install-data-local:
|
install-data-local:
|
||||||
$(mkinstalldirs) $(DESTDIR)$(PYTHON_SITE_PACKAGES)
|
$(mkinstalldirs) $(DESTDIR)$(PYTHON_SITE_PACKAGES)
|
||||||
-@INSTALL@ -m 0644 libxslt.py $(DESTDIR)$(PYTHON_SITE_PACKAGES)
|
-@INSTALL@ -m 0644 libxslt.py $(DESTDIR)$(PYTHON_SITE_PACKAGES)
|
||||||
-@INSTALL@ -m 0755 _libxslt.so $(DESTDIR)$(PYTHON_SITE_PACKAGES)
|
|
||||||
$(mkinstalldirs) $(DESTDIR)$(DOCS_DIR)
|
$(mkinstalldirs) $(DESTDIR)$(DOCS_DIR)
|
||||||
-@(for doc in $(DOCS) ; \
|
-@(for doc in $(DOCS) ; \
|
||||||
do @INSTALL@ -m 0644 $$doc $(DESTDIR)$(DOCS_DIR) ; done)
|
do @INSTALL@ -m 0644 $$doc $(DESTDIR)$(DOCS_DIR) ; done)
|
||||||
else
|
|
||||||
all:
|
|
||||||
endif
|
|
||||||
|
|
||||||
libxslt.o: libxslt.c libxslt-export.c libxslt_wrap.h
|
|
||||||
$(CC) $(SHCFLAGS) -c -o libxslt.o $(srcdir)/libxslt.c
|
|
||||||
|
|
||||||
types.o: types.c libxslt_wrap.h
|
|
||||||
$(CC) $(SHCFLAGS) -c -o types.o $(srcdir)/types.c
|
|
||||||
|
|
||||||
libxslt-py.o: libxslt-py.c libxslt-py.h libxslt_wrap.h
|
|
||||||
$(CC) $(SHCFLAGS) -c -o libxslt-py.o $(srcdir)/libxslt-py.c
|
|
||||||
|
|
||||||
GENERATE = generator.py
|
GENERATE = generator.py
|
||||||
API_DESC = $(top_srcdir)/doc/libxslt-api.xml $(srcdir)/libxslt-python-api.xml
|
API_DESC = $(top_srcdir)/doc/libxslt-api.xml $(srcdir)/libxslt-python-api.xml
|
||||||
@ -61,10 +67,13 @@ GENERATED= $(srcdir)/libxsltclass.py \
|
|||||||
$(GENERATED): $(srcdir)/$(GENERATE) $(API_DESC)
|
$(GENERATED): $(srcdir)/$(GENERATE) $(API_DESC)
|
||||||
cd $(srcdir) && $(PYTHON) $(GENERATE)
|
cd $(srcdir) && $(PYTHON) $(GENERATE)
|
||||||
|
|
||||||
|
else
|
||||||
|
all:
|
||||||
|
endif
|
||||||
tests test: all
|
tests test: all
|
||||||
cd tests && $(MAKE) tests
|
cd tests && $(MAKE) tests
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f $(GENERATED) *.o _libxslt.so *.pyc libxslt.py
|
rm -f $(GENERATED) *.o libxslt.so *.pyc libxslt.py
|
||||||
|
|
||||||
|
|
||||||
|
@ -382,7 +382,7 @@ def print_function_wrapper(name, output, export, include):
|
|||||||
include.write("PyObject * ")
|
include.write("PyObject * ")
|
||||||
include.write("libxslt_%s(PyObject *self, PyObject *args);\n" % (name))
|
include.write("libxslt_%s(PyObject *self, PyObject *args);\n" % (name))
|
||||||
|
|
||||||
export.write(" { \"%s\", libxslt_%s, METH_VARARGS },\n" % (name, name))
|
export.write(" { \"%s\", libxslt_%s, METH_VARARGS, NULL },\n" % (name, name))
|
||||||
|
|
||||||
if file == "python":
|
if file == "python":
|
||||||
# Those have been manually generated
|
# Those have been manually generated
|
||||||
@ -746,7 +746,7 @@ if function_classes.has_key("None"):
|
|||||||
classes.write(" ret = ");
|
classes.write(" ret = ");
|
||||||
else:
|
else:
|
||||||
classes.write(" ");
|
classes.write(" ");
|
||||||
classes.write("_libxslt.%s(" % name)
|
classes.write("libxsltmod.%s(" % name)
|
||||||
n = 0
|
n = 0
|
||||||
for arg in args:
|
for arg in args:
|
||||||
if n != 0:
|
if n != 0:
|
||||||
@ -805,7 +805,7 @@ for classname in classes_list:
|
|||||||
classes.write(" pass\n")
|
classes.write(" pass\n")
|
||||||
else:
|
else:
|
||||||
classes.write(" if self._o != None:\n")
|
classes.write(" if self._o != None:\n")
|
||||||
classes.write(" _libxslt.%s(self._o)\n" %
|
classes.write(" libxsltmod.%s(self._o)\n" %
|
||||||
classes_destructors[classname]);
|
classes_destructors[classname]);
|
||||||
classes.write(" self._o = None\n\n");
|
classes.write(" self._o = None\n\n");
|
||||||
flist = function_classes[classname]
|
flist = function_classes[classname]
|
||||||
@ -852,7 +852,7 @@ for classname in classes_list:
|
|||||||
classes.write(" ret = ");
|
classes.write(" ret = ");
|
||||||
else:
|
else:
|
||||||
classes.write(" ");
|
classes.write(" ");
|
||||||
classes.write("_libxslt.%s(" % name)
|
classes.write("libxsltmod.%s(" % name)
|
||||||
n = 0
|
n = 0
|
||||||
for arg in args:
|
for arg in args:
|
||||||
if n != 0:
|
if n != 0:
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import _libxml
|
import libxml2mod
|
||||||
import _libxslt
|
import libxsltmod
|
||||||
import libxml2
|
import libxml2
|
||||||
|
|
||||||
#
|
#
|
||||||
|
@ -349,11 +349,12 @@ libxslt_xsltCleanup(PyObject *self, PyObject *args) {
|
|||||||
************************************************************************/
|
************************************************************************/
|
||||||
static PyMethodDef libxsltMethods[] = {
|
static PyMethodDef libxsltMethods[] = {
|
||||||
#include "libxslt-export.c"
|
#include "libxslt-export.c"
|
||||||
|
{ NULL, NULL, NULL, NULL }
|
||||||
};
|
};
|
||||||
|
|
||||||
void init_libxslt(void) {
|
void initlibxsltmod(void) {
|
||||||
PyObject *m;
|
PyObject *m;
|
||||||
m = Py_InitModule("_libxslt", libxsltMethods);
|
m = Py_InitModule("libxsltmod", libxsltMethods);
|
||||||
/* libxslt_xmlErrorInitialize(); */
|
/* libxslt_xmlErrorInitialize(); */
|
||||||
/*
|
/*
|
||||||
* Specific XSLT initializations
|
* Specific XSLT initializations
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
EXAMPLE_DIR = $(prefix)/share/doc/libxslt-python-$(LIBXML_VERSION)/examples
|
EXAMPLE_DIR = $(prefix)/share/doc/libxslt-python-$(LIBXSLT_VERSION)/examples
|
||||||
|
|
||||||
TESTSPY= \
|
TESTSPY= \
|
||||||
basic.py \
|
basic.py \
|
||||||
@ -11,7 +11,7 @@ XMLS= \
|
|||||||
EXTRAS= \
|
EXTRAS= \
|
||||||
pyxsltproc.py
|
pyxsltproc.py
|
||||||
|
|
||||||
EXTRA_DIST = $(TESTSPY) $(XMLS)
|
EXTRA_DIST = $(TESTSPY) $(XMLS) $(EXTRAS)
|
||||||
|
|
||||||
if WITH_PYTHON
|
if WITH_PYTHON
|
||||||
tests: $(TESTSPY)
|
tests: $(TESTSPY)
|
||||||
|
Reference in New Issue
Block a user