mirror of
https://github.com/GNOME/libxml2.git
synced 2025-02-17 18:19:32 +08:00
inserted the python wrappers build, I hope this won't be too unportable
* python/Makefile.am python/libxml.c configure.in Makefile.am: inserted the python wrappers build, I hope this won't be too unportable Daniel
This commit is contained in:
parent
1971ee2698
commit
f1d0e6be57
@ -1,3 +1,9 @@
|
||||
Fri Feb 1 00:40:48 CET 2002 Daniel Veillard <daniel@veillard.com>
|
||||
|
||||
* python/Makefile.am python/libxml.c configure.in Makefile.am:
|
||||
inserted the python wrappers build, I hope this won't be too
|
||||
unportable
|
||||
|
||||
Thu Jan 31 21:27:37 CET 2002 Daniel Veillard <daniel@veillard.com>
|
||||
|
||||
* xpath.c: minor optimization
|
||||
|
@ -1,7 +1,7 @@
|
||||
## Process this file with automake to produce Makefile.in
|
||||
#AUTOMAKE_OPTIONS=no-dependencies
|
||||
|
||||
SUBDIRS = include . doc example
|
||||
SUBDIRS = include . doc example python
|
||||
|
||||
INCLUDES = -I@srcdir@/include -I$(top_builddir)/include @THREAD_CFLAGS@ @Z_CFLAGS@
|
||||
|
||||
|
48
configure.in
48
configure.in
@ -185,6 +185,49 @@ case ${host} in
|
||||
esac
|
||||
|
||||
|
||||
dnl
|
||||
dnl check for python
|
||||
dnl
|
||||
|
||||
PYTHON=
|
||||
PYTHON_VERSION=
|
||||
PYTHON_INCLUDES=
|
||||
AC_ARG_WITH(python, [ --with-python[=DIR] Build Python bindings if found])
|
||||
if test "$with_python" != "no" ; then
|
||||
if test -x "$with_python/bin/python"
|
||||
then
|
||||
echo Found python in $with_python/bin/python
|
||||
PYTHON="$with_python/bin/python"
|
||||
else
|
||||
AC_PATH_PROG(PYTHON, python python2.2 python2.1 python2.0 python1.6 python1.5)
|
||||
fi
|
||||
if test "$PYTHON" != ""
|
||||
then
|
||||
PYTHON_VERSION=`$PYTHON -c "import sys; print sys.version[[0:3]]"`
|
||||
echo Found Python version $PYTHON_VERSION
|
||||
fi
|
||||
if test "$PYTHON_VERSION" != ""
|
||||
then
|
||||
if test -r $with_python/include/python$PYTHON_VERSION/Python.h
|
||||
then
|
||||
PYTHON_INCLUDES=$with_python/include/python$PYTHON_VERSION
|
||||
else
|
||||
if test -r $prefix/include/python$PYTHON_VERSION/Python.h
|
||||
then
|
||||
PYTHON_INCLUDES=$prefix/include/python$PYTHON_VERSION
|
||||
else
|
||||
if test -r /usr/include/python$PYTHON_VERSION/Python.h
|
||||
then
|
||||
PYTHON_INCLUDES=/usr/include/python$PYTHON_VERSION
|
||||
else
|
||||
echo could not find python$PYTHON_VERSION/Python.h
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
AM_CONDITIONAL(WITH_PYTHON, test "$PYTHON_INCLUDES" != "")
|
||||
|
||||
|
||||
dnl
|
||||
dnl Use buffers for content
|
||||
@ -482,9 +525,12 @@ AC_SUBST(XML_INCLUDEDIR)
|
||||
AC_SUBST(HTML_DIR)
|
||||
AC_SUBST(HAVE_ISNAN)
|
||||
AC_SUBST(HAVE_ISINF)
|
||||
AC_SUBST(PYTHON)
|
||||
AC_SUBST(PYTHON_VERSION)
|
||||
AC_SUBST(PYTHON_INCLUDES)
|
||||
|
||||
AC_SUBST(M_LIBS)
|
||||
AC_SUBST(RDL_LIBS)
|
||||
|
||||
AC_OUTPUT(libxml.spec Makefile include/Makefile include/libxml/Makefile doc/Makefile example/Makefile include/libxml/xmlversion.h include/libxml/xmlwin32version.h xml2-config libxml-2.0.pc xml2Conf.sh)
|
||||
AC_OUTPUT(libxml.spec Makefile include/Makefile include/libxml/Makefile doc/Makefile example/Makefile python/Makefile include/libxml/xmlversion.h include/libxml/xmlwin32version.h xml2-config libxml-2.0.pc xml2Conf.sh)
|
||||
|
||||
|
31
python/Makefile.am
Normal file
31
python/Makefile.am
Normal file
@ -0,0 +1,31 @@
|
||||
LIBS=-L../.libs -L..
|
||||
INCLUDES=-I$(PYTHON_INCLUDES) -I$(top_srcdir)/include
|
||||
SHCFLAGS=$(INCLUDES) -Wall -fPIC
|
||||
LINK_FLAGS= $(LIBS) -shared -lxml2
|
||||
if WITH_PYTHON
|
||||
all: _libxml.so
|
||||
|
||||
_libxml.so: libxml.o libxml2-py.o
|
||||
$(CC) $(LINK_FLAGS) libxml2-py.o libxml.o -o _libxml.so
|
||||
else
|
||||
all:
|
||||
endif
|
||||
|
||||
libxml.o: libxml.c libxml2-export.c libxml_wrap.h
|
||||
$(CC) $(SHCFLAGS) -c -o libxml.o $(srcdir)/libxml.c
|
||||
|
||||
libxml2-py.o: libxml2-py.c libxml2-py.h libxml_wrap.h
|
||||
$(CC) $(SHCFLAGS) -c -o libxml2-py.o $(srcdir)/libxml2-py.c
|
||||
|
||||
GENERATE = generator.py
|
||||
API_DESC = $(top_srcdir)/doc/libxml2-api.xml
|
||||
GENERATED= $(srcdir)/libxml2class.py \
|
||||
$(srcdir)/libxml2-export.c \
|
||||
$(srcdir)/libxml2-py.c \
|
||||
$(srcdir)/libxml2-py.h
|
||||
|
||||
$(GENERATED): $(srcdir)/$(GENERATE) $(API_DESC)
|
||||
cd $(srcdir) && $(PYTHON) $(GENERATE)
|
||||
|
||||
clean:
|
||||
rm -f $(GENERATED) *.o _libxml.so
|
@ -1,5 +1,7 @@
|
||||
#include <Python.h>
|
||||
|
||||
#include <libxml/xmlversion.h>
|
||||
#include <libxml/xmlmemory.h>
|
||||
#include <libxml/parser.h>
|
||||
#include <libxml/tree.h>
|
||||
#include "libxml_wrap.h"
|
||||
|
Loading…
Reference in New Issue
Block a user