Hash :
d9335077
Author :
Date :
2022-03-29T13:37:16
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
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
# Makefile for libxml2 python library
AUTOMAKE_OPTIONS = 1.4 foreign
SUBDIRS = . tests
docsdir = $(datadir)/doc/libxml2-python-$(LIBXML_VERSION)
dist_docs_DATA = TODO
EXTRA_DIST = \
setup.py \
generator.py \
libxml.py \
libxml2-export.c \
libxml2-python-api.xml \
libxml2class.py \
libxml2class.txt
if WITH_PYTHON
AM_CPPFLAGS = \
-I$(top_builddir)/include \
-I$(top_srcdir)/include \
$(PYTHON_CFLAGS)
pyexec_LTLIBRARIES = libxml2mod.la
libxml2mod_la_SOURCES = libxml.c libxml_wrap.h libxml2-py.h libxml2-py.c types.c
libxml2mod_la_LDFLAGS = $(CYGWIN_EXTRA_LDFLAGS) $(WIN32_EXTRA_LDFLAGS) -module -avoid-version
libxml2mod_la_LIBADD = $(top_builddir)/libxml2.la $(CYGWIN_EXTRA_PYTHON_LIBADD) $(WIN32_EXTRA_PYTHON_LIBADD) $(PYTHON_LIBS)
BUILT_SOURCES = libxml2-export.c libxml2-py.h libxml2-py.c
# libxml.c #includes libxml2-export.c
libxml.$(OBJEXT): libxml2-export.c
libxml2.py: $(srcdir)/libxml.py libxml2class.py
cat $(srcdir)/libxml.py `test -f libxml2class.py || echo $(srcdir)/`libxml2class.py > $@
python_PYTHON = \
drv_libxml2.py \
libxml2.py
CLEANFILES = *.pyc
MAINTAINERCLEANFILES = libxml2.py libxml2class.*
API_DESC = $(top_srcdir)/doc/libxml2-api.xml $(srcdir)/libxml2-python-api.xml
GENERATED = libxml2class.py libxml2class.txt $(BUILT_SOURCES)
# Generated sources
all-local: drv_libxml2.py libxml2.py
$(GENERATED): $(srcdir)/generator.py $(API_DESC)
$(PYTHON) $(srcdir)/generator.py $(srcdir)
endif
tests test: all
cd tests && $(MAKE) tests