mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-25 07:05:28 +00:00
b590866bdb
Gettext annoyingly modifies CPPFLAGS in-place, putting -I/usr/local/include into the search patch if libintl headers must be used from that location. But since we must support automake 1.9.6 which lacks AM_CPPFLAGS, and since CPPFLAGS is used prior to INCLUDES, this means that the build picks up the _old_ installed libvirt.h in priority to the in-tree version, leading to all sorts of weird build failures on FreeBSD. Fix this by teaching configure to undo gettext's actions, but to keep any changes required by gettext at the end of INCLUDES after all in-tree locations are used first. Also requires adding a wrapper Makefile.am and making gnulib-tool create just gnulib.mk files during the bootstrap process. Signed-off-by: Eric Blake <eblake@redhat.com>
88 lines
2.0 KiB
Makefile
88 lines
2.0 KiB
Makefile
# Makefile for libvirt python library
|
|
|
|
## Copyright (C) 2005-2011 Red Hat, Inc.
|
|
## See COPYING.LIB for the License of this software
|
|
|
|
SUBDIRS= . tests
|
|
|
|
INCLUDES = \
|
|
$(PYTHON_INCLUDES) \
|
|
-I$(top_srcdir)/include \
|
|
-I$(top_builddir)/include \
|
|
-I$(top_builddir)/$(subdir) \
|
|
$(GETTEXT_CPPFLAGS)
|
|
|
|
AM_CFLAGS = $(WARN_CFLAGS)
|
|
|
|
DOCS_DIR = $(datadir)/doc/libvirt-python-$(LIBVIRT_VERSION)
|
|
|
|
DOCS = ${srcdir}/TODO
|
|
|
|
CLASSES_EXTRA = \
|
|
libvirt-override-virConnect.py \
|
|
libvirt-override-virStream.py
|
|
|
|
EXTRA_DIST = \
|
|
generator.py \
|
|
typewrappers.c \
|
|
typewrappers.h \
|
|
libvirt-override.c \
|
|
libvirt-override.py \
|
|
libvirt-override-api.xml \
|
|
$(CLASSES_EXTRA) \
|
|
$(DOCS)
|
|
|
|
if WITH_PYTHON
|
|
mylibs = $(top_builddir)/src/libvirt.la
|
|
|
|
all-local: libvirt.py
|
|
|
|
pyexec_LTLIBRARIES = libvirtmod.la
|
|
|
|
libvirtmod_la_SOURCES = libvirt-override.c typewrappers.c
|
|
nodist_libvirtmod_la_SOURCES = libvirt.c libvirt.h
|
|
# Python <= 2.4 header files contain a redundant decl, hence we
|
|
# need extra flags here
|
|
libvirtmod_la_CFLAGS = $(WARN_PYTHON_CFLAGS)
|
|
|
|
libvirtmod_la_LDFLAGS = -module -avoid-version -shared -L$(top_builddir)/src/.libs \
|
|
$(CYGWIN_EXTRA_LDFLAGS)
|
|
libvirtmod_la_LIBADD = $(mylibs) \
|
|
$(CYGWIN_EXTRA_LIBADD) $(CYGWIN_EXTRA_PYTHON_LIBADD)
|
|
|
|
GENERATE = generator.py
|
|
API_DESC = $(top_srcdir)/docs/libvirt-api.xml $(srcdir)/libvirt-override-api.xml
|
|
GENERATED= libvirt-export.c \
|
|
libvirt.c \
|
|
libvirt.h \
|
|
libvirt.py
|
|
|
|
$(GENERATE).stamp: $(srcdir)/$(GENERATE) $(API_DESC)
|
|
$(AM_V_GEN)$(PYTHON) $(srcdir)/$(GENERATE) $(PYTHON) && \
|
|
touch $@
|
|
|
|
$(GENERATED): $(GENERATE).stamp
|
|
|
|
$(libvirtmod_la_OBJECTS): $(GENERATED)
|
|
|
|
install-data-local:
|
|
$(mkinstalldirs) $(DESTDIR)$(pyexecdir)
|
|
$(INSTALL) -m 0644 libvirt.py $(DESTDIR)$(pyexecdir)
|
|
$(mkinstalldirs) $(DESTDIR)$(DOCS_DIR)
|
|
@(for doc in $(DOCS) ; \
|
|
do $(INSTALL) -m 0644 $$doc $(DESTDIR)$(DOCS_DIR) ; done)
|
|
|
|
uninstall-local:
|
|
rm -f $(DESTDIR)$(pyexecdir)/libvirt.py
|
|
|
|
CLEANFILES= $(GENERATED) $(GENERATE).stamp
|
|
|
|
else
|
|
all:
|
|
endif
|
|
|
|
dummy:
|
|
|
|
tests test: all dummy
|
|
-@(cd tests && $(MAKE) MAKEFLAGS+=--silent tests)
|