mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-22 07:03:38 +00:00
build: use split stringlist functions from common/utils
The OCaml and Python bindings directly use the utils.c source in common/utils, mostly for guestfs_int_free_string_list. That source contained also functions using gnulib functions, however without linking to gnulib. When building with default build flags (e.g. without as-needed mode), the gnulib symbols cannot be resolved, leading to unusable OCaml and Python libraries. As solution, update the common submodule to get the split of the split of the stringlist functions in common/utils, and adapt the OCaml and Python bindings: - both now use stringlists-utils.c instead of utils.c - fix the Python distutils setup to include only the sources really needed
This commit is contained in:
@@ -16,9 +16,5 @@
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
include actions.h
|
||||
include c-ctype.h
|
||||
include cleanups.h
|
||||
include config.h
|
||||
include guestfs-internal-all.h
|
||||
include guestfs-utils.h
|
||||
include ignore-value.h
|
||||
include guestfs-stringlists-utils.h
|
||||
|
||||
@@ -63,7 +63,8 @@ libguestfsmod_la_SOURCES = \
|
||||
actions.h \
|
||||
handle.c \
|
||||
module.c \
|
||||
structs.c
|
||||
structs.c \
|
||||
../common/utils/stringlists-utils.c
|
||||
|
||||
libguestfsmod_la_CPPFLAGS = \
|
||||
-DGUESTFS_PRIVATE=1 \
|
||||
@@ -75,7 +76,6 @@ libguestfsmod_la_CFLAGS = \
|
||||
$(WARN_CFLAGS) $(WERROR_CFLAGS)
|
||||
|
||||
libguestfsmod_la_LIBADD = \
|
||||
$(top_builddir)/common/utils/libutils_la-utils.lo \
|
||||
$(top_builddir)/lib/libguestfs.la
|
||||
|
||||
libguestfsmod_la_LDFLAGS = -avoid-version -shared -module -shrext $(PYTHON_EXT_SUFFIX)
|
||||
@@ -97,39 +97,19 @@ setup-install: setup.py stamp-extra-files
|
||||
# Python's crappy MANIFEST file cannot graft single files, so we have
|
||||
# to hard-link any extra files we need into the local directory.
|
||||
stamp-extra-files: \
|
||||
c-ctype.h \
|
||||
cleanups.c \
|
||||
cleanups.h \
|
||||
config.h \
|
||||
guestfs-internal-all.h \
|
||||
guestfs-utils.h \
|
||||
ignore-value.h \
|
||||
utils.c
|
||||
guestfs-stringlists-utils.h \
|
||||
stringlists-utils.c
|
||||
touch $@
|
||||
|
||||
config.h:
|
||||
ln ../config.h $@
|
||||
|
||||
c-ctype.h:
|
||||
ln $(top_srcdir)/gnulib/lib/c-ctype.h $@
|
||||
guestfs-stringlists-utils.h:
|
||||
ln $(top_srcdir)/common/utils/guestfs-stringlists-utils.h $@
|
||||
|
||||
cleanups.c:
|
||||
ln $(top_srcdir)/common/utils/cleanups.c $@
|
||||
|
||||
cleanups.h:
|
||||
ln $(top_srcdir)/common/utils/cleanups.h $@
|
||||
|
||||
ignore-value.h:
|
||||
ln $(top_srcdir)/gnulib/lib/ignore-value.h $@
|
||||
|
||||
guestfs-internal-all.h:
|
||||
ln $(top_srcdir)/lib/guestfs-internal-all.h $@
|
||||
|
||||
guestfs-utils.h:
|
||||
ln $(top_srcdir)/common/utils/guestfs-utils.h $@
|
||||
|
||||
utils.c:
|
||||
ln $(top_srcdir)/common/utils/utils.c $@
|
||||
stringlists-utils.c:
|
||||
ln $(top_srcdir)/common/utils/stringlists-utils.c $@
|
||||
|
||||
# Tests.
|
||||
|
||||
@@ -148,15 +128,10 @@ CLEANFILES += \
|
||||
*.pyc \
|
||||
examples/*~ examples/*.pyc \
|
||||
t/*~ t/*.pyc \
|
||||
c-ctype.h \
|
||||
config.h \
|
||||
cleanups.c \
|
||||
cleanups.h \
|
||||
guestfs-internal-all.h \
|
||||
guestfs-utils.h \
|
||||
ignore-value.h \
|
||||
guestfs-stringlists-utils.h \
|
||||
stamp-extra-files \
|
||||
utils.c
|
||||
stringlists-utils.c
|
||||
|
||||
clean-local:
|
||||
rm -rf build dist __pycache__ t/__pycache__
|
||||
|
||||
@@ -62,7 +62,7 @@ This package contains the Python bindings for libguestfs.
|
||||
'handle.c',
|
||||
'module.c',
|
||||
'structs.c',
|
||||
'utils.c'],
|
||||
'stringlists-utils.c'],
|
||||
|
||||
include_dirs=['.', '../lib'],
|
||||
libraries=['guestfs'],
|
||||
|
||||
Reference in New Issue
Block a user