Just code motion.
This commit makes it clearer what is a utility and what is part of the
library. It also makes it clear that we should rename:
guestfs-internal-frontend.h -> utils.h
guestfs-internal-frontend-cleanups.h -> cleanups.h (?)
but this commit does not make that change.
---
.gitignore | 10 ++---
Makefile.am | 2 +-
align/Makefile.am | 3 +-
builder/Makefile.am | 3 ++
cat/Makefile.am | 15 ++++---
common/utils/Makefile.am | 53 +++++++++++++++++++++++
{src => common/utils}/cleanup.c | 0
{src => common/utils}/guestfs-internal-frontend.h | 0
{src => common/utils}/utils.c | 0
configure.ac | 1 +
customize/Makefile.am | 2 +
df/Makefile.am | 3 +-
dib/Makefile.am | 2 +
diff/Makefile.am | 3 +-
docs/C_SOURCE_FILES | 16 +++----
docs/guestfs-hacking.pod | 4 ++
edit/Makefile.am | 3 +-
erlang/Makefile.am | 3 +-
fish/Makefile.am | 6 ++-
format/Makefile.am | 3 +-
fuse/Makefile.am | 15 ++++---
generator/main.ml | 13 +++---
generator/ocaml.ml | 3 +-
generator/perl.ml | 2 +-
generator/php.ml | 2 +-
generator/ruby.ml | 2 +-
get-kernel/Makefile.am | 2 +
inspector/Makefile.am | 3 +-
java/Makefile.am | 1 +
lua/Makefile.am | 3 +-
make-fs/Makefile.am | 3 +-
mllib/Makefile.am | 2 +
ocaml/Makefile.am | 7 +--
ocaml/guestfs-c.h | 2 -
p2v/Makefile.am | 3 +-
php/Makefile.am | 2 +-
po/POTFILES | 10 ++---
python/Makefile.am | 9 ++--
rescue/Makefile.am | 3 +-
resize/Makefile.am | 2 +
ruby/Rakefile.in | 2 +-
sparsify/Makefile.am | 2 +
src/Makefile.am | 24 +++-------
src/appliance-uefi.c | 2 +-
sysprep/Makefile.am | 2 +
test-tool/Makefile.am | 3 +-
tests/c-api/Makefile.am | 26 ++++++++++-
tests/charsets/Makefile.am | 3 +-
tests/events/Makefile.am | 3 +-
tests/mount-local/Makefile.am | 3 +-
tests/parallel/Makefile.am | 3 +-
tests/protocol/Makefile.am | 7 +--
tests/regressions/Makefile.am | 11 ++++-
utils/boot-analysis/Makefile.am | 3 +-
utils/boot-benchmark/Makefile.am | 3 +-
utils/qemu-boot/Makefile.am | 3 +-
utils/qemu-speed-test/Makefile.am | 3 +-
v2v/Makefile.am | 3 ++
v2v/input_libvirtxml.ml | 2 +-
v2v/test-harness/Makefile.am | 2 +
v2v/utils.ml | 2 +-
61 files changed, 234 insertions(+), 99 deletions(-)
create mode 100644 common/utils/Makefile.am
rename {src => common/utils}/cleanup.c (100%)
rename {src => common/utils}/guestfs-internal-frontend.h (100%)
rename {src => common/utils}/utils.c (100%)
diff --git a/.gitignore b/.gitignore
index 5a13d1d..f7d7864 100644
--- a/.gitignore
+++ b/.gitignore
@@ -123,6 +123,11 @@ Makefile.in
/common/protocol/guestfs_protocol.c
/common/protocol/guestfs_protocol.h
/common/protocol/guestfs_protocol.x
+/common/utils/guestfs-internal-frontend-cleanups.h
+/common/utils/structs-cleanup.c
+/common/utils/structs-print.c
+/common/utils/structs-print.h
+/common/utils/uefi.c
/compile
/config.cache
/config.guess
@@ -502,7 +507,6 @@ Makefile.in
/src/guestfs-availability.pod
/src/guestfs.h
/src/guestfs-internal-actions.h
-/src/guestfs-internal-frontend-cleanups.h
/src/guestfs-structs.pod
/src/libguestfs.3
/src/libguestfs.pc
@@ -510,13 +514,9 @@ Makefile.in
/src/.libs/libguestfs.so
/src/libvirt-is-version
/src/stamp-guestfs.pod
-/src/structs-cleanup.c
/src/structs-compare.c
/src/structs-copy.c
/src/structs-free.c
-/src/structs-print.c
-/src/structs-print.h
-/src/uefi.c
/src/unit-tests
/stamp-h1
/sysprep/.depend
diff --git a/Makefile.am b/Makefile.am
index 6049e64..5910a09 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -38,7 +38,7 @@ SUBDIRS += gnulib/tests
endif
# Basic source for the library.
-SUBDIRS += common/errnostring common/protocol
+SUBDIRS += common/errnostring common/protocol common/utils
SUBDIRS += src docs examples po
# The daemon and the appliance.
diff --git a/align/Makefile.am b/align/Makefile.am
index aaa0453..86975a3 100644
--- a/align/Makefile.am
+++ b/align/Makefile.am
@@ -39,6 +39,7 @@ virt_alignment_scan_SOURCES = \
virt_alignment_scan_CPPFLAGS = \
-DGUESTFS_WARN_DEPRECATED=1 \
+ -I$(top_srcdir)/common/utils -I$(top_builddir)/common/utils \
-I$(top_srcdir)/src -I$(top_builddir)/src \
-I$(top_srcdir)/df \
-I$(top_srcdir)/fish \
@@ -52,7 +53,7 @@ virt_alignment_scan_CFLAGS = \
$(LIBVIRT_CFLAGS)
virt_alignment_scan_LDADD = \
- $(top_builddir)/src/libutils.la \
+ $(top_builddir)/common/utils/libutils.la \
$(top_builddir)/src/libguestfs.la \
$(top_builddir)/fish/libfishcommon.la \
$(LIBXML2_LIBS) \
diff --git a/builder/Makefile.am b/builder/Makefile.am
index 2a9f89b..85c754f 100644
--- a/builder/Makefile.am
+++ b/builder/Makefile.am
@@ -100,6 +100,7 @@ virt_builder_CPPFLAGS = \
-I$(top_srcdir)/gnulib/lib -I$(top_builddir)/gnulib/lib \
-I$(shell $(OCAMLC) -where) \
-I$(top_srcdir)/gnulib/lib \
+ -I$(top_srcdir)/common/utils \
-I$(top_srcdir)/src \
-I$(top_srcdir)/fish
virt_builder_CFLAGS = \
@@ -119,6 +120,7 @@ XOBJECTS = $(BOBJECTS:.cmo=.cmx)
# installed copy of libguestfs.
OCAMLPACKAGES = \
-package str,unix \
+ -I $(top_builddir)/common/utils/.libs \
-I $(top_builddir)/src/.libs \
-I $(top_builddir)/gnulib/lib/.libs \
-I $(top_builddir)/ocaml \
@@ -334,6 +336,7 @@ virt_index_validate_CPPFLAGS = \
-I. \
-I$(top_builddir) \
-I$(top_srcdir)/gnulib/lib -I$(top_builddir)/gnulib/lib \
+ -I$(top_srcdir)/common/utils \
-I$(top_srcdir)/src
virt_index_validate_CFLAGS = \
$(WARN_CFLAGS) $(WERROR_CFLAGS) \
diff --git a/cat/Makefile.am b/cat/Makefile.am
index 8a549b6..66d9356 100644
--- a/cat/Makefile.am
+++ b/cat/Makefile.am
@@ -43,6 +43,7 @@ virt_cat_SOURCES = \
virt_cat_CPPFLAGS = \
-DGUESTFS_WARN_DEPRECATED=1 \
-DLOCALEBASEDIR=\""$(datadir)/locale"\" \
+ -I$(top_srcdir)/common/utils -I$(top_builddir)/common/utils \
-I$(top_srcdir)/src -I$(top_builddir)/src \
-I$(top_srcdir)/fish \
-I$(srcdir)/../gnulib/lib -I../gnulib/lib
@@ -52,7 +53,7 @@ virt_cat_CFLAGS = \
$(LIBXML2_CFLAGS)
virt_cat_LDADD = \
- $(top_builddir)/src/libutils.la \
+ $(top_builddir)/common/utils/libutils.la \
$(top_builddir)/src/libguestfs.la \
$(top_builddir)/fish/libfishcommon.la \
$(LIBXML2_LIBS) \
@@ -67,6 +68,7 @@ virt_filesystems_SOURCES = \
virt_filesystems_CPPFLAGS = \
-DGUESTFS_WARN_DEPRECATED=1 \
-DLOCALEBASEDIR=\""$(datadir)/locale"\" \
+ -I$(top_srcdir)/common/utils -I$(top_builddir)/common/utils \
-I$(top_srcdir)/src -I$(top_builddir)/src \
-I$(top_srcdir)/fish \
-I$(srcdir)/../gnulib/lib -I../gnulib/lib
@@ -76,7 +78,7 @@ virt_filesystems_CFLAGS = \
$(LIBXML2_CFLAGS)
virt_filesystems_LDADD = \
- $(top_builddir)/src/libutils.la \
+ $(top_builddir)/common/utils/libutils.la \
$(top_builddir)/src/libguestfs.la \
$(top_builddir)/fish/libfishcommon.la \
$(LIBXML2_LIBS) \
@@ -91,6 +93,7 @@ virt_log_SOURCES = \
virt_log_CPPFLAGS = \
-DGUESTFS_WARN_DEPRECATED=1 \
-DLOCALEBASEDIR=\""$(datadir)/locale"\" \
+ -I$(top_srcdir)/common/utils -I$(top_builddir)/common/utils \
-I$(top_srcdir)/src -I$(top_builddir)/src \
-I$(top_srcdir)/fish \
-I$(srcdir)/../gnulib/lib -I../gnulib/lib
@@ -100,7 +103,7 @@ virt_log_CFLAGS = \
$(LIBXML2_CFLAGS)
virt_log_LDADD = \
- $(top_builddir)/src/libutils.la \
+ $(top_builddir)/common/utils/libutils.la \
$(top_builddir)/src/libguestfs.la \
$(top_builddir)/fish/libfishcommon.la \
$(LIBXML2_LIBS) \
@@ -117,6 +120,7 @@ virt_ls_SOURCES = \
virt_ls_CPPFLAGS = \
-DGUESTFS_WARN_DEPRECATED=1 \
-DLOCALEBASEDIR=\""$(datadir)/locale"\" \
+ -I$(top_srcdir)/common/utils -I$(top_builddir)/common/utils \
-I$(top_srcdir)/src -I$(top_builddir)/src \
-I$(top_srcdir)/fish \
-I$(srcdir)/../gnulib/lib -I../gnulib/lib
@@ -126,7 +130,7 @@ virt_ls_CFLAGS = \
$(LIBXML2_CFLAGS)
virt_ls_LDADD = \
- $(top_builddir)/src/libutils.la \
+ $(top_builddir)/common/utils/libutils.la \
$(top_builddir)/src/libguestfs.la \
$(top_builddir)/fish/libfishcommon.la \
$(LIBXML2_LIBS) \
@@ -141,6 +145,7 @@ virt_tail_SOURCES = \
virt_tail_CPPFLAGS = \
-DGUESTFS_WARN_DEPRECATED=1 \
-DLOCALEBASEDIR=\""$(datadir)/locale"\" \
+ -I$(top_srcdir)/common/utils -I$(top_builddir)/common/utils \
-I$(top_srcdir)/src -I$(top_builddir)/src \
-I$(top_srcdir)/fish \
-I$(srcdir)/../gnulib/lib -I../gnulib/lib
@@ -150,7 +155,7 @@ virt_tail_CFLAGS = \
$(LIBXML2_CFLAGS)
virt_tail_LDADD = \
- $(top_builddir)/src/libutils.la \
+ $(top_builddir)/common/utils/libutils.la \
$(top_builddir)/src/libguestfs.la \
$(top_builddir)/fish/libfishcommon.la \
$(LIBXML2_LIBS) \
diff --git a/common/utils/Makefile.am b/common/utils/Makefile.am
new file mode 100644
index 0000000..d1ad261
--- /dev/null
+++ b/common/utils/Makefile.am
@@ -0,0 +1,53 @@
+# libguestfs
+# Copyright (C) 2017 Red Hat Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+include $(top_srcdir)/subdir-rules.mk
+
+generator_built = \
+ guestfs-internal-frontend-cleanups.h \
+ structs-cleanup.c \
+ structs-print.c \
+ structs-print.h \
+ uefi.c
+
+BUILT_SOURCES = \
+ $(generator_built)
+
+EXTRA_DIST = \
+ $(BUILT_SOURCES)
+
+noinst_LTLIBRARIES = libutils.la
+
+libutils_la_SOURCES = \
+ ../src/guestfs.h \
+ cleanup.c \
+ guestfs-internal-frontend.h \
+ guestfs-internal-frontend-cleanups.h \
+ structs-cleanup.c \
+ structs-print.c \
+ structs-print.h \
+ uefi.c \
+ utils.c
+libutils_la_CPPFLAGS = \
+ -DGUESTFS_WARN_DEPRECATED=1 \
+ -DGUESTFS_PRIVATE=1 \
+ -I$(top_srcdir)/gnulib/lib -I$(top_builddir)/gnulib/lib \
+ -I$(top_srcdir)/src -I$(top_builddir)/src
+libutils_la_CFLAGS = \
+ $(WARN_CFLAGS) $(WERROR_CFLAGS) \
+ $(GCC_VISIBILITY_HIDDEN) \
+ $(LIBXML2_CFLAGS)
diff --git a/src/cleanup.c b/common/utils/cleanup.c
similarity index 100%
rename from src/cleanup.c
rename to common/utils/cleanup.c
diff --git a/src/guestfs-internal-frontend.h b/common/utils/guestfs-internal-frontend.h
similarity index 100%
rename from src/guestfs-internal-frontend.h
rename to common/utils/guestfs-internal-frontend.h
diff --git a/src/utils.c b/common/utils/utils.c
similarity index 100%
rename from src/utils.c
rename to common/utils/utils.c
diff --git a/configure.ac b/configure.ac
index 359b255..2cf0fde 100644
--- a/configure.ac
+++ b/configure.ac
@@ -182,6 +182,7 @@ AC_CONFIG_FILES([Makefile
cat/Makefile
common/errnostring/Makefile
common/protocol/Makefile
+ common/utils/Makefile
csharp/Makefile
customize/Makefile
daemon/Makefile
diff --git a/customize/Makefile.am b/customize/Makefile.am
index 959fdaa..0f4ea83 100644
--- a/customize/Makefile.am
+++ b/customize/Makefile.am
@@ -96,6 +96,7 @@ libcustomize_a_CPPFLAGS = \
-I$(top_builddir) \
-I$(top_srcdir)/gnulib/lib -I$(top_builddir)/gnulib/lib \
-I$(shell $(OCAMLC) -where) \
+ -I$(top_srcdir)/common/utils \
-I$(top_srcdir)/src \
-I$(top_srcdir)/fish
libcustomize_a_CFLAGS = \
@@ -118,6 +119,7 @@ endif
# installed copy of libguestfs.
OCAMLPACKAGES = \
-package str,unix \
+ -I $(top_builddir)/common/utils/.libs \
-I $(top_builddir)/src/.libs \
-I $(top_builddir)/gnulib/lib/.libs \
-I $(top_builddir)/ocaml \
diff --git a/df/Makefile.am b/df/Makefile.am
index 405f44f..cddcbab 100644
--- a/df/Makefile.am
+++ b/df/Makefile.am
@@ -41,6 +41,7 @@ virt_df_SOURCES = \
virt_df_CPPFLAGS = \
-DGUESTFS_WARN_DEPRECATED=1 \
-DLOCALEBASEDIR=\""$(datadir)/locale"\" \
+ -I$(top_srcdir)/common/utils -I$(top_builddir)/common/utils \
-I$(top_srcdir)/src -I$(top_builddir)/src \
-I$(top_srcdir)/fish \
-I$(srcdir)/../gnulib/lib -I../gnulib/lib
@@ -52,7 +53,7 @@ virt_df_CFLAGS = \
$(LIBVIRT_CFLAGS)
virt_df_LDADD = \
- $(top_builddir)/src/libutils.la \
+ $(top_builddir)/common/utils/libutils.la \
$(top_builddir)/src/libguestfs.la \
$(top_builddir)/fish/libfishcommon.la \
$(LIBXML2_LIBS) \
diff --git a/dib/Makefile.am b/dib/Makefile.am
index 2ac362f..99912b5 100644
--- a/dib/Makefile.am
+++ b/dib/Makefile.am
@@ -47,6 +47,7 @@ virt_dib_CPPFLAGS = \
-I$(top_srcdir)/gnulib/lib -I$(top_builddir)/gnulib/lib \
-I$(shell $(OCAMLC) -where) \
-I$(top_srcdir)/gnulib/lib \
+ -I$(top_srcdir)/common/utils \
-I$(top_srcdir)/src
virt_dib_CFLAGS = \
-pthread \
@@ -61,6 +62,7 @@ XOBJECTS = $(BOBJECTS:.cmo=.cmx)
# installed copy of libguestfs.
OCAMLPACKAGES = \
-package str,unix \
+ -I $(top_builddir)/common/utils/.libs \
-I $(top_builddir)/src/.libs \
-I $(top_builddir)/gnulib/lib/.libs \
-I $(top_builddir)/ocaml \
diff --git a/diff/Makefile.am b/diff/Makefile.am
index b9aa495..33e6b54 100644
--- a/diff/Makefile.am
+++ b/diff/Makefile.am
@@ -35,6 +35,7 @@ virt_diff_SOURCES = \
virt_diff_CPPFLAGS = \
-DGUESTFS_WARN_DEPRECATED=1 \
-DLOCALEBASEDIR=\""$(datadir)/locale"\" \
+ -I$(top_srcdir)/common/utils -I$(top_builddir)/common/utils \
-I$(top_srcdir)/src -I$(top_builddir)/src \
-I$(top_srcdir)/cat -I$(top_srcdir)/fish \
-I$(srcdir)/../gnulib/lib -I../gnulib/lib
@@ -44,7 +45,7 @@ virt_diff_CFLAGS = \
$(LIBXML2_CFLAGS)
virt_diff_LDADD = \
- $(top_builddir)/src/libutils.la \
+ $(top_builddir)/common/utils/libutils.la \
$(top_builddir)/src/libguestfs.la \
$(top_builddir)/fish/libfishcommon.la \
$(LIBXML2_LIBS) \
diff --git a/docs/C_SOURCE_FILES b/docs/C_SOURCE_FILES
index d87fa7b..0d1ca30 100644
--- a/docs/C_SOURCE_FILES
+++ b/docs/C_SOURCE_FILES
@@ -13,6 +13,14 @@ cat/ls.c
cat/tail.c
cat/visit.c
cat/visit.h
+common/utils/cleanup.c
+common/utils/guestfs-internal-frontend-cleanups.h
+common/utils/guestfs-internal-frontend.h
+common/utils/structs-cleanup.c
+common/utils/structs-print.c
+common/utils/structs-print.h
+common/utils/uefi.c
+common/utils/utils.c
customize/crypt-c.c
customize/dummy.c
customize/perl_edit-c.c
@@ -318,7 +326,6 @@ src/appliance.c
src/available.c
src/bindtests.c
src/canonical-name.c
-src/cleanup.c
src/command.c
src/conn-socket.c
src/copy-in-out.c
@@ -333,8 +340,6 @@ src/filearch.c
src/fuse.c
src/guestfs-internal-actions.h
src/guestfs-internal-all.h
-src/guestfs-internal-frontend-cleanups.h
-src/guestfs-internal-frontend.h
src/guestfs-internal.h
src/guestfs.h
src/guid.c
@@ -365,18 +370,13 @@ src/private-data.c
src/proto.c
src/qemu.c
src/stringsbuf.c
-src/structs-cleanup.c
src/structs-compare.c
src/structs-copy.c
src/structs-free.c
-src/structs-print.c
-src/structs-print.h
src/tmpdirs.c
src/tsk.c
-src/uefi.c
src/umask.c
src/unit-tests.c
-src/utils.c
src/version.c
src/wait.c
src/whole-file.c
diff --git a/docs/guestfs-hacking.pod b/docs/guestfs-hacking.pod
index 4633a8a..6e7c7b6 100644
--- a/docs/guestfs-hacking.pod
+++ b/docs/guestfs-hacking.pod
@@ -94,6 +94,10 @@ handled by this library.
The XDR-based communication protocol used between the library
and the daemon running inside the appliance is defined here.
+=item F<common/utils>
+
+Various utility functions used throughout the library and tools.
+
=back
=item F<contrib>
diff --git a/edit/Makefile.am b/edit/Makefile.am
index 40a1afb..06f45d8 100644
--- a/edit/Makefile.am
+++ b/edit/Makefile.am
@@ -37,6 +37,7 @@ virt_edit_SOURCES = \
virt_edit_CPPFLAGS = \
-DGUESTFS_WARN_DEPRECATED=1 \
-DLOCALEBASEDIR=\""$(datadir)/locale"\" \
+ -I$(top_srcdir)/common/utils -I$(top_builddir)/common/utils \
-I$(top_srcdir)/src -I$(top_builddir)/src \
-I$(top_srcdir)/fish \
-I$(srcdir)/../gnulib/lib -I../gnulib/lib
@@ -46,7 +47,7 @@ virt_edit_CFLAGS = \
$(LIBXML2_CFLAGS)
virt_edit_LDADD = \
- $(top_builddir)/src/libutils.la \
+ $(top_builddir)/common/utils/libutils.la \
$(top_builddir)/src/libguestfs.la \
$(top_builddir)/fish/libfishcommon.la \
$(LIBXML2_LIBS) \
diff --git a/erlang/Makefile.am b/erlang/Makefile.am
index 6c9aef8..64f0e44 100644
--- a/erlang/Makefile.am
+++ b/erlang/Makefile.am
@@ -80,6 +80,7 @@ erl_guestfs_SOURCES = \
erl_guestfs_CPPFLAGS = \
-DGUESTFS_PRIVATE=1 \
+ -I$(top_srcdir)/common/utils -I$(top_builddir)/common/utils \
-I$(top_srcdir)/src -I$(top_builddir)/src \
-I$(srcdir)/../gnulib/lib -I../gnulib/lib \
-I$(ERLANG_LIB_DIR_erl_interface)/include
@@ -91,7 +92,7 @@ erl_guestfs_LDADD = \
$(ERLANG_LIB_DIR_erl_interface)/lib/liberl_interface.a \
$(ERLANG_LIB_DIR_erl_interface)/lib/libei.a \
-lpthread \
- $(top_builddir)/src/libutils.la \
+ $(top_builddir)/common/utils/libutils.la \
$(top_builddir)/src/libguestfs.la \
$(LIBXML2_LIBS) \
$(LIBVIRT_LIBS) \
diff --git a/fish/Makefile.am b/fish/Makefile.am
index 8165772..8460b6d 100644
--- a/fish/Makefile.am
+++ b/fish/Makefile.am
@@ -97,6 +97,7 @@ libfishcommon_la_SOURCES = \
$(FISHCOMMON_SOURCE_FILES)
libfishcommon_la_CPPFLAGS = \
-DGUESTFS_WARN_DEPRECATED=1 \
+ -I$(top_srcdir)/common/utils -I$(top_builddir)/common/utils \
-I$(top_srcdir)/src -I$(top_builddir)/src \
-I$(top_srcdir)/fish -I$(top_builddir)/fish \
-I$(srcdir)/../gnulib/lib -I../gnulib/lib
@@ -104,8 +105,8 @@ libfishcommon_la_CFLAGS = \
$(WARN_CFLAGS) $(WERROR_CFLAGS) \
$(LIBXML2_CFLAGS)
libfishcommon_la_LIBADD = \
+ $(top_builddir)/common/utils/libutils.la \
$(top_builddir)/src/libguestfs.la \
- $(top_builddir)/src/libutils.la \
$(LIBXML2_LIBS) \
$(LTLIBINTL)
@@ -162,6 +163,7 @@ guestfish_CPPFLAGS = \
-DCOMPILING_GUESTFISH=1 \
-DGUESTFS_WARN_DEPRECATED=1 \
-DLOCALEBASEDIR=\""$(datadir)/locale"\" \
+ -I$(top_srcdir)/common/utils -I$(top_builddir)/common/utils \
-I$(top_srcdir)/src -I$(top_builddir)/src \
-I$(top_srcdir)/fish -I$(top_builddir)/fish \
-I$(srcdir)/../gnulib/lib -I../gnulib/lib
@@ -175,8 +177,8 @@ guestfish_LDADD = \
$(LIBCONFIG_LIBS) \
$(LIBREADLINE) \
$(LIBTINFO_LIBS) \
+ $(top_builddir)/common/utils/libutils.la \
$(top_builddir)/src/libguestfs.la \
- $(top_builddir)/src/libutils.la \
$(LIBXML2_LIBS) \
$(LTLIBINTL) \
-lm
diff --git a/format/Makefile.am b/format/Makefile.am
index 1079ed7..627a38d 100644
--- a/format/Makefile.am
+++ b/format/Makefile.am
@@ -30,6 +30,7 @@ virt_format_SOURCES = \
virt_format_CPPFLAGS = \
-DGUESTFS_WARN_DEPRECATED=1 \
-DLOCALEBASEDIR=\""$(datadir)/locale"\" \
+ -I$(top_srcdir)/common/utils -I$(top_builddir)/common/utils \
-I$(top_srcdir)/src -I$(top_builddir)/src \
-I$(top_srcdir)/fish \
-I$(srcdir)/../gnulib/lib -I../gnulib/lib
@@ -40,7 +41,7 @@ virt_format_CFLAGS = \
$(LIBVIRT_CFLAGS)
virt_format_LDADD = \
- $(top_builddir)/src/libutils.la \
+ $(top_builddir)/common/utils/libutils.la \
$(top_builddir)/src/libguestfs.la \
$(top_builddir)/fish/libfishcommon.la \
$(LIBXML2_LIBS) \
diff --git a/fuse/Makefile.am b/fuse/Makefile.am
index f46005a..ca09733 100644
--- a/fuse/Makefile.am
+++ b/fuse/Makefile.am
@@ -44,6 +44,7 @@ guestmount_SOURCES = \
guestmount_CPPFLAGS = \
-DGUESTFS_WARN_DEPRECATED=1 \
-DLOCALEBASEDIR=\""$(datadir)/locale"\" \
+ -I$(top_srcdir)/common/utils -I$(top_builddir)/common/utils \
-I$(top_srcdir)/src -I$(top_builddir)/src \
-I$(top_srcdir)/fish \
-I$(srcdir)/../gnulib/lib -I../gnulib/lib
@@ -57,7 +58,7 @@ guestmount_CFLAGS = \
guestmount_LDADD = \
$(FUSE_LIBS) \
$(LIBCONFIG_LIBS) \
- $(top_builddir)/src/libutils.la \
+ $(top_builddir)/common/utils/libutils.la \
$(top_builddir)/src/libguestfs.la \
$(top_builddir)/fish/libfishcommon.la \
$(LIBXML2_LIBS) \
@@ -74,6 +75,7 @@ guestunmount_SOURCES = \
guestunmount_CPPFLAGS = \
-DLOCALEBASEDIR=\""$(datadir)/locale"\" \
+ -I$(top_srcdir)/common/utils -I$(top_builddir)/common/utils \
-I$(top_srcdir)/src -I$(top_builddir)/src \
-I$(top_srcdir)/fish \
-I$(srcdir)/../gnulib/lib -I../gnulib/lib
@@ -82,7 +84,7 @@ guestunmount_CFLAGS = \
$(WARN_CFLAGS) $(WERROR_CFLAGS)
guestunmount_LDADD = \
- $(top_builddir)/src/libutils.la \
+ $(top_builddir)/common/utils/libutils.la \
$(top_builddir)/src/libguestfs.la \
$(LIBXML2_LIBS) \
$(LIBVIRT_LIBS) \
@@ -144,6 +146,7 @@ test_fuse_SOURCES = \
test-fuse.c
test_fuse_CPPFLAGS = \
+ -I$(top_srcdir)/common/utils -I$(top_builddir)/common/utils \
-I$(top_srcdir)/src -I$(top_builddir)/src \
-I$(srcdir)/../gnulib/lib -I../gnulib/lib
@@ -151,7 +154,7 @@ test_fuse_CFLAGS = \
$(WARN_CFLAGS) $(WERROR_CFLAGS)
test_fuse_LDADD = \
- $(top_builddir)/src/libutils.la \
+ $(top_builddir)/common/utils/libutils.la \
$(top_builddir)/src/libguestfs.la \
$(LIBXML2_LIBS) \
$(LIBVIRT_LIBS) \
@@ -162,6 +165,7 @@ test_guestmount_fd_SOURCES = \
test-guestmount-fd.c
test_guestmount_fd_CPPFLAGS = \
+ -I$(top_srcdir)/common/utils -I$(top_builddir)/common/utils \
-I$(top_srcdir)/src -I$(top_builddir)/src \
-I$(srcdir)/../gnulib/lib -I../gnulib/lib
@@ -169,7 +173,7 @@ test_guestmount_fd_CFLAGS = \
$(WARN_CFLAGS) $(WERROR_CFLAGS)
test_guestmount_fd_LDADD = \
- $(top_builddir)/src/libutils.la \
+ $(top_builddir)/common/utils/libutils.la \
$(top_builddir)/src/libguestfs.la \
$(LIBXML2_LIBS) \
$(LIBVIRT_LIBS) \
@@ -180,6 +184,7 @@ test_guestunmount_fd_SOURCES = \
test-guestunmount-fd.c
test_guestunmount_fd_CPPFLAGS = \
+ -I$(top_srcdir)/common/utils -I$(top_builddir)/common/utils \
-I$(top_srcdir)/src -I$(top_builddir)/src \
-I$(srcdir)/../gnulib/lib -I../gnulib/lib
@@ -187,7 +192,7 @@ test_guestunmount_fd_CFLAGS = \
$(WARN_CFLAGS) $(WERROR_CFLAGS)
test_guestunmount_fd_LDADD = \
- $(top_builddir)/src/libutils.la \
+ $(top_builddir)/common/utils/libutils.la \
$(top_builddir)/src/libguestfs.la \
$(LIBXML2_LIBS) \
$(LIBVIRT_LIBS) \
diff --git a/generator/main.ml b/generator/main.ml
index cef4a9b..b1007f6 100644
--- a/generator/main.ml
+++ b/generator/main.ml
@@ -99,10 +99,15 @@ Run it from the top source directory using the command
output_to "common/errnostring/errnostring.c" generate_errnostring_c;
output_to "common/errnostring/errnostring.h" generate_errnostring_h;
output_to "common/protocol/guestfs_protocol.x" generate_xdr;
+ output_to "common/utils/guestfs-internal-frontend-cleanups.h"
+ generate_internal_frontend_cleanups_h;
+ output_to "common/utils/structs-cleanup.c" generate_client_structs_cleanup;
+ output_to "common/utils/structs-print.c" generate_client_structs_print_c;
+ output_to "common/utils/structs-print.h" generate_client_structs_print_h;
+ output_to "common/utils/uefi.c" generate_uefi_c;
+
output_to "src/guestfs.h" generate_guestfs_h;
output_to "src/guestfs-internal-actions.h" generate_internal_actions_h;
- output_to "src/guestfs-internal-frontend-cleanups.h"
- generate_internal_frontend_cleanups_h;
output_to "src/bindtests.c" generate_bindtests;
output_to "src/guestfs-structs.pod" generate_structs_pod;
output_to "src/guestfs-actions.pod" generate_actions_pod;
@@ -114,9 +119,6 @@ Run it from the top source directory using the command
output_to "src/structs-compare.c" generate_client_structs_compare;
output_to "src/structs-copy.c" generate_client_structs_copy;
output_to "src/structs-free.c" generate_client_structs_free;
- output_to "src/structs-cleanup.c" generate_client_structs_cleanup;
- output_to "src/structs-print.c" generate_client_structs_print_c;
- output_to "src/structs-print.h" generate_client_structs_print_h;
output_to "src/actions-variants.c" generate_client_actions_variants;
output_to_subset "src/actions-%d.c" generate_client_actions;
output_to "daemon/actions.h" generate_daemon_actions_h;
@@ -236,7 +238,6 @@ Run it from the top source directory using the command
generate_gobject_session_header;
output_to "gobject/src/session.c" generate_gobject_session_source;
- output_to "src/uefi.c" generate_uefi_c;
output_to "v2v/uefi.ml" generate_uefi_ml;
output_to "v2v/uefi.mli" generate_uefi_mli;
diff --git a/generator/ocaml.ml b/generator/ocaml.ml
index 6d7fb19..083e505 100644
--- a/generator/ocaml.ml
+++ b/generator/ocaml.ml
@@ -417,7 +417,8 @@ and generate_ocaml_c () =
#include <caml/mlvalues.h>
#include <caml/signals.h>
-#include \"guestfs.h\"
+#include <guestfs.h>
+#include \"guestfs-internal-frontend.h\"
#include \"guestfs-c.h\"
diff --git a/generator/perl.ml b/generator/perl.ml
index 2b8dfbd..3a87f16 100644
--- a/generator/perl.ml
+++ b/generator/perl.ml
@@ -56,7 +56,7 @@ let rec generate_perl_xs () =
#endif
#include <guestfs.h>
-#include \"guestfs-internal-frontend.h\"
+#include \"guestfs-internal-all.h\"
static SV *
my_newSVll(long long val) {
diff --git a/generator/php.ml b/generator/php.ml
index 5f6365d..90869ef 100644
--- a/generator/php.ml
+++ b/generator/php.ml
@@ -90,7 +90,7 @@ and generate_php_c () =
#include <php_guestfs_php.h>
#include \"guestfs.h\"
-#include \"guestfs-internal-frontend.h\"
+#include \"guestfs-internal-frontend.h\" /* Only for POINTER_NOT_IMPLEMENTED
*/
static int res_guestfs_h;
diff --git a/generator/ruby.ml b/generator/ruby.ml
index 6b5745f..c938bc9 100644
--- a/generator/ruby.ml
+++ b/generator/ruby.ml
@@ -55,7 +55,7 @@ let rec generate_ruby_h () =
#endif
#include \"guestfs.h\"
-#include \"guestfs-internal-frontend.h\"
+#include \"guestfs-internal-frontend.h\" /* Only for POINTER_NOT_IMPLEMENTED
*/
#include \"extconf.h\"
diff --git a/get-kernel/Makefile.am b/get-kernel/Makefile.am
index 55b3577..d2f6d6d 100644
--- a/get-kernel/Makefile.am
+++ b/get-kernel/Makefile.am
@@ -43,6 +43,7 @@ virt_get_kernel_CPPFLAGS = \
-I$(top_srcdir)/gnulib/lib -I$(top_builddir)/gnulib/lib \
-I$(shell $(OCAMLC) -where) \
-I$(top_srcdir)/gnulib/lib \
+ -I$(top_srcdir)/common/utils \
-I$(top_srcdir)/src \
-I$(top_srcdir)/fish
virt_get_kernel_CFLAGS = \
@@ -58,6 +59,7 @@ XOBJECTS = $(BOBJECTS:.cmo=.cmx)
# installed copy of libguestfs.
OCAMLPACKAGES = \
-package str,unix \
+ -I $(top_builddir)/common/utils/.libs \
-I $(top_builddir)/src/.libs \
-I $(top_builddir)/gnulib/lib/.libs \
-I $(top_builddir)/ocaml \
diff --git a/inspector/Makefile.am b/inspector/Makefile.am
index 4bf55cc..1456966 100644
--- a/inspector/Makefile.am
+++ b/inspector/Makefile.am
@@ -58,6 +58,7 @@ virt_inspector_SOURCES = \
virt_inspector_CPPFLAGS = \
-DGUESTFS_WARN_DEPRECATED=1 \
-DLOCALEBASEDIR=\""$(datadir)/locale"\" \
+ -I$(top_srcdir)/common/utils -I$(top_builddir)/common/utils \
-I$(top_srcdir)/src -I$(top_builddir)/src \
-I$(top_srcdir)/fish \
-I$(srcdir)/../gnulib/lib -I../gnulib/lib
@@ -67,7 +68,7 @@ virt_inspector_CFLAGS = \
$(LIBXML2_CFLAGS)
virt_inspector_LDADD = \
- $(top_builddir)/src/libutils.la \
+ $(top_builddir)/common/utils/libutils.la \
$(top_builddir)/src/libguestfs.la \
$(top_builddir)/fish/libfishcommon.la \
$(LIBXML2_LIBS) \
diff --git a/java/Makefile.am b/java/Makefile.am
index bc88162..b165f5a 100644
--- a/java/Makefile.am
+++ b/java/Makefile.am
@@ -108,6 +108,7 @@ libguestfs_jni_la_SOURCES = \
libguestfs_jni_la_CPPFLAGS = \
-DGUESTFS_PRIVATE=1 \
+ -I$(top_srcdir)/common/utils -I$(top_builddir)/common/utils \
-I$(top_srcdir)/src -I$(top_builddir)/src
libguestfs_jni_la_CFLAGS = \
diff --git a/lua/Makefile.am b/lua/Makefile.am
index 5c2efca..30ec4fb 100644
--- a/lua/Makefile.am
+++ b/lua/Makefile.am
@@ -41,6 +41,7 @@ libluaguestfs_la_SOURCES = lua-guestfs.c
libluaguestfs_la_CPPFLAGS = \
-DGUESTFS_PRIVATE=1 \
+ -I$(top_srcdir)/common/utils -I$(top_builddir)/common/utils \
-I$(top_srcdir)/src -I$(top_builddir)/src
libluaguestfs_la_CFLAGS = \
@@ -48,7 +49,7 @@ libluaguestfs_la_CFLAGS = \
$(LUA_CFLAGS)
libluaguestfs_la_LIBADD = \
- $(top_builddir)/src/libutils.la \
+ $(top_builddir)/common/utils/libutils.la \
$(top_builddir)/src/libguestfs.la \
$(LIBXML2_LIBS) \
$(LIBVIRT_LIBS) \
diff --git a/make-fs/Makefile.am b/make-fs/Makefile.am
index 8d068b3..fde3dea 100644
--- a/make-fs/Makefile.am
+++ b/make-fs/Makefile.am
@@ -30,6 +30,7 @@ virt_make_fs_SOURCES = \
virt_make_fs_CPPFLAGS = \
-DGUESTFS_WARN_DEPRECATED=1 \
-DLOCALEBASEDIR=\""$(datadir)/locale"\" \
+ -I$(top_srcdir)/common/utils -I$(top_builddir)/common/utils \
-I$(top_srcdir)/src -I$(top_builddir)/src \
-I$(top_srcdir)/fish \
-I$(srcdir)/../gnulib/lib -I../gnulib/lib
@@ -39,7 +40,7 @@ virt_make_fs_CFLAGS = \
$(LIBXML2_CFLAGS)
virt_make_fs_LDADD = \
- $(top_builddir)/src/libutils.la \
+ $(top_builddir)/common/utils/libutils.la \
$(top_builddir)/src/libguestfs.la \
$(top_builddir)/fish/libfishcommon.la \
$(LIBXML2_LIBS) \
diff --git a/mllib/Makefile.am b/mllib/Makefile.am
index c8a9bca..40f2212 100644
--- a/mllib/Makefile.am
+++ b/mllib/Makefile.am
@@ -110,6 +110,7 @@ libmllib_a_CPPFLAGS = \
-I$(top_builddir) \
-I$(top_srcdir)/gnulib/lib -I$(top_builddir)/gnulib/lib \
-I$(shell $(OCAMLC) -where) \
+ -I$(top_srcdir)/common/utils \
-I$(top_srcdir)/src \
-I$(top_srcdir)/cat \
-I$(top_srcdir)/fish
@@ -126,6 +127,7 @@ XOBJECTS = $(BOBJECTS:.cmo=.cmx)
# installed copy of libguestfs.
OCAMLPACKAGES = \
-package str,unix \
+ -I $(top_builddir)/common/utils/.libs \
-I $(top_builddir)/src/.libs \
-I $(top_builddir)/gnulib/lib/.libs \
-I $(top_builddir)/ocaml \
diff --git a/ocaml/Makefile.am b/ocaml/Makefile.am
index 100b046..8377a83 100644
--- a/ocaml/Makefile.am
+++ b/ocaml/Makefile.am
@@ -69,19 +69,20 @@ stamp-mlguestfs: libguestfsocaml.a $(guestfs_cmm)
$(libguestfsocaml_a_OBJECTS) guestfs.cmo \
$(LDFLAGS) \
$(LTLIBINTL) \
- -L$(top_builddir)/src/.libs -lguestfs
+ -L../src/.libs -lguestfs
if HAVE_OCAMLOPT
$(OCAMLMKLIB) -o mlguestfs \
$(libguestfsocaml_a_OBJECTS) guestfs.cmx \
$(LDFLAGS) \
$(LTLIBINTL) \
- -L$(top_builddir)/src/.libs -lguestfs
+ -L../src/.libs -lguestfs
endif
touch $@
libguestfsocaml_a_CPPFLAGS = \
-DGUESTFS_PRIVATE=1 \
-I$(top_builddir) -I$(OCAMLLIB) -I$(top_srcdir)/ocaml \
+ -I$(top_srcdir)/common/utils -I$(top_builddir)/common/utils \
-I$(top_srcdir)/src -I$(top_builddir)/src \
-I$(top_srcdir)/gnulib/lib -I../gnulib/lib
@@ -93,7 +94,7 @@ libguestfsocaml_a_SOURCES = \
guestfs-c.c \
guestfs-c-actions.c \
guestfs-c-errnos.c \
- ../src/utils.c
+ ../common/utils/utils.c
if HAVE_OCAMLDOC
diff --git a/ocaml/guestfs-c.h b/ocaml/guestfs-c.h
index 21cdaa6..9380cf9 100644
--- a/ocaml/guestfs-c.h
+++ b/ocaml/guestfs-c.h
@@ -19,8 +19,6 @@
#ifndef GUESTFS_OCAML_C_H
#define GUESTFS_OCAML_C_H
-#include "guestfs-internal-frontend.h"
-
#define Guestfs_val(v) (*((guestfs_h **)Data_custom_val(v)))
extern void guestfs_int_ocaml_raise_error (guestfs_h *g, const char *func)
Noreturn;
diff --git a/p2v/Makefile.am b/p2v/Makefile.am
index ef96f34..1cefd62 100644
--- a/p2v/Makefile.am
+++ b/p2v/Makefile.am
@@ -92,6 +92,7 @@ virt_p2v_SOURCES = \
virt_p2v_CPPFLAGS = \
-DLOCALEBASEDIR=\""$(datadir)/locale"\" \
+ -I$(top_srcdir)/common/utils -I$(top_builddir)/common/utils \
-I$(top_srcdir)/src -I$(top_builddir)/src \
-I$(srcdir)/../gnulib/lib -I../gnulib/lib
@@ -104,7 +105,7 @@ virt_p2v_CFLAGS = \
$(DBUS_CFLAGS)
virt_p2v_LDADD = \
- $(top_builddir)/src/libutils.la \
+ $(top_builddir)/common/utils/libutils.la \
$(PCRE_LIBS) \
$(LIBXML2_LIBS) \
$(GTK_LIBS) \
diff --git a/php/Makefile.am b/php/Makefile.am
index 4db7d84..4dda499 100644
--- a/php/Makefile.am
+++ b/php/Makefile.am
@@ -38,7 +38,7 @@ php_DATA = guestfs_php.ini
# and we need to add the library to EXTRA_LDFLAGS.
all: check-builddir-equals-srcdir extension/config.h
$(MAKE) -C extension \
- EXTRA_INCLUDES="-I$(abs_srcdir)/../src" \
+ EXTRA_INCLUDES="-I$(abs_srcdir)/../common/utils -I$(abs_srcdir)/../src" \
EXTRA_LDFLAGS="-L$(abs_srcdir)/../src/.libs -lguestfs" \
EXTRA_CFLAGS="-DGUESTFS_PRIVATE=1" \
all
diff --git a/po/POTFILES b/po/POTFILES
index 1328e88..05e3631 100644
--- a/po/POTFILES
+++ b/po/POTFILES
@@ -15,6 +15,11 @@ cat/tail.c
cat/visit.c
common/errnostring/errnostring-gperf.c
common/errnostring/errnostring.c
+common/utils/cleanup.c
+common/utils/structs-cleanup.c
+common/utils/structs-print.c
+common/utils/uefi.c
+common/utils/utils.c
customize/crypt-c.c
customize/dummy.c
customize/perl_edit-c.c
@@ -388,7 +393,6 @@ src/appliance.c
src/available.c
src/bindtests.c
src/canonical-name.c
-src/cleanup.c
src/command.c
src/conn-socket.c
src/copy-in-out.c
@@ -429,17 +433,13 @@ src/private-data.c
src/proto.c
src/qemu.c
src/stringsbuf.c
-src/structs-cleanup.c
src/structs-compare.c
src/structs-copy.c
src/structs-free.c
-src/structs-print.c
src/tmpdirs.c
src/tsk.c
-src/uefi.c
src/umask.c
src/unit-tests.c
-src/utils.c
src/version.c
src/wait.c
src/whole-file.c
diff --git a/python/Makefile.am b/python/Makefile.am
index 0a03f73..ec99570 100644
--- a/python/Makefile.am
+++ b/python/Makefile.am
@@ -67,13 +67,14 @@ libguestfsmod_la_SOURCES = \
libguestfsmod_la_CPPFLAGS = \
-DGUESTFS_PRIVATE=1 \
$(PYTHON_CFLAGS) \
+ -I$(top_srcdir)/common/utils -I$(top_builddir)/common/utils \
-I$(top_srcdir)/src -I$(top_builddir)/src
libguestfsmod_la_CFLAGS = \
$(WARN_CFLAGS) $(WERROR_CFLAGS)
libguestfsmod_la_LIBADD = \
- $(top_builddir)/src/libutils_la-utils.lo \
+ $(top_builddir)/common/utils/libutils_la-utils.lo \
$(top_builddir)/src/libguestfs.la
libguestfsmod_la_LDFLAGS = -avoid-version -shared -module -shrext $(PYTHON_EXT_SUFFIX)
@@ -117,13 +118,13 @@ guestfs-internal-all.h:
ln $(top_srcdir)/src/guestfs-internal-all.h $@
guestfs-internal-frontend-cleanups.h:
- ln $(top_srcdir)/src/guestfs-internal-frontend-cleanups.h $@
+ ln $(top_srcdir)/common/utils/guestfs-internal-frontend-cleanups.h $@
guestfs-internal-frontend.h:
- ln $(top_srcdir)/src/guestfs-internal-frontend.h $@
+ ln $(top_srcdir)/common/utils/guestfs-internal-frontend.h $@
utils.c:
- ln $(top_srcdir)/src/utils.c $@
+ ln $(top_srcdir)/common/utils/utils.c $@
# Tests.
diff --git a/rescue/Makefile.am b/rescue/Makefile.am
index 2ffb2fa..4159944 100644
--- a/rescue/Makefile.am
+++ b/rescue/Makefile.am
@@ -46,6 +46,7 @@ virt_rescue_CPPFLAGS = \
-DCOMPILING_VIRT_RESCUE=1 \
-DGUESTFS_WARN_DEPRECATED=1 \
-DLOCALEBASEDIR=\""$(datadir)/locale"\" \
+ -I$(top_srcdir)/common/utils -I$(top_builddir)/common/utils \
-I$(top_srcdir)/src -I$(top_builddir)/src \
-I$(top_srcdir)/fish \
-I$(srcdir)/../gnulib/lib -I../gnulib/lib
@@ -57,7 +58,7 @@ virt_rescue_CFLAGS = \
virt_rescue_LDADD = \
$(LIBCONFIG_LIBS) \
- $(top_builddir)/src/libutils.la \
+ $(top_builddir)/common/utils/libutils.la \
$(top_builddir)/src/libguestfs.la \
$(LIBXML2_LIBS) \
$(LIBVIRT_LIBS) \
diff --git a/resize/Makefile.am b/resize/Makefile.am
index 9dfba2d..a767c83 100644
--- a/resize/Makefile.am
+++ b/resize/Makefile.am
@@ -41,6 +41,7 @@ virt_resize_CPPFLAGS = \
-I$(top_builddir) \
-I$(top_srcdir)/gnulib/lib -I$(top_builddir)/gnulib/lib \
-I$(shell $(OCAMLC) -where) \
+ -I$(top_srcdir)/common/utils \
-I$(top_srcdir)/src \
-I$(top_srcdir)/fish
virt_resize_CFLAGS = \
@@ -55,6 +56,7 @@ XOBJECTS = $(BOBJECTS:.cmo=.cmx)
# installed copy of libguestfs.
OCAMLPACKAGES = \
-package str,unix \
+ -I $(top_builddir)/common/utils/.libs \
-I $(top_builddir)/src/.libs \
-I $(top_builddir)/gnulib/lib/.libs \
-I $(top_builddir)/ocaml \
diff --git a/ruby/Rakefile.in b/ruby/Rakefile.in
index 879159e..1d6cb87 100644
--- a/ruby/Rakefile.in
+++ b/ruby/Rakefile.in
@@ -65,7 +65,7 @@ CLOBBER.include [ "@builddir(a)/config.save",
"@builddir(a)/ext/**/mkmf.log",
# Build locally
file MAKEFILE => EXT_CONF do |t|
- unless sh "top_srcdir=$(pwd)/@top_srcdir@; top_builddir=$(pwd)/@top_builddir@;
export ARCHFLAGS=\"-arch $(uname -m)\"; mkdir -p @builddir@/ext/guestfs; cd
@builddir@/ext/guestfs; @RUBY@ #{EXT_CONF}
--with-_guestfs-include=$top_srcdir/src:$top_builddir
--with-_guestfs-lib=$top_builddir/src/.libs"
+ unless sh "top_srcdir=$(pwd)/@top_srcdir@; top_builddir=$(pwd)/@top_builddir@;
export ARCHFLAGS=\"-arch $(uname -m)\"; mkdir -p @builddir@/ext/guestfs; cd
@builddir@/ext/guestfs; @RUBY@ #{EXT_CONF}
--with-_guestfs-include=$top_srcdir/common/utils:$top_srcdir/src:$top_builddir
--with-_guestfs-lib=$top_builddir/src/.libs"
$stderr.puts "Failed to run extconf"
break
end
diff --git a/sparsify/Makefile.am b/sparsify/Makefile.am
index ecfcd41..8df0c93 100644
--- a/sparsify/Makefile.am
+++ b/sparsify/Makefile.am
@@ -47,6 +47,7 @@ virt_sparsify_CPPFLAGS = \
-I. \
-I$(top_builddir) \
-I$(shell $(OCAMLC) -where) \
+ -I$(top_srcdir)/common/utils \
-I$(top_srcdir)/src \
-I$(top_srcdir)/fish
virt_sparsify_CFLAGS = \
@@ -60,6 +61,7 @@ XOBJECTS = $(BOBJECTS:.cmo=.cmx)
# installed copy of libguestfs.
OCAMLPACKAGES = \
-package str,unix \
+ -I $(top_builddir)/common/utils/.libs \
-I $(top_builddir)/src/.libs \
-I $(top_builddir)/gnulib/lib/.libs \
-I $(top_builddir)/ocaml \
diff --git a/src/Makefile.am b/src/Makefile.am
index 4cc928a..0f6a258 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -22,7 +22,6 @@ noinst_PROGRAMS =
generator_built = \
guestfs.h \
guestfs-internal-actions.h \
- guestfs-internal-frontend-cleanups.h \
actions-0.c \
actions-1.c \
actions-2.c \
@@ -60,11 +59,11 @@ lib_LTLIBRARIES = libguestfs.la
libguestfs_la_SOURCES = \
../common/errnostring/errnostring.h \
../common/protocol/guestfs_protocol.h \
+ ../common/utils/guestfs-internal-frontend.h \
+ ../common/utils/guestfs-internal-frontend-cleanups.h \
guestfs.h \
guestfs-internal.h \
guestfs-internal-all.h \
- guestfs-internal-frontend.h \
- guestfs-internal-frontend-cleanups.h \
actions-0.c \
actions-1.c \
actions-2.c \
@@ -139,6 +138,7 @@ libguestfs_la_CPPFLAGS = \
-DLIBOSINFO_DB_PATH='"$(datadir)/libosinfo/db"' \
-I$(top_srcdir)/common/errnostring -I$(top_builddir)/common/errnostring \
-I$(top_srcdir)/common/protocol -I$(top_builddir)/common/protocol \
+ -I$(top_srcdir)/common/utils -I$(top_builddir)/common/utils \
-I$(top_srcdir)/gnulib/lib -I$(top_builddir)/gnulib/lib
libguestfs_la_CFLAGS = \
@@ -152,7 +152,7 @@ libguestfs_la_CFLAGS = \
libguestfs_la_LIBADD = \
../common/errnostring/liberrnostring.la \
../common/protocol/libprotocol.la \
- libutils.la \
+ ../common/utils/libutils.la \
$(PCRE_LIBS) $(MAGIC_LIBS) \
$(LIBVIRT_LIBS) $(LIBXML2_LIBS) \
$(SELINUX_LIBS) \
@@ -180,20 +180,6 @@ libguestfs_la_CFLAGS += $(FUSE_CFLAGS)
libguestfs_la_LIBADD += $(FUSE_LIBS)
endif
-# libutils.la contains code outside libguestfs which is also
-# included in tools and bindings.
-noinst_LTLIBRARIES = libutils.la
-
-libutils_la_SOURCES = \
- cleanup.c \
- structs-cleanup.c \
- structs-print.c \
- structs-print.h \
- uefi.c \
- utils.c
-libutils_la_CPPFLAGS = $(libguestfs_la_CPPFLAGS)
-libutils_la_CFLAGS = $(libguestfs_la_CFLAGS)
-
if HAVE_LIBVIRT
# Small utility to check for a needed libvirt version;
# to be used in shell/script-based tests.
@@ -225,6 +211,7 @@ check_PROGRAMS = unit-tests
unit_tests_SOURCES = unit-tests.c
unit_tests_CPPFLAGS = \
-I$(top_srcdir)/gnulib/lib -I$(top_builddir)/gnulib/lib \
+ -I$(top_srcdir)/common/utils -I$(top_builddir)/common/utils \
-I$(top_srcdir)/src -I.
unit_tests_CFLAGS = \
$(WARN_CFLAGS) $(WERROR_CFLAGS)
@@ -232,6 +219,7 @@ unit_tests_CFLAGS = \
# non-exported functions we have to link with the objects not the
# library.
unit_tests_LDADD = \
+ ../common/utils/libutils.la \
$(libguestfs_la_OBJECTS) \
$(libguestfs_la_LIBADD)
diff --git a/src/appliance-uefi.c b/src/appliance-uefi.c
index 814214c..1612c5d 100644
--- a/src/appliance-uefi.c
+++ b/src/appliance-uefi.c
@@ -19,7 +19,7 @@
/**
* Find the UEFI firmware needed to boot the appliance.
*
- * See also F<src/uefi.c> (autogenerated file) containing the
+ * See also F<common/utils/uefi.c> (autogenerated file) containing the
* firmware file locations.
*/
diff --git a/sysprep/Makefile.am b/sysprep/Makefile.am
index a106a20..975a664 100644
--- a/sysprep/Makefile.am
+++ b/sysprep/Makefile.am
@@ -92,6 +92,7 @@ virt_sysprep_CPPFLAGS = \
-I$(top_builddir) \
-I$(top_srcdir)/gnulib/lib -I$(top_builddir)/gnulib/lib \
-I$(shell $(OCAMLC) -where) \
+ -I$(top_srcdir)/common/utils \
-I$(top_srcdir)/src \
-I$(top_srcdir)/fish
virt_sysprep_CFLAGS = \
@@ -106,6 +107,7 @@ XOBJECTS = $(BOBJECTS:.cmo=.cmx)
# installed copy of libguestfs.
OCAMLPACKAGES = \
-package str,unix \
+ -I $(top_builddir)/common/utils/.libs \
-I $(top_builddir)/src/.libs \
-I $(top_builddir)/gnulib/lib/.libs \
-I $(top_builddir)/ocaml \
diff --git a/test-tool/Makefile.am b/test-tool/Makefile.am
index df285a2..095f116 100644
--- a/test-tool/Makefile.am
+++ b/test-tool/Makefile.am
@@ -25,6 +25,7 @@ man_MANS = libguestfs-test-tool.1
libguestfs_test_tool_SOURCES = test-tool.c
libguestfs_test_tool_CPPFLAGS = \
+ -I$(top_srcdir)/common/utils -I$(top_builddir)/common/utils \
-I$(top_srcdir)/src -I$(top_builddir)/src \
-I$(top_srcdir)/gnulib/lib -I$(top_builddir)/gnulib/lib \
-DGUESTFS_WARN_DEPRECATED=1 \
@@ -35,8 +36,8 @@ libguestfs_test_tool_CFLAGS = \
$(LIBXML2_CFLAGS)
libguestfs_test_tool_LDADD = \
+ $(top_builddir)/common/utils/libutils.la \
$(top_builddir)/src/libguestfs.la \
- $(top_builddir)/src/libutils.la \
$(LIBXML2_LIBS) \
$(LTLIBINTL) \
$(top_builddir)/gnulib/lib/libgnu.la
diff --git a/tests/c-api/Makefile.am b/tests/c-api/Makefile.am
index 599e499..9d4898b 100644
--- a/tests/c-api/Makefile.am
+++ b/tests/c-api/Makefile.am
@@ -92,13 +92,14 @@ tests_SOURCES = \
tests_CPPFLAGS = \
-DGUESTFS_PRIVATE=1 \
-I$(top_srcdir)/gnulib/lib -I$(top_builddir)/gnulib/lib \
+ -I$(top_srcdir)/common/utils -I$(top_builddir)/common/utils \
-I$(top_srcdir)/src -I$(top_builddir)/src
tests_CFLAGS = \
$(WARN_CFLAGS) $(WERROR_CFLAGS) \
$(PCRE_CFLAGS)
tests_LDADD = \
$(PCRE_LIBS) \
- $(top_builddir)/src/libutils.la \
+ $(top_builddir)/common/utils/libutils.la \
$(top_builddir)/src/libguestfs.la \
$(LIBXML2_LIBS) \
$(LIBVIRT_LIBS) \
@@ -136,10 +137,12 @@ endif
test_create_handle_SOURCES = test-create-handle.c
test_create_handle_CPPFLAGS = \
+ -I$(top_srcdir)/common/utils -I$(top_builddir)/common/utils \
-I$(top_srcdir)/src -I$(top_builddir)/src
test_create_handle_CFLAGS = \
$(WARN_CFLAGS) $(WERROR_CFLAGS)
test_create_handle_LDADD = \
+ $(top_builddir)/common/utils/libutils.la \
$(top_builddir)/src/libguestfs.la
if HAVE_LIBDL
@@ -155,90 +158,107 @@ endif
test_config_SOURCES = test-config.c
test_config_CPPFLAGS = \
+ -I$(top_srcdir)/common/utils -I$(top_builddir)/common/utils \
-I$(top_srcdir)/src -I$(top_builddir)/src
test_config_CFLAGS = \
$(WARN_CFLAGS) $(WERROR_CFLAGS)
test_config_LDADD = \
+ $(top_builddir)/common/utils/libutils.la \
$(top_builddir)/src/libguestfs.la
test_add_drive_opts_SOURCES = test-add-drive-opts.c
test_add_drive_opts_CPPFLAGS = \
+ -I$(top_srcdir)/common/utils -I$(top_builddir)/common/utils \
-I$(top_srcdir)/src -I$(top_builddir)/src
test_add_drive_opts_CFLAGS = \
$(WARN_CFLAGS) $(WERROR_CFLAGS)
test_add_drive_opts_LDADD = \
+ $(top_builddir)/common/utils/libutils.la \
$(top_builddir)/src/libguestfs.la
test_last_errno_SOURCES = test-last-errno.c
test_last_errno_CPPFLAGS = \
-I$(top_srcdir)/gnulib/lib -I$(top_builddir)/gnulib/lib \
+ -I$(top_srcdir)/common/utils -I$(top_builddir)/common/utils \
-I$(top_srcdir)/src -I$(top_builddir)/src
test_last_errno_CFLAGS = \
$(WARN_CFLAGS) $(WERROR_CFLAGS)
test_last_errno_LDADD = \
+ $(top_builddir)/common/utils/libutils.la \
$(top_builddir)/src/libguestfs.la \
$(top_builddir)/gnulib/lib/libgnu.la
test_backend_settings_SOURCES = test-backend-settings.c
test_backend_settings_CPPFLAGS = \
+ -I$(top_srcdir)/common/utils -I$(top_builddir)/common/utils \
-I$(top_srcdir)/src -I$(top_builddir)/src
test_backend_settings_CFLAGS = \
$(WARN_CFLAGS) $(WERROR_CFLAGS)
test_backend_settings_LDADD = \
- $(top_builddir)/src/libutils_la-utils.lo \
+ $(top_builddir)/common/utils/libutils.la \
$(LTLIBINTL) \
$(top_builddir)/src/libguestfs.la
test_private_data_SOURCES = test-private-data.c
test_private_data_CPPFLAGS = \
+ -I$(top_srcdir)/common/utils -I$(top_builddir)/common/utils \
-I$(top_srcdir)/src -I$(top_builddir)/src
test_private_data_CFLAGS = \
$(WARN_CFLAGS) $(WERROR_CFLAGS)
test_private_data_LDADD = \
+ $(top_builddir)/common/utils/libutils.la \
$(top_builddir)/src/libguestfs.la
test_user_cancel_SOURCES = test-user-cancel.c
test_user_cancel_CPPFLAGS = \
-I$(top_srcdir)/gnulib/lib -I$(top_builddir)/gnulib/lib \
+ -I$(top_srcdir)/common/utils -I$(top_builddir)/common/utils \
-I$(top_srcdir)/src -I$(top_builddir)/src
test_user_cancel_CFLAGS = \
-pthread \
$(WARN_CFLAGS) $(WERROR_CFLAGS)
test_user_cancel_LDADD = \
+ $(top_builddir)/common/utils/libutils.la \
$(top_builddir)/src/libguestfs.la -lm \
$(top_builddir)/gnulib/lib/libgnu.la
test_debug_to_file_SOURCES = test-debug-to-file.c
test_debug_to_file_CPPFLAGS = \
+ -I$(top_srcdir)/common/utils -I$(top_builddir)/common/utils \
-I$(top_srcdir)/src -I$(top_builddir)/src \
-I$(top_srcdir)/gnulib/lib \
-I$(top_builddir)/gnulib/lib
test_debug_to_file_CFLAGS = \
$(WARN_CFLAGS) $(WERROR_CFLAGS)
test_debug_to_file_LDADD = \
+ $(top_builddir)/common/utils/libutils.la \
$(top_builddir)/src/libguestfs.la \
$(top_builddir)/gnulib/lib/libgnu.la
test_environment_SOURCES = test-environment.c
test_environment_CPPFLAGS = \
+ -I$(top_srcdir)/common/utils -I$(top_builddir)/common/utils \
-I$(top_srcdir)/src -I$(top_builddir)/src \
-I$(top_srcdir)/gnulib/lib \
-I$(top_builddir)/gnulib/lib
test_environment_CFLAGS = \
$(WARN_CFLAGS) $(WERROR_CFLAGS)
test_environment_LDADD = \
+ $(top_builddir)/common/utils/libutils.la \
$(top_builddir)/src/libguestfs.la \
$(LTLIBINTL) \
$(top_builddir)/gnulib/lib/libgnu.la
test_event_string_SOURCES = test-event-string.c
test_event_string_CPPFLAGS = \
+ -I$(top_srcdir)/common/utils -I$(top_builddir)/common/utils \
-I$(top_srcdir)/src -I$(top_builddir)/src \
-I$(top_srcdir)/gnulib/lib \
-I$(top_builddir)/gnulib/lib
test_event_string_CFLAGS = \
$(WARN_CFLAGS) $(WERROR_CFLAGS)
test_event_string_LDADD = \
+ $(top_builddir)/common/utils/libutils.la \
$(top_builddir)/src/libguestfs.la \
$(LTLIBINTL) \
$(top_builddir)/gnulib/lib/libgnu.la
@@ -246,6 +266,7 @@ test_event_string_LDADD = \
if HAVE_LIBVIRT
test_add_libvirt_dom_SOURCES = test-add-libvirt-dom.c
test_add_libvirt_dom_CPPFLAGS = \
+ -I$(top_srcdir)/common/utils -I$(top_builddir)/common/utils \
-I$(top_srcdir)/src -I$(top_builddir)/src \
-I$(top_srcdir)/gnulib/lib \
-I$(top_builddir)/gnulib/lib
@@ -253,6 +274,7 @@ test_add_libvirt_dom_CFLAGS = \
$(LIBVIRT_CFLAGS) \
$(WARN_CFLAGS) $(WERROR_CFLAGS)
test_add_libvirt_dom_LDADD = \
+ $(top_builddir)/common/utils/libutils.la \
$(top_builddir)/src/libguestfs.la $(LIBVIRT_LIBS) \
$(LTLIBINTL) \
$(LTLIBTHREAD) $(top_builddir)/gnulib/lib/libgnu.la
diff --git a/tests/charsets/Makefile.am b/tests/charsets/Makefile.am
index a285867..5715402 100644
--- a/tests/charsets/Makefile.am
+++ b/tests/charsets/Makefile.am
@@ -27,11 +27,12 @@ check_PROGRAMS = $(TESTS)
test_charset_fidelity_SOURCES = test-charset-fidelity.c
test_charset_fidelity_CPPFLAGS = \
-I$(top_srcdir)/gnulib/lib -I$(top_builddir)/gnulib/lib \
+ -I$(top_srcdir)/common/utils -I$(top_builddir)/common/utils \
-I$(top_srcdir)/src -I$(top_builddir)/src
test_charset_fidelity_CFLAGS = \
$(WARN_CFLAGS) $(WERROR_CFLAGS)
test_charset_fidelity_LDADD = \
- $(top_builddir)/src/libutils.la \
+ $(top_builddir)/common/utils/libutils.la \
$(top_builddir)/src/libguestfs.la \
$(LIBXML2_LIBS) \
$(LIBVIRT_LIBS) \
diff --git a/tests/events/Makefile.am b/tests/events/Makefile.am
index 0231a6b..d2d2e4c 100644
--- a/tests/events/Makefile.am
+++ b/tests/events/Makefile.am
@@ -34,12 +34,13 @@ check_PROGRAMS += test-libvirt-auth-callbacks
test_libvirt_auth_callbacks_SOURCES = test-libvirt-auth-callbacks.c
test_libvirt_auth_callbacks_CPPFLAGS = \
-I$(top_srcdir)/gnulib/lib -I$(top_builddir)/gnulib/lib \
+ -I$(top_srcdir)/common/utils -I$(top_builddir)/common/utils \
-I$(top_srcdir)/src -I$(top_builddir)/src
test_libvirt_auth_callbacks_CFLAGS = \
$(WARN_CFLAGS) $(WERROR_CFLAGS) \
$(LIBVIRT_CFLAGS)
test_libvirt_auth_callbacks_LDADD = \
- $(top_builddir)/src/libutils.la \
+ $(top_builddir)/common/utils/libutils.la \
$(top_builddir)/src/libguestfs.la \
$(LIBVIRT_LIBS) \
$(LIBXML2_LIBS) \
diff --git a/tests/mount-local/Makefile.am b/tests/mount-local/Makefile.am
index 2d851a0..f0bba80 100644
--- a/tests/mount-local/Makefile.am
+++ b/tests/mount-local/Makefile.am
@@ -33,6 +33,7 @@ test_parallel_mount_local_SOURCES = \
test_parallel_mount_local_CPPFLAGS = \
-DGUESTFS_WARN_DEPRECATED=1 \
-I$(top_srcdir)/gnulib/lib -I$(top_builddir)/gnulib/lib \
+ -I$(top_srcdir)/common/utils -I$(top_builddir)/common/utils \
-I$(top_srcdir)/src -I$(top_builddir)/src \
-I$(top_srcdir)/df
test_parallel_mount_local_CFLAGS = \
@@ -41,7 +42,7 @@ test_parallel_mount_local_CFLAGS = \
$(FUSE_CFLAGS)
test_parallel_mount_local_LDADD = \
$(FUSE_LIBS) \
- $(top_builddir)/src/libutils.la \
+ $(top_builddir)/common/utils/libutils.la \
$(top_builddir)/src/libguestfs.la \
$(LIBXML2_LIBS) \
$(LIBVIRT_LIBS) \
diff --git a/tests/parallel/Makefile.am b/tests/parallel/Makefile.am
index c5c3ef7..cf67232 100644
--- a/tests/parallel/Makefile.am
+++ b/tests/parallel/Makefile.am
@@ -28,12 +28,13 @@ test_parallel_SOURCES = test-parallel.c
test_parallel_CPPFLAGS = \
-DGUESTFS_WARN_DEPRECATED=1 \
-I$(top_srcdir)/gnulib/lib -I$(top_builddir)/gnulib/lib \
+ -I$(top_srcdir)/common/utils -I$(top_builddir)/common/utils \
-I$(top_srcdir)/src -I$(top_builddir)/src
test_parallel_CFLAGS = \
-pthread \
$(WARN_CFLAGS) $(WERROR_CFLAGS)
test_parallel_LDADD = \
- $(top_builddir)/src/libutils.la \
+ $(top_builddir)/common/utils/libutils.la \
$(top_builddir)/src/libguestfs.la \
$(LTLIBINTL) \
$(top_builddir)/gnulib/lib/libgnu.la
diff --git a/tests/protocol/Makefile.am b/tests/protocol/Makefile.am
index d54a403..6c7a76c 100644
--- a/tests/protocol/Makefile.am
+++ b/tests/protocol/Makefile.am
@@ -45,12 +45,13 @@ test_error_messages_SOURCES = \
test-error-messages.c
test_error_messages_CPPFLAGS = \
-I$(top_srcdir)/gnulib/lib -I$(top_builddir)/gnulib/lib \
- -I$(top_srcdir)/src -I$(top_builddir)/src \
- -I$(top_srcdir)/common/protocol -I$(top_builddir)/common/protocol
+ -I$(top_srcdir)/common/utils -I$(top_builddir)/common/utils \
+ -I$(top_srcdir)/common/protocol -I$(top_builddir)/common/protocol \
+ -I$(top_srcdir)/src -I$(top_builddir)/src
test_error_messages_CFLAGS = \
$(WARN_CFLAGS) $(WERROR_CFLAGS)
test_error_messages_LDADD = \
- $(top_builddir)/src/libutils.la \
+ $(top_builddir)/common/utils/libutils.la \
$(top_builddir)/src/libguestfs.la \
$(LIBXML2_LIBS) \
$(LIBVIRT_LIBS) \
diff --git a/tests/regressions/Makefile.am b/tests/regressions/Makefile.am
index fa8079a..4f78178 100644
--- a/tests/regressions/Makefile.am
+++ b/tests/regressions/Makefile.am
@@ -104,52 +104,61 @@ check_PROGRAMS = \
rhbz501893_SOURCES = rhbz501893.c
rhbz501893_CPPFLAGS = \
+ -I$(top_srcdir)/common/utils -I$(top_builddir)/common/utils \
-I$(top_srcdir)/src -I$(top_builddir)/src
rhbz501893_CFLAGS = \
$(WARN_CFLAGS) $(WERROR_CFLAGS)
rhbz501893_LDADD = \
+ $(top_builddir)/common/utils/libutils.la \
$(top_builddir)/src/libguestfs.la
rhbz790721_SOURCES = rhbz790721.c
rhbz790721_CPPFLAGS = \
-I$(top_srcdir)/gnulib/lib -I$(top_builddir)/gnulib/lib \
+ -I$(top_srcdir)/common/utils -I$(top_builddir)/common/utils \
-I$(top_srcdir)/src -I$(top_builddir)/src
rhbz790721_CFLAGS = \
-pthread \
$(WARN_CFLAGS) $(WERROR_CFLAGS)
rhbz790721_LDADD = \
+ $(top_builddir)/common/utils/libutils.la \
$(top_builddir)/src/libguestfs.la \
$(top_builddir)/gnulib/lib/libgnu.la
rhbz914931_SOURCES = rhbz914931.c
rhbz914931_CPPFLAGS = \
-I$(top_srcdir)/gnulib/lib -I$(top_builddir)/gnulib/lib \
+ -I$(top_srcdir)/common/utils -I$(top_builddir)/common/utils \
-I$(top_srcdir)/src -I$(top_builddir)/src \
-DGUESTFS_PRIVATE=1
rhbz914931_CFLAGS = \
-pthread \
$(WARN_CFLAGS) $(WERROR_CFLAGS)
rhbz914931_LDADD = \
- $(top_builddir)/src/libutils.la \
+ $(top_builddir)/common/utils/libutils.la \
$(LTLIBINTL) \
$(top_builddir)/src/libguestfs.la \
$(top_builddir)/gnulib/lib/libgnu.la
rhbz1055452_SOURCES = rhbz1055452.c
rhbz1055452_CPPFLAGS = \
+ -I$(top_srcdir)/common/utils -I$(top_builddir)/common/utils \
-I$(top_srcdir)/src -I$(top_builddir)/src
rhbz1055452_CFLAGS = \
-pthread \
$(WARN_CFLAGS) $(WERROR_CFLAGS)
rhbz1055452_LDADD = \
+ $(top_builddir)/common/utils/libutils.la \
$(top_builddir)/src/libguestfs.la
test_big_heap_SOURCES = test-big-heap.c
test_big_heap_CPPFLAGS = \
+ -I$(top_srcdir)/common/utils -I$(top_builddir)/common/utils \
-I$(top_srcdir)/src -I$(top_builddir)/src
test_big_heap_CFLAGS = \
$(WARN_CFLAGS) $(WERROR_CFLAGS)
test_big_heap_LDADD = \
+ $(top_builddir)/common/utils/libutils.la \
$(top_builddir)/src/libguestfs.la
SLOW_TESTS = \
diff --git a/utils/boot-analysis/Makefile.am b/utils/boot-analysis/Makefile.am
index 5539de9..d472884 100644
--- a/utils/boot-analysis/Makefile.am
+++ b/utils/boot-analysis/Makefile.am
@@ -29,13 +29,14 @@ boot_analysis_SOURCES = \
boot-analysis-utils.h
boot_analysis_CPPFLAGS = \
-I$(top_srcdir)/gnulib/lib -I$(top_builddir)/gnulib/lib \
+ -I$(top_srcdir)/common/utils -I$(top_builddir)/common/utils \
-I$(top_srcdir)/src -I$(top_builddir)/src
boot_analysis_CFLAGS = \
-pthread \
$(WARN_CFLAGS) $(WERROR_CFLAGS) \
$(PCRE_CFLAGS)
boot_analysis_LDADD = \
- $(top_builddir)/src/libutils.la \
+ $(top_builddir)/common/utils/libutils.la \
$(top_builddir)/src/libguestfs.la \
$(PCRE_LIBS) \
$(LIBXML2_LIBS) \
diff --git a/utils/boot-benchmark/Makefile.am b/utils/boot-benchmark/Makefile.am
index 4b65f83..e77e5d9 100644
--- a/utils/boot-benchmark/Makefile.am
+++ b/utils/boot-benchmark/Makefile.am
@@ -31,12 +31,13 @@ boot_benchmark_SOURCES = \
../boot-analysis/boot-analysis-utils.h
boot_benchmark_CPPFLAGS = \
-I$(top_srcdir)/gnulib/lib -I$(top_builddir)/gnulib/lib \
+ -I$(top_srcdir)/common/utils -I$(top_builddir)/common/utils \
-I$(top_srcdir)/src -I$(top_builddir)/src \
-I$(top_srcdir)/utils/boot-analysis
boot_benchmark_CFLAGS = \
$(WARN_CFLAGS) $(WERROR_CFLAGS)
boot_benchmark_LDADD = \
- $(top_builddir)/src/libutils.la \
+ $(top_builddir)/common/utils/libutils.la \
$(top_builddir)/src/libguestfs.la \
$(LIBXML2_LIBS) \
$(LTLIBINTL) \
diff --git a/utils/qemu-boot/Makefile.am b/utils/qemu-boot/Makefile.am
index c6df3f0..4f0d6a9 100644
--- a/utils/qemu-boot/Makefile.am
+++ b/utils/qemu-boot/Makefile.am
@@ -25,13 +25,14 @@ qemu_boot_SOURCES = \
qemu-boot.c
qemu_boot_CPPFLAGS = \
-I$(top_srcdir)/gnulib/lib -I$(top_builddir)/gnulib/lib \
+ -I$(top_srcdir)/common/utils -I$(top_builddir)/common/utils \
-I$(top_srcdir)/src -I$(top_builddir)/src \
-I$(top_srcdir)/df
qemu_boot_CFLAGS = \
-pthread \
$(WARN_CFLAGS) $(WERROR_CFLAGS)
qemu_boot_LDADD = \
- $(top_builddir)/src/libutils.la \
+ $(top_builddir)/common/utils/libutils.la \
$(top_builddir)/src/libguestfs.la \
$(LIBXML2_LIBS) \
$(LIBVIRT_LIBS) \
diff --git a/utils/qemu-speed-test/Makefile.am b/utils/qemu-speed-test/Makefile.am
index e09b414..c8ee0ec 100644
--- a/utils/qemu-speed-test/Makefile.am
+++ b/utils/qemu-speed-test/Makefile.am
@@ -23,12 +23,13 @@ qemu_speed_test_SOURCES = \
qemu-speed-test.c
qemu_speed_test_CPPFLAGS = \
-I$(top_srcdir)/gnulib/lib -I$(top_builddir)/gnulib/lib \
+ -I$(top_srcdir)/common/utils -I$(top_builddir)/common/utils \
-I$(top_srcdir)/src -I$(top_builddir)/src \
-I$(top_srcdir)/df
qemu_speed_test_CFLAGS = \
$(WARN_CFLAGS) $(WERROR_CFLAGS)
qemu_speed_test_LDADD = \
- $(top_builddir)/src/libutils.la \
+ $(top_builddir)/common/utils/libutils.la \
$(top_builddir)/src/libguestfs.la \
$(LIBXML2_LIBS) \
$(LIBVIRT_LIBS) \
diff --git a/v2v/Makefile.am b/v2v/Makefile.am
index 1f32942..b0fe917 100644
--- a/v2v/Makefile.am
+++ b/v2v/Makefile.am
@@ -115,6 +115,7 @@ virt_v2v_CPPFLAGS = \
-I. \
-I$(top_builddir) \
-I$(shell $(OCAMLC) -where) \
+ -I$(top_srcdir)/common/utils \
-I$(top_srcdir)/src
virt_v2v_CFLAGS = \
$(WARN_CFLAGS) $(WERROR_CFLAGS) \
@@ -132,6 +133,7 @@ XOBJECTS = $(BOBJECTS:.cmo=.cmx)
# installed copy of libguestfs.
OCAMLPACKAGES = \
-package str,unix \
+ -I $(top_builddir)/common/utils/.libs \
-I $(top_builddir)/src/.libs \
-I $(top_builddir)/gnulib/lib/.libs \
-I $(top_builddir)/ocaml \
@@ -172,6 +174,7 @@ virt_v2v_copy_to_local_CPPFLAGS = \
-I. \
-I$(top_builddir) \
-I$(shell $(OCAMLC) -where) \
+ -I$(top_srcdir)/common/utils \
-I$(top_srcdir)/src
virt_v2v_copy_to_local_CFLAGS = \
$(WARN_CFLAGS) $(WERROR_CFLAGS) \
diff --git a/v2v/input_libvirtxml.ml b/v2v/input_libvirtxml.ml
index f2866aa..b19ac79 100644
--- a/v2v/input_libvirtxml.ml
+++ b/v2v/input_libvirtxml.ml
@@ -35,7 +35,7 @@ and parsed_source =
| P_dont_rewrite
(* Turn string like "hda" into controller slot number. See also
- * src/utils.c:guestfs_int_drive_index which this function calls.
+ * common/utils/utils.c:guestfs_int_drive_index which this function calls.
*)
let get_drive_slot str offset =
let len = String.length str in
diff --git a/v2v/test-harness/Makefile.am b/v2v/test-harness/Makefile.am
index 1a1a1a7..e2ba15c 100644
--- a/v2v/test-harness/Makefile.am
+++ b/v2v/test-harness/Makefile.am
@@ -38,6 +38,7 @@ if HAVE_OCAML_PKG_LIBVIRT
# installed copy of libguestfs.
OCAMLPACKAGES = \
-package str,unix,libvirt \
+ -I $(top_builddir)/common/utils/.libs \
-I $(top_builddir)/src/.libs \
-I $(top_builddir)/gnulib/lib/.libs \
-I $(top_builddir)/ocaml \
@@ -71,6 +72,7 @@ noinst_LIBRARIES = libv2vth.a
libv2vth_a_CPPFLAGS = \
-DGUESTFS_PRIVATE=1 \
-I$(top_builddir) -I$(OCAMLLIB) -I$(top_srcdir)/ocaml \
+ -I$(top_srcdir)/common/utils -I$(top_builddir)/common/utils \
-I$(top_srcdir)/src -I$(top_builddir)/src \
-I$(top_srcdir)/gnulib/lib -I$(top_builddir)/gnulib/lib
diff --git a/v2v/utils.ml b/v2v/utils.ml
index 1b48974..17ad8a2 100644
--- a/v2v/utils.ml
+++ b/v2v/utils.ml
@@ -51,7 +51,7 @@ let qemu_supports_sound_card = function
(* Find the UEFI firmware. *)
let find_uefi_firmware guest_arch =
let files =
- (* The lists of firmware are actually defined in src/uefi.c. *)
+ (* The lists of firmware are actually defined in common/utils/uefi.c. *)
match guest_arch with
| "i386" | "i486" | "i586" | "i686" ->
Uefi.uefi_i386_firmware
| "x86_64" -> Uefi.uefi_x86_64_firmware
--
2.9.3