1
0
mirror of https://gitlab.gnome.org/GNOME/libxslt synced 2025-07-28 04:41:59 +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:
Daniel Veillard
2002-02-09 18:06:02 +00:00
parent ada89dddea
commit 43ced5c60b
9 changed files with 62 additions and 42 deletions

View File

@ -1,11 +1,15 @@
# Makefile for libxml2 python library
AUTOMAKE_OPTIONS = 1.4 foreign
SUBDIRS= . tests
LIBS=-L../libxslt/.libs -L../libxslt -lxslt -L../libexslt/.libs -L../libexslt -lexslt # $(PYTHON_SITE_PACKAGES)/_libxml.so $(LIBXML_LIBS)
INCLUDES=-I/usr/include/python$(PYTHON_VERSION) -I$(PYTHON_INCLUDES) $(LIBXML_CFLAGS) -I$(top_srcdir)
SHCFLAGS=$(INCLUDES) -Wall -fPIC -g
LINK_FLAGS= -shared
DOCS_DIR = $(prefix)/share/doc/libxslt-python-$(LIBXML_VERSION)
INCLUDES = \
-I/usr/include/python$(PYTHON_VERSION) \
-I$(PYTHON_INCLUDES) \
$(LIBXML_CFLAGS) \
-I$(top_srcdir)
DOCS_DIR = $(prefix)/share/doc/libxslt-python-$(LIBXML_VERSION)
DOCS = TODO libxsltclass.txt
EXTRA_DIST = \
@ -19,37 +23,39 @@ EXTRA_DIST = \
$(DOCS)
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
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:
$(mkinstalldirs) $(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)
-@(for doc in $(DOCS) ; \
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
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)
cd $(srcdir) && $(PYTHON) $(GENERATE)
else
all:
endif
tests test: all
cd tests && $(MAKE) tests
clean:
rm -f $(GENERATED) *.o _libxslt.so *.pyc libxslt.py
rm -f $(GENERATED) *.o libxslt.so *.pyc libxslt.py

View File

@ -382,7 +382,7 @@ def print_function_wrapper(name, output, export, include):
include.write("PyObject * ")
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":
# Those have been manually generated
@ -746,7 +746,7 @@ if function_classes.has_key("None"):
classes.write(" ret = ");
else:
classes.write(" ");
classes.write("_libxslt.%s(" % name)
classes.write("libxsltmod.%s(" % name)
n = 0
for arg in args:
if n != 0:
@ -805,7 +805,7 @@ for classname in classes_list:
classes.write(" pass\n")
else:
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.write(" self._o = None\n\n");
flist = function_classes[classname]
@ -852,7 +852,7 @@ for classname in classes_list:
classes.write(" ret = ");
else:
classes.write(" ");
classes.write("_libxslt.%s(" % name)
classes.write("libxsltmod.%s(" % name)
n = 0
for arg in args:
if n != 0:

View File

@ -1,5 +1,5 @@
import _libxml
import _libxslt
import libxml2mod
import libxsltmod
import libxml2
#

View File

@ -349,11 +349,12 @@ libxslt_xsltCleanup(PyObject *self, PyObject *args) {
************************************************************************/
static PyMethodDef libxsltMethods[] = {
#include "libxslt-export.c"
{ NULL, NULL, NULL, NULL }
};
void init_libxslt(void) {
void initlibxsltmod(void) {
PyObject *m;
m = Py_InitModule("_libxslt", libxsltMethods);
m = Py_InitModule("libxsltmod", libxsltMethods);
/* libxslt_xmlErrorInitialize(); */
/*
* Specific XSLT initializations

View File

@ -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= \
basic.py \
@ -11,7 +11,7 @@ XMLS= \
EXTRAS= \
pyxsltproc.py
EXTRA_DIST = $(TESTSPY) $(XMLS)
EXTRA_DIST = $(TESTSPY) $(XMLS) $(EXTRAS)
if WITH_PYTHON
tests: $(TESTSPY)