Pino Toscano
2014-Nov-04 15:35 UTC
[Libguestfs] [PATCH 0/9] Small bits of non-Linux porting - #2
Hi, continuing what started a couple of weeks ago [1], the attached patch series continues the work in making it easier to build and run libguestfs (in fixed appliance mode) on OSes different than Linux. The provided changes should cause no functional changes on Linux. [1] https://www.redhat.com/archives/libguestfs/2014-October/msg00176.html Thanks, -- Pino Pino Toscano (9): build: check for UNIX_PATH_MAX, and properly define it if not src: launch: cast the sockaddr args to sockaddr* build: check for libintl, and use it builder: fix inclusion of <config.h> in lex-generated source build: isolate the libdb tools search in an own autoconf macro test-charset-fidelity: use and link against gnulib python: fix detection of libpython features ruby: fix detection of ruby library tests/qemu: isolate MD5 calculation in an own shared function align/Makefile.am | 1 + builder/Makefile.am | 2 ++ builder/index-scan.l | 4 ++- cat/Makefile.am | 4 +++ configure.ac | 51 ++++++++++++++++++++++++++--------- customize/Makefile.am | 2 +- df/Makefile.am | 1 + diff/Makefile.am | 1 + edit/Makefile.am | 1 + erlang/Makefile.am | 1 + fish/Makefile.am | 1 + format/Makefile.am | 1 + fuse/Makefile.am | 4 +++ inspector/Makefile.am | 1 + m4/guestfs-find-db-tool.m4 | 42 +++++++++++++++++++++++++++++ make-fs/Makefile.am | 1 + mllib/Makefile.am | 2 +- ocaml/Makefile.am | 2 ++ rescue/Makefile.am | 1 + resize/Makefile.am | 2 +- src/Makefile.am | 6 +++-- src/guestfs-internal-all.h | 6 ----- src/launch-direct.c | 3 ++- src/launch-libvirt.c | 5 ++-- src/launch-unix.c | 2 +- sysprep/Makefile.am | 2 +- test-tool/Makefile.am | 1 + tests/c-api/Makefile.am | 4 +++ tests/charsets/Makefile.am | 5 +++- tests/events/Makefile.am | 1 + tests/qemu/Makefile.am | 3 +++ tests/qemu/guestfs-md5.sh | 30 +++++++++++++++++++++ tests/qemu/qemu-liveness.sh | 6 +++-- tests/qemu/qemu-snapshot-isolation.sh | 14 +++++----- v2v/link.sh.in | 2 +- 35 files changed, 175 insertions(+), 40 deletions(-) create mode 100644 m4/guestfs-find-db-tool.m4 create mode 100755 tests/qemu/guestfs-md5.sh -- 1.9.3
Pino Toscano
2014-Nov-04 15:35 UTC
[Libguestfs] [PATCH 1/9] build: check for UNIX_PATH_MAX, and properly define it if not
Do a configure check to see whether UNIX_PATH_MAX is defined; if it is not defined, provide it with the size of sun_path in the struct sockaddr_un, thus with the proper size for any libc. --- configure.ac | 24 ++++++++++++++++++++++++ src/guestfs-internal-all.h | 6 ------ 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/configure.ac b/configure.ac index 5de624e..dd7a70b 100644 --- a/configure.ac +++ b/configure.ac @@ -328,6 +328,30 @@ AC_CHECK_FUNCS([\ statvfs \ sync]) +dnl Check for UNIX_PATH_MAX, creating a custom one if not available. +AC_MSG_CHECKING([for UNIX_PATH_MAX]) +AC_COMPILE_IFELSE([ + AC_LANG_PROGRAM([[ +#include <sys/un.h> + ]], [[ +#ifndef UNIX_PATH_MAX +#error UNIX_PATH_MAX not defined +#endif + ]])], [ + AC_MSG_RESULT([yes]) + ], [ + AC_MSG_RESULT([no]) + AC_MSG_CHECKING([for size of sockaddr_un.sun_path]) + AC_COMPUTE_INT(unix_path_max, [sizeof (myaddr.sun_path)], [ +#include <sys/un.h> +struct sockaddr_un myaddr; + ], [ + AC_MSG_ERROR([cannot get it]) + ]) + AC_MSG_RESULT([$unix_path_max]) + AC_DEFINE_UNQUOTED([UNIX_PATH_MAX], $unix_path_max, [Custom value for UNIX_PATH_MAX]) + ]) + dnl tgetent, tputs and UP [sic] are all required. They come from libtinfo dnl which is pulled in as a dependency of libncurses. old_LIBS="$LIBS" diff --git a/src/guestfs-internal-all.h b/src/guestfs-internal-all.h index 23c3490..84b8fd6 100644 --- a/src/guestfs-internal-all.h +++ b/src/guestfs-internal-all.h @@ -53,12 +53,6 @@ #define SOCK_CLOEXEC 0 #endif -#ifdef __APPLE__ -#define UNIX_PATH_MAX 104 -#else -#define UNIX_PATH_MAX 108 -#endif - #ifndef MAX #define MAX(a,b) ((a)>(b)?(a):(b)) #endif -- 1.9.3
Pino Toscano
2014-Nov-04 15:35 UTC
[Libguestfs] [PATCH 2/9] src: launch: cast the sockaddr args to sockaddr*
This matches what generally done for passing socket addresses to e.g. socket and bind, and already done in other parts of libguestfs. --- src/launch-direct.c | 3 ++- src/launch-libvirt.c | 5 +++-- src/launch-unix.c | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/launch-direct.c b/src/launch-direct.c index 021df94..d81dcd7 100644 --- a/src/launch-direct.c +++ b/src/launch-direct.c @@ -341,7 +341,8 @@ launch_direct (guestfs_h *g, void *datav, const char *arg) strncpy (addr.sun_path, guestfsd_sock, UNIX_PATH_MAX); addr.sun_path[UNIX_PATH_MAX-1] = '\0'; - if (bind (daemon_accept_sock, &addr, sizeof addr) == -1) { + if (bind (daemon_accept_sock, (struct sockaddr *) &addr, + sizeof addr) == -1) { perrorf (g, "bind"); goto cleanup0; } diff --git a/src/launch-libvirt.c b/src/launch-libvirt.c index 26d3202..1f3c451 100644 --- a/src/launch-libvirt.c +++ b/src/launch-libvirt.c @@ -404,7 +404,8 @@ launch_libvirt (guestfs_h *g, void *datav, const char *libvirt_uri) addr.sun_family = AF_UNIX; memcpy (addr.sun_path, params.guestfsd_path, UNIX_PATH_MAX); - if (bind (daemon_accept_sock, &addr, sizeof addr) == -1) { + if (bind (daemon_accept_sock, (struct sockaddr *) &addr, + sizeof addr) == -1) { perrorf (g, "bind"); goto cleanup; } @@ -428,7 +429,7 @@ launch_libvirt (guestfs_h *g, void *datav, const char *libvirt_uri) addr.sun_family = AF_UNIX; memcpy (addr.sun_path, params.console_path, UNIX_PATH_MAX); - if (bind (console_sock, &addr, sizeof addr) == -1) { + if (bind (console_sock, (struct sockaddr *) &addr, sizeof addr) == -1) { perrorf (g, "bind"); goto cleanup; } diff --git a/src/launch-unix.c b/src/launch-unix.c index c5e4438..ac165a8 100644 --- a/src/launch-unix.c +++ b/src/launch-unix.c @@ -63,7 +63,7 @@ launch_unix (guestfs_h *g, void *datav, const char *sockpath) g->state = LAUNCHING; - if (connect (daemon_sock, &addr, sizeof addr) == -1) { + if (connect (daemon_sock, (struct sockaddr *) &addr, sizeof addr) == -1) { perrorf (g, "bind"); goto cleanup; } -- 1.9.3
Pino Toscano
2014-Nov-04 15:35 UTC
[Libguestfs] [PATCH 3/9] build: check for libintl, and use it
Look for libint/gettext and link to it; this properly detects whether libint is part of libc. --- align/Makefile.am | 1 + builder/Makefile.am | 2 ++ cat/Makefile.am | 4 ++++ configure.ac | 3 +++ customize/Makefile.am | 2 +- df/Makefile.am | 1 + diff/Makefile.am | 1 + edit/Makefile.am | 1 + erlang/Makefile.am | 1 + fish/Makefile.am | 1 + format/Makefile.am | 1 + fuse/Makefile.am | 4 ++++ inspector/Makefile.am | 1 + make-fs/Makefile.am | 1 + mllib/Makefile.am | 2 +- ocaml/Makefile.am | 2 ++ rescue/Makefile.am | 1 + resize/Makefile.am | 2 +- src/Makefile.am | 6 ++++-- sysprep/Makefile.am | 2 +- test-tool/Makefile.am | 1 + tests/c-api/Makefile.am | 4 ++++ tests/charsets/Makefile.am | 3 ++- tests/events/Makefile.am | 1 + tests/qemu/Makefile.am | 2 ++ v2v/link.sh.in | 2 +- 26 files changed, 44 insertions(+), 8 deletions(-) diff --git a/align/Makefile.am b/align/Makefile.am index 4ecbf7e..92b86b7 100644 --- a/align/Makefile.am +++ b/align/Makefile.am @@ -68,6 +68,7 @@ virt_alignment_scan_LDADD = \ $(top_builddir)/src/libguestfs.la \ $(LIBXML2_LIBS) \ $(LIBVIRT_LIBS) \ + $(LTLIBINTL) \ ../gnulib/lib/libgnu.la \ -lm diff --git a/builder/Makefile.am b/builder/Makefile.am index 206abce..f747fc3 100644 --- a/builder/Makefile.am +++ b/builder/Makefile.am @@ -168,6 +168,7 @@ OCAMLOPTFLAGS = $(OCAMLCFLAGS) OCAMLCLIBS = \ $(LIBLZMA_LIBS) \ $(LIBXML2_LIBS) \ + $(LIBINTL) \ -L../src/.libs -lutils \ -L../gnulib/lib/.libs -lgnu \ -pthread -lpthread \ @@ -299,6 +300,7 @@ virt_index_validate_CPPFLAGS = \ -DLOCALEBASEDIR=\""$(datadir)/locale"\" virt_index_validate_LDADD = \ + $(LTLIBINTL) \ ../gnulib/lib/libgnu.la man_MANS += virt-index-validate.1 diff --git a/cat/Makefile.am b/cat/Makefile.am index 14b8e81..e4d9a36 100644 --- a/cat/Makefile.am +++ b/cat/Makefile.am @@ -66,6 +66,7 @@ virt_cat_LDADD = \ $(top_builddir)/src/libguestfs.la \ $(LIBXML2_LIBS) \ $(LIBVIRT_LIBS) \ + $(LTLIBINTL) \ ../gnulib/lib/libgnu.la virt_filesystems_SOURCES = \ @@ -88,6 +89,7 @@ virt_filesystems_LDADD = \ $(top_builddir)/src/libguestfs.la \ $(LIBXML2_LIBS) \ $(LIBVIRT_LIBS) \ + $(LTLIBINTL) \ ../gnulib/lib/libgnu.la virt_log_SOURCES = \ @@ -110,6 +112,7 @@ virt_log_LDADD = \ $(top_builddir)/src/libguestfs.la \ $(LIBXML2_LIBS) \ $(LIBVIRT_LIBS) \ + $(LTLIBINTL) \ ../gnulib/lib/libgnu.la virt_ls_SOURCES = \ @@ -134,6 +137,7 @@ virt_ls_LDADD = \ $(top_builddir)/src/libguestfs.la \ $(LIBXML2_LIBS) \ $(LIBVIRT_LIBS) \ + $(LTLIBINTL) \ ../gnulib/lib/libgnu.la # Manual pages and HTML files for the website. diff --git a/configure.ac b/configure.ac index dd7a70b..5f3828d 100644 --- a/configure.ac +++ b/configure.ac @@ -383,6 +383,9 @@ AC_MSG_RESULT([$msgfmt_is_gnu]) AM_CONDITIONAL([HAVE_GNU_GETTEXT], [test "x$XGETTEXT" != "xno" && test "x$MSGCAT" != "xno" && test "x$MSGFMT" != "xno" && test "x$MSGMERGE" != "xno" && test "x$msgfmt_is_gnu" != "xno"]) +dnl Check for gettext. +AM_GNU_GETTEXT([external]) + dnl Default backend. AC_MSG_CHECKING([if the user specified a default backend]) AC_ARG_WITH([default-backend], diff --git a/customize/Makefile.am b/customize/Makefile.am index 56c5ad5..c945685 100644 --- a/customize/Makefile.am +++ b/customize/Makefile.am @@ -124,7 +124,7 @@ OCAMLCFLAGS = $(OCAML_FLAGS) $(OCAML_WARN_ERROR) $(OCAMLPACKAGES) OCAMLOPTFLAGS = $(OCAMLCFLAGS) OCAMLCLIBS = \ - $(LIBXML2_LIBS) -lncurses -lcrypt \ + $(LIBXML2_LIBS) $(LIBINTL) -lncurses -lcrypt \ -L../src/.libs -lutils \ -L../gnulib/lib/.libs -lgnu diff --git a/df/Makefile.am b/df/Makefile.am index 29e0bf5..e56ac79 100644 --- a/df/Makefile.am +++ b/df/Makefile.am @@ -71,6 +71,7 @@ virt_df_LDADD = \ $(top_builddir)/src/libguestfs.la \ $(LIBXML2_LIBS) \ $(LIBVIRT_LIBS) \ + $(LTLIBINTL) \ ../gnulib/lib/libgnu.la \ -lm diff --git a/diff/Makefile.am b/diff/Makefile.am index 3c2c211..65a8a30 100644 --- a/diff/Makefile.am +++ b/diff/Makefile.am @@ -56,6 +56,7 @@ virt_diff_LDADD = \ $(top_builddir)/src/libguestfs.la \ $(LIBXML2_LIBS) \ $(LIBVIRT_LIBS) \ + $(LTLIBINTL) \ ../gnulib/lib/libgnu.la # Manual pages and HTML files for the website. diff --git a/edit/Makefile.am b/edit/Makefile.am index 9b1998b..1e94ac9 100644 --- a/edit/Makefile.am +++ b/edit/Makefile.am @@ -61,6 +61,7 @@ virt_edit_LDADD = \ $(top_builddir)/src/libguestfs.la \ $(LIBXML2_LIBS) \ $(LIBVIRT_LIBS) \ + $(LTLIBINTL) \ ../gnulib/lib/libgnu.la # Manual pages and HTML files for the website. diff --git a/erlang/Makefile.am b/erlang/Makefile.am index c68641c..5a1658c 100644 --- a/erlang/Makefile.am +++ b/erlang/Makefile.am @@ -71,6 +71,7 @@ erl_guestfs_LDADD = \ $(top_builddir)/src/libguestfs.la \ $(LIBXML2_LIBS) \ $(LIBVIRT_LIBS) \ + $(LTLIBINTL) \ ../gnulib/lib/libgnu.la TESTS_ENVIRONMENT = $(top_builddir)/run --test diff --git a/fish/Makefile.am b/fish/Makefile.am index e633422..30097ec 100644 --- a/fish/Makefile.am +++ b/fish/Makefile.am @@ -144,6 +144,7 @@ guestfish_LDADD = \ $(top_builddir)/src/libguestfs.la \ $(top_builddir)/src/libutils.la \ $(LIBXML2_LIBS) \ + $(LTLIBINTL) \ -lm # Make guestfish use the convenience libraries. diff --git a/format/Makefile.am b/format/Makefile.am index 178c391..276cfc3 100644 --- a/format/Makefile.am +++ b/format/Makefile.am @@ -57,6 +57,7 @@ virt_format_LDADD = \ $(top_builddir)/src/libguestfs.la \ $(LIBXML2_LIBS) \ $(LIBVIRT_LIBS) \ + $(LTLIBINTL) \ ../gnulib/lib/libgnu.la # Manual pages and HTML files for the website. diff --git a/fuse/Makefile.am b/fuse/Makefile.am index 1573361..574e4e0 100644 --- a/fuse/Makefile.am +++ b/fuse/Makefile.am @@ -71,6 +71,7 @@ guestmount_LDADD = \ $(top_builddir)/src/libguestfs.la \ $(LIBXML2_LIBS) \ $(LIBVIRT_LIBS) \ + $(LTLIBINTL) \ ../gnulib/lib/libgnu.la # guestunmount @@ -91,6 +92,7 @@ guestunmount_LDADD = \ $(top_builddir)/src/libguestfs.la \ $(LIBXML2_LIBS) \ $(LIBVIRT_LIBS) \ + $(LTLIBINTL) \ ../gnulib/lib/libgnu.la # Documentation. @@ -174,6 +176,7 @@ test_guestmount_fd_LDADD = \ $(top_builddir)/src/libguestfs.la \ $(LIBXML2_LIBS) \ $(LIBVIRT_LIBS) \ + $(LTLIBINTL) \ ../gnulib/lib/libgnu.la test_guestunmount_fd_SOURCES = \ @@ -191,6 +194,7 @@ test_guestunmount_fd_LDADD = \ $(top_builddir)/src/libguestfs.la \ $(LIBXML2_LIBS) \ $(LIBVIRT_LIBS) \ + $(LTLIBINTL) \ ../gnulib/lib/libgnu.la endif HAVE_FUSE diff --git a/inspector/Makefile.am b/inspector/Makefile.am index 86e0cd7..e1f5acd 100644 --- a/inspector/Makefile.am +++ b/inspector/Makefile.am @@ -84,6 +84,7 @@ virt_inspector_LDADD = \ $(top_builddir)/src/libguestfs.la \ $(LIBXML2_LIBS) \ $(LIBVIRT_LIBS) \ + $(LTLIBINTL) \ ../gnulib/lib/libgnu.la # Manual pages and HTML files for the website. diff --git a/make-fs/Makefile.am b/make-fs/Makefile.am index 03e30ba..ba1380e 100644 --- a/make-fs/Makefile.am +++ b/make-fs/Makefile.am @@ -50,6 +50,7 @@ virt_make_fs_LDADD = \ $(top_builddir)/src/libutils.la \ $(top_builddir)/src/libguestfs.la \ $(LIBXML2_LIBS) \ + $(LTLIBINTL) \ ../gnulib/lib/libgnu.la # Manual pages and HTML files for the website. diff --git a/mllib/Makefile.am b/mllib/Makefile.am index 2ad4eaa..567ff84 100644 --- a/mllib/Makefile.am +++ b/mllib/Makefile.am @@ -99,7 +99,7 @@ OCAMLCFLAGS = $(OCAML_FLAGS) $(OCAML_WARN_ERROR) $(OCAMLPACKAGES) OCAMLOPTFLAGS = $(OCAMLCFLAGS) OCAMLCLIBS = \ - $(LIBXML2_LIBS) -lncurses -lcrypt \ + $(LIBXML2_LIBS) $(LIBINTL) -lncurses -lcrypt \ -L../src/.libs -lutils \ -L../gnulib/lib/.libs -lgnu diff --git a/ocaml/Makefile.am b/ocaml/Makefile.am index 41270a6..9723af9 100644 --- a/ocaml/Makefile.am +++ b/ocaml/Makefile.am @@ -66,10 +66,12 @@ endif stamp-mlguestfs: libguestfsocaml.a $(guestfs_cmm) $(OCAMLMKLIB) -o mlguestfs \ $(libguestfsocaml_a_OBJECTS) guestfs.cmo \ + $(LTLIBINTL) \ -L$(top_builddir)/src/.libs -lguestfs if HAVE_OCAMLOPT $(OCAMLMKLIB) -o mlguestfs \ $(libguestfsocaml_a_OBJECTS) guestfs.cmx \ + $(LTLIBINTL) \ -L$(top_builddir)/src/.libs -lguestfs endif touch $@ diff --git a/rescue/Makefile.am b/rescue/Makefile.am index 505b327..f380f04 100644 --- a/rescue/Makefile.am +++ b/rescue/Makefile.am @@ -59,6 +59,7 @@ virt_rescue_LDADD = \ $(top_builddir)/src/libguestfs.la \ $(LIBXML2_LIBS) \ $(LIBVIRT_LIBS) \ + $(LTLIBINTL) \ ../gnulib/lib/libgnu.la # Manual pages and HTML files for the website. diff --git a/resize/Makefile.am b/resize/Makefile.am index 629fa22..3a7483c 100644 --- a/resize/Makefile.am +++ b/resize/Makefile.am @@ -71,7 +71,7 @@ OCAMLCFLAGS = $(OCAML_FLAGS) $(OCAML_WARN_ERROR) $(OCAMLPACKAGES) OCAMLOPTFLAGS = $(OCAMLCFLAGS) OCAMLCLIBS = \ - $(LIBXML2_LIBS) -lncurses \ + $(LIBXML2_LIBS) $(LIBINTL) -lncurses \ -L../src/.libs -lutils \ -L../gnulib/lib/.libs -lgnu diff --git a/src/Makefile.am b/src/Makefile.am index be8d3a3..a83f257 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -159,7 +159,7 @@ libguestfs_la_LIBADD = \ $(INET_NTOP_LIB) \ $(LIBSOCKET) \ $(LIB_CLOCK_GETTIME) \ - $(LIBINTL) \ + $(LTLIBINTL) \ $(LTLIBTHREAD) \ $(LTLIBICONV) \ $(SERVENT_LIB) @@ -238,7 +238,8 @@ noinst_PROGRAMS += libvirt-is-version libvirt_is_version_SOURCES = libvirt-is-version.c libvirt_is_version_LDADD = \ - $(LIBVIRT_LIBS) + $(LIBVIRT_LIBS) \ + $(LTLIBINTL) libvirt_is_version_CPPFLAGS = \ -DLOCALEBASEDIR=\""$(datadir)/locale"\" @@ -266,6 +267,7 @@ test_utils_CFLAGS = \ test_utils_LDADD = \ libguestfs_la-guid.lo \ libutils.la \ + $(LTLIBINTL) \ $(top_builddir)/gnulib/lib/libgnu.la check-valgrind: diff --git a/sysprep/Makefile.am b/sysprep/Makefile.am index 17fe612..58c63bb 100644 --- a/sysprep/Makefile.am +++ b/sysprep/Makefile.am @@ -136,7 +136,7 @@ OCAMLCFLAGS = $(OCAML_FLAGS) $(OCAML_WARN_ERROR) $(OCAMLPACKAGES) OCAMLOPTFLAGS = $(OCAMLCFLAGS) OCAMLCLIBS = \ - $(LIBXML2_LIBS) -lncurses -lcrypt \ + $(LIBXML2_LIBS) $(LIBINTL) -lncurses -lcrypt \ -L../src/.libs -lutils \ -L../gnulib/lib/.libs -lgnu diff --git a/test-tool/Makefile.am b/test-tool/Makefile.am index c0e958c..ca5b3ef 100644 --- a/test-tool/Makefile.am +++ b/test-tool/Makefile.am @@ -37,6 +37,7 @@ libguestfs_test_tool_CFLAGS = \ libguestfs_test_tool_LDADD = \ $(top_builddir)/src/libguestfs.la \ + $(LTLIBINTL) \ $(top_builddir)/gnulib/lib/libgnu.la libguestfs-test-tool.1 $(top_builddir)/html/libguestfs-test-tool.1.html: stamp-libguestfs-test-tool.pod diff --git a/tests/c-api/Makefile.am b/tests/c-api/Makefile.am index 6ea22e9..fed1923 100644 --- a/tests/c-api/Makefile.am +++ b/tests/c-api/Makefile.am @@ -90,6 +90,7 @@ tests_LDADD = \ $(top_builddir)/src/libguestfs.la \ $(LIBXML2_LIBS) \ $(LIBVIRT_LIBS) \ + $(LTLIBINTL) \ $(top_builddir)/gnulib/lib/libgnu.la # This binary must be statically linked. It is used for testing @@ -162,6 +163,7 @@ test_backend_settings_CFLAGS = \ $(WARN_CFLAGS) $(WERROR_CFLAGS) test_backend_settings_LDADD = \ $(top_builddir)/src/libutils_la-utils.lo \ + $(LTLIBINTL) \ $(top_builddir)/src/libguestfs.la test_private_data_SOURCES = test-private-data.c @@ -203,6 +205,7 @@ test_environment_CFLAGS = \ $(WARN_CFLAGS) $(WERROR_CFLAGS) test_environment_LDADD = \ $(top_builddir)/src/libguestfs.la \ + $(LTLIBINTL) \ $(top_builddir)/gnulib/lib/libgnu.la test_event_string_SOURCES = test-event-string.c @@ -214,6 +217,7 @@ test_event_string_CFLAGS = \ $(WARN_CFLAGS) $(WERROR_CFLAGS) test_event_string_LDADD = \ $(top_builddir)/src/libguestfs.la \ + $(LTLIBINTL) \ $(top_builddir)/gnulib/lib/libgnu.la #if HAVE_LIBVIRT diff --git a/tests/charsets/Makefile.am b/tests/charsets/Makefile.am index b7ec703..e71f76d 100644 --- a/tests/charsets/Makefile.am +++ b/tests/charsets/Makefile.am @@ -33,4 +33,5 @@ test_charset_fidelity_LDADD = \ $(top_builddir)/src/libutils.la \ $(top_builddir)/src/libguestfs.la \ $(LIBXML2_LIBS) \ - $(LIBVIRT_LIBS) + $(LIBVIRT_LIBS) \ + $(LTLIBINTL) diff --git a/tests/events/Makefile.am b/tests/events/Makefile.am index 9f31e9e..9bbe322 100644 --- a/tests/events/Makefile.am +++ b/tests/events/Makefile.am @@ -43,5 +43,6 @@ test_libvirt_auth_callbacks_LDADD = \ $(top_builddir)/src/libguestfs.la \ $(LIBVIRT_LIBS) \ $(LIBXML2_LIBS) \ + $(LTLIBINTL) \ $(top_builddir)/gnulib/lib/libgnu.la endif diff --git a/tests/qemu/Makefile.am b/tests/qemu/Makefile.am index b1b3555..e234063 100644 --- a/tests/qemu/Makefile.am +++ b/tests/qemu/Makefile.am @@ -55,6 +55,7 @@ qemu_boot_LDADD = \ $(top_builddir)/src/libguestfs.la \ $(LIBXML2_LIBS) \ $(LIBVIRT_LIBS) \ + $(LTLIBINTL) \ $(top_builddir)/gnulib/lib/libgnu.la qemu_speed_test_SOURCES = \ @@ -71,4 +72,5 @@ qemu_speed_test_LDADD = \ $(top_builddir)/src/libguestfs.la \ $(LIBXML2_LIBS) \ $(LIBVIRT_LIBS) \ + $(LTLIBINTL) \ $(top_builddir)/gnulib/lib/libgnu.la diff --git a/v2v/link.sh.in b/v2v/link.sh.in index a226947..d6313fe 100644 --- a/v2v/link.sh.in +++ b/v2v/link.sh.in @@ -19,4 +19,4 @@ # Hack automake to link binary properly. There is no other way to add # the -cclib parameter to the end of the command line. -exec "$@" -linkpkg -cclib '-lutils -lncurses -lcrypt @LIBVIRT_LIBS@ @LIBXML2_LIBS@ -lgnu' +exec "$@" -linkpkg -cclib '-lutils -lncurses -lcrypt @LIBVIRT_LIBS@ @LIBXML2_LIBS@ @LIBINTL@ -lgnu' -- 1.9.3
Pino Toscano
2014-Nov-04 15:35 UTC
[Libguestfs] [PATCH 4/9] builder: fix inclusion of <config.h> in lex-generated source
Use a %top block for including <config.h>, so it is included prior to any other include, even for system ones. This makes sure its definitions are properly used in gnulib replacement headers. --- builder/index-scan.l | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/builder/index-scan.l b/builder/index-scan.l index e3fe377..b5eade5 100644 --- a/builder/index-scan.l +++ b/builder/index-scan.l @@ -16,9 +16,11 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -%{ +%top{ #include <config.h> +} +%{ #include <stdio.h> #include <stdlib.h> #include <string.h> -- 1.9.3
Pino Toscano
2014-Nov-04 15:35 UTC
[Libguestfs] [PATCH 5/9] build: isolate the libdb tools search in an own autoconf macro
Create an autoconf macro to deal with the possible combinations of names and versions of the libdb tools. This also eases the addition of a libdb version, or a new pattern for the names of tools. There is no functional change. --- configure.ac | 6 ++---- m4/guestfs-find-db-tool.m4 | 42 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+), 4 deletions(-) create mode 100644 m4/guestfs-find-db-tool.m4 diff --git a/configure.ac b/configure.ac index 5f3828d..87e066c 100644 --- a/configure.ac +++ b/configure.ac @@ -682,10 +682,8 @@ AC_CHECK_PROG([PO4A],[po4a],[po4a],[no]) AM_CONDITIONAL([HAVE_PO4A], [test "x$PO4A" != "xno"]) dnl Check for db_dump, db_load (optional). -AC_PATH_PROGS([DB_DUMP], - [db_dump db5.1_dump db4_dump db4.8_dump db4.7_dump db4.6_dump],[no]) -AC_PATH_PROGS([DB_LOAD], - [db_load db5.1_load db4_load db4.8_load db4.7_load db4.6_load],[no]) +GUESTFS_FIND_DB_TOOL([DB_DUMP], [dump]) +GUESTFS_FIND_DB_TOOL([DB_LOAD], [load]) if test "x$DB_DUMP" != "xno"; then AC_DEFINE_UNQUOTED([DB_DUMP],["$DB_DUMP"],[Name of db_dump program.]) fi diff --git a/m4/guestfs-find-db-tool.m4 b/m4/guestfs-find-db-tool.m4 new file mode 100644 index 0000000..0cbbd13 --- /dev/null +++ b/m4/guestfs-find-db-tool.m4 @@ -0,0 +1,42 @@ +# libguestfs +# Copyright (C) 2014 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. + +AC_DEFUN([GUESTFS_FIND_DB_TOOL],[ + pushdef([VARIABLE],$1) + TOOL=$2 + + db_tool_name="db_$TOOL" + db_versions="5.1 4.8 4.7 4.6" + db_tool_patterns="db_$TOOL dbX_$TOOL dbX.Y_$TOOL" + + AC_ARG_VAR(VARIABLE, [Absolute path to $db_tool_name executable]) + + AS_IF(test -z "$VARIABLE", [ + exe_list="" + for ver in $db_versions ; do + ver_maj=`echo $ver | cut -d. -f1` + ver_min=`echo $ver | cut -d. -f2` + for pattern in $db_tool_patterns ; do + exe=`echo "$pattern" | sed -e "s/X/$ver_maj/g;s/Y/$ver_min/g"` + exe_list="$exe_list $exe" + done + done + AC_PATH_PROGS([]VARIABLE[], [$exe_list], [no]) + ]) + + popdef([VARIABLE]) +]) -- 1.9.3
Pino Toscano
2014-Nov-04 15:35 UTC
[Libguestfs] [PATCH 6/9] test-charset-fidelity: use and link against gnulib
It uses error() which is specific to GNU libc, but supplied by gnulib if not available. --- tests/charsets/Makefile.am | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/charsets/Makefile.am b/tests/charsets/Makefile.am index e71f76d..c1c6fdb 100644 --- a/tests/charsets/Makefile.am +++ b/tests/charsets/Makefile.am @@ -26,6 +26,7 @@ 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)/src -I$(top_builddir)/src test_charset_fidelity_CFLAGS = \ $(WARN_CFLAGS) $(WERROR_CFLAGS) @@ -34,4 +35,5 @@ test_charset_fidelity_LDADD = \ $(top_builddir)/src/libguestfs.la \ $(LIBXML2_LIBS) \ $(LIBVIRT_LIBS) \ - $(LTLIBINTL) + $(LTLIBINTL) \ + $(top_builddir)/gnulib/lib/libgnu.la -- 1.9.3
Pino Toscano
2014-Nov-04 15:35 UTC
[Libguestfs] [PATCH 7/9] python: fix detection of libpython features
Instead of querying distutils.sysconfig for the library name, just use the $PYTHON_LIBS returned by pkg-config. This makes sure the tests can link even with a libpython in a non-standard library directory. --- configure.ac | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/configure.ac b/configure.ac index 87e066c..1bf291c 100644 --- a/configure.ac +++ b/configure.ac @@ -1216,20 +1216,14 @@ AS_IF([test "x$enable_python" != "xno"],[ AC_MSG_RESULT([$PYTHON_EXT_SUFFIX]) dnl Look for some optional symbols in libpython. - old_LIBS="$LIBS" - - PYTHON_BLDLIBRARY=`$PYTHON -c "import distutils.sysconfig; \ - print (distutils.sysconfig.get_config_var('BLDLIBRARY'))"` AC_CHECK_LIB([c],[PyCapsule_New], [AC_DEFINE([HAVE_PYCAPSULE_NEW],1, [Found PyCapsule_New in libpython.])], - [],[$PYTHON_BLDLIBRARY]) + [],[$PYTHON_LIBS]) AC_CHECK_LIB([c],[PyString_AsString], [AC_DEFINE([HAVE_PYSTRING_ASSTRING],1, [Found PyString_AsString in libpython.])], - [],[$PYTHON_BLDLIBRARY]) - - LIBS="$old_LIBS" + [],[$PYTHON_LIBS]) fi AC_SUBST(PYTHON_PREFIX) -- 1.9.3
Pino Toscano
2014-Nov-04 15:35 UTC
[Libguestfs] [PATCH 8/9] ruby: fix detection of ruby library
Query RbConfig::CONFIG for "libdir", and use that when trying to link to the ruby library. This fixes the libruby detection when it is installed in a non-standard library directory. --- configure.ac | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 1bf291c..e3de428 100644 --- a/configure.ac +++ b/configure.ac @@ -1252,9 +1252,15 @@ AS_IF([test "x$enable_ruby" != "xno"],[ libruby="$(cat conftest)" rm conftest AS_IF([test -n "$libruby"],[ + ruby_cmd='puts RbConfig::CONFIG@<:@"libdir"@:>@' + echo running: $RUBY -rrbconfig -e \'$ruby_cmd\' >&AS_MESSAGE_LOG_FD + $RUBY -rrbconfig -e "$ruby_cmd" >conftest 2>&AS_MESSAGE_LOG_FD + libruby_libdir="$(cat conftest)" + rm conftest + test -n "$libruby_libdir" && libruby_libdir="-L$libruby_libdir" AC_MSG_RESULT([-l$libruby]) AC_CHECK_LIB([$libruby],[ruby_init], - [have_libruby=1],[have_libruby=]) + [have_libruby=1],[have_libruby=],[$libruby_libdir]) ],[ AC_MSG_RESULT([not found]) ]) -- 1.9.3
Pino Toscano
2014-Nov-04 15:35 UTC
[Libguestfs] [PATCH 9/9] tests/qemu: isolate MD5 calculation in an own shared function
md5sum(1) does not exist everywhere, so wrap it in an own function so the right implementation can be chosen on each OS. Also, wrapping it avoid using awk everytime. --- tests/qemu/Makefile.am | 1 + tests/qemu/guestfs-md5.sh | 30 ++++++++++++++++++++++++++++++ tests/qemu/qemu-liveness.sh | 6 ++++-- tests/qemu/qemu-snapshot-isolation.sh | 14 ++++++++------ 4 files changed, 43 insertions(+), 8 deletions(-) create mode 100755 tests/qemu/guestfs-md5.sh diff --git a/tests/qemu/Makefile.am b/tests/qemu/Makefile.am index e234063..478b3f1 100644 --- a/tests/qemu/Makefile.am +++ b/tests/qemu/Makefile.am @@ -30,6 +30,7 @@ TESTS_ENVIRONMENT = $(top_builddir)/run --test EXTRA_DIST = \ $(TESTS) \ + guestfs-md5.sh \ qemu-boot.c \ qemu-speed-test.c diff --git a/tests/qemu/guestfs-md5.sh b/tests/qemu/guestfs-md5.sh new file mode 100755 index 0000000..79dbd67 --- /dev/null +++ b/tests/qemu/guestfs-md5.sh @@ -0,0 +1,30 @@ +#!/bin/bash - +# libguestfs +# Copyright (C) 2014 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. + +do_md5 () +{ + case "$(uname)" in + Linux) + md5sum "$1" | awk '{print $1}' + ;; + *) + echo "$0: unknown method to calculate MD5 of file on $(uname)" + exit 1 + ;; + esac +} diff --git a/tests/qemu/qemu-liveness.sh b/tests/qemu/qemu-liveness.sh index 4db71bd..7129bb2 100755 --- a/tests/qemu/qemu-liveness.sh +++ b/tests/qemu/qemu-liveness.sh @@ -22,10 +22,12 @@ set -e +. $srcdir/guestfs-md5.sh + rm -f liveness1.img guestfish sparse liveness1.img 100M -liveness1_md5sum="$(md5sum liveness1.img | awk '{print $1}')" +liveness1_md5sum="$(do_md5 liveness1.img)" guestfish <<'EOF' add liveness1.img format:raw @@ -41,7 +43,7 @@ write /test "This is a test" EOF # Verify that the disk has changed. -if [ "$(md5sum liveness1.img | awk '{print $1}')" = "$liveness1_md5sum" ]; then +if [ "$(do_md5 liveness1.img)" = "$liveness1_md5sum" ]; then echo "***** ERROR *****" echo "Write operations are not modifying an attached disk." echo diff --git a/tests/qemu/qemu-snapshot-isolation.sh b/tests/qemu/qemu-snapshot-isolation.sh index daa210f..c217dc4 100755 --- a/tests/qemu/qemu-snapshot-isolation.sh +++ b/tests/qemu/qemu-snapshot-isolation.sh @@ -22,6 +22,8 @@ set -e +. $srcdir/guestfs-md5.sh + # UML backend doesn't support qcow2 format. supports_qcow2=yes if [ "$(guestfish get-backend)" = "uml" ]; then @@ -31,14 +33,14 @@ fi rm -f isolation1.img isolation2.img isolation3.img guestfish sparse isolation1.img 100M -isolation1_md5sum="$(md5sum isolation1.img | awk '{print $1}')" +isolation1_md5sum="$(do_md5 isolation1.img)" guestfish sparse isolation2.img 100M -isolation2_md5sum="$(md5sum isolation2.img | awk '{print $1}')" +isolation2_md5sum="$(do_md5 isolation2.img)" if [ "$supports_qcow2" = "yes" ]; then guestfish \ disk-create isolation3.img qcow2 100M preallocation:metadata - isolation3_md5sum="$(md5sum isolation3.img | awk '{print $1}')" + isolation3_md5sum="$(do_md5 isolation3.img)" add3="add-drive-opts isolation3.img format:qcow2 readonly:true" cmds3=" part-disk /dev/sdc mbr @@ -92,14 +94,14 @@ function serious_error exit 1 } -if [ "$(md5sum isolation1.img | awk '{print $1}')" != "$isolation1_md5sum" ]; then +if [ "$(do_md5 isolation1.img)" != "$isolation1_md5sum" ]; then serious_error fi -if [ "$(md5sum isolation2.img | awk '{print $1}')" != "$isolation2_md5sum" ]; then +if [ "$(do_md5 isolation2.img)" != "$isolation2_md5sum" ]; then serious_error fi if [ "$supports_qcow2" = "yes" -a \ - "$(md5sum isolation3.img | awk '{print $1}')" != "$isolation3_md5sum" ]; then + "$(do_md5 isolation3.img)" != "$isolation3_md5sum" ]; then serious_error fi -- 1.9.3
Richard W.M. Jones
2014-Nov-04 16:09 UTC
Re: [Libguestfs] [PATCH 3/9] build: check for libintl, and use it
On Tue, Nov 04, 2014 at 04:35:26PM +0100, Pino Toscano wrote:> Look for libint/gettext and link to it; this properly detects whether > libint is part of libc.I'm a little confused by this patch, and also worried that it may be reverting commit 75514ab57a. Does this require gettextize? Rich.> --- > align/Makefile.am | 1 + > builder/Makefile.am | 2 ++ > cat/Makefile.am | 4 ++++ > configure.ac | 3 +++ > customize/Makefile.am | 2 +- > df/Makefile.am | 1 + > diff/Makefile.am | 1 + > edit/Makefile.am | 1 + > erlang/Makefile.am | 1 + > fish/Makefile.am | 1 + > format/Makefile.am | 1 + > fuse/Makefile.am | 4 ++++ > inspector/Makefile.am | 1 + > make-fs/Makefile.am | 1 + > mllib/Makefile.am | 2 +- > ocaml/Makefile.am | 2 ++ > rescue/Makefile.am | 1 + > resize/Makefile.am | 2 +- > src/Makefile.am | 6 ++++-- > sysprep/Makefile.am | 2 +- > test-tool/Makefile.am | 1 + > tests/c-api/Makefile.am | 4 ++++ > tests/charsets/Makefile.am | 3 ++- > tests/events/Makefile.am | 1 + > tests/qemu/Makefile.am | 2 ++ > v2v/link.sh.in | 2 +- > 26 files changed, 44 insertions(+), 8 deletions(-) > > diff --git a/align/Makefile.am b/align/Makefile.am > index 4ecbf7e..92b86b7 100644 > --- a/align/Makefile.am > +++ b/align/Makefile.am > @@ -68,6 +68,7 @@ virt_alignment_scan_LDADD = \ > $(top_builddir)/src/libguestfs.la \ > $(LIBXML2_LIBS) \ > $(LIBVIRT_LIBS) \ > + $(LTLIBINTL) \ > ../gnulib/lib/libgnu.la \ > -lm > > diff --git a/builder/Makefile.am b/builder/Makefile.am > index 206abce..f747fc3 100644 > --- a/builder/Makefile.am > +++ b/builder/Makefile.am > @@ -168,6 +168,7 @@ OCAMLOPTFLAGS = $(OCAMLCFLAGS) > OCAMLCLIBS = \ > $(LIBLZMA_LIBS) \ > $(LIBXML2_LIBS) \ > + $(LIBINTL) \ > -L../src/.libs -lutils \ > -L../gnulib/lib/.libs -lgnu \ > -pthread -lpthread \ > @@ -299,6 +300,7 @@ virt_index_validate_CPPFLAGS = \ > -DLOCALEBASEDIR=\""$(datadir)/locale"\" > > virt_index_validate_LDADD = \ > + $(LTLIBINTL) \ > ../gnulib/lib/libgnu.la > > man_MANS += virt-index-validate.1 > diff --git a/cat/Makefile.am b/cat/Makefile.am > index 14b8e81..e4d9a36 100644 > --- a/cat/Makefile.am > +++ b/cat/Makefile.am > @@ -66,6 +66,7 @@ virt_cat_LDADD = \ > $(top_builddir)/src/libguestfs.la \ > $(LIBXML2_LIBS) \ > $(LIBVIRT_LIBS) \ > + $(LTLIBINTL) \ > ../gnulib/lib/libgnu.la > > virt_filesystems_SOURCES = \ > @@ -88,6 +89,7 @@ virt_filesystems_LDADD = \ > $(top_builddir)/src/libguestfs.la \ > $(LIBXML2_LIBS) \ > $(LIBVIRT_LIBS) \ > + $(LTLIBINTL) \ > ../gnulib/lib/libgnu.la > > virt_log_SOURCES = \ > @@ -110,6 +112,7 @@ virt_log_LDADD = \ > $(top_builddir)/src/libguestfs.la \ > $(LIBXML2_LIBS) \ > $(LIBVIRT_LIBS) \ > + $(LTLIBINTL) \ > ../gnulib/lib/libgnu.la > > virt_ls_SOURCES = \ > @@ -134,6 +137,7 @@ virt_ls_LDADD = \ > $(top_builddir)/src/libguestfs.la \ > $(LIBXML2_LIBS) \ > $(LIBVIRT_LIBS) \ > + $(LTLIBINTL) \ > ../gnulib/lib/libgnu.la > > # Manual pages and HTML files for the website. > diff --git a/configure.ac b/configure.ac > index dd7a70b..5f3828d 100644 > --- a/configure.ac > +++ b/configure.ac > @@ -383,6 +383,9 @@ AC_MSG_RESULT([$msgfmt_is_gnu]) > AM_CONDITIONAL([HAVE_GNU_GETTEXT], > [test "x$XGETTEXT" != "xno" && test "x$MSGCAT" != "xno" && test "x$MSGFMT" != "xno" && test "x$MSGMERGE" != "xno" && test "x$msgfmt_is_gnu" != "xno"]) > > +dnl Check for gettext. > +AM_GNU_GETTEXT([external]) > + > dnl Default backend. > AC_MSG_CHECKING([if the user specified a default backend]) > AC_ARG_WITH([default-backend], > diff --git a/customize/Makefile.am b/customize/Makefile.am > index 56c5ad5..c945685 100644 > --- a/customize/Makefile.am > +++ b/customize/Makefile.am > @@ -124,7 +124,7 @@ OCAMLCFLAGS = $(OCAML_FLAGS) $(OCAML_WARN_ERROR) $(OCAMLPACKAGES) > OCAMLOPTFLAGS = $(OCAMLCFLAGS) > > OCAMLCLIBS = \ > - $(LIBXML2_LIBS) -lncurses -lcrypt \ > + $(LIBXML2_LIBS) $(LIBINTL) -lncurses -lcrypt \ > -L../src/.libs -lutils \ > -L../gnulib/lib/.libs -lgnu > > diff --git a/df/Makefile.am b/df/Makefile.am > index 29e0bf5..e56ac79 100644 > --- a/df/Makefile.am > +++ b/df/Makefile.am > @@ -71,6 +71,7 @@ virt_df_LDADD = \ > $(top_builddir)/src/libguestfs.la \ > $(LIBXML2_LIBS) \ > $(LIBVIRT_LIBS) \ > + $(LTLIBINTL) \ > ../gnulib/lib/libgnu.la \ > -lm > > diff --git a/diff/Makefile.am b/diff/Makefile.am > index 3c2c211..65a8a30 100644 > --- a/diff/Makefile.am > +++ b/diff/Makefile.am > @@ -56,6 +56,7 @@ virt_diff_LDADD = \ > $(top_builddir)/src/libguestfs.la \ > $(LIBXML2_LIBS) \ > $(LIBVIRT_LIBS) \ > + $(LTLIBINTL) \ > ../gnulib/lib/libgnu.la > > # Manual pages and HTML files for the website. > diff --git a/edit/Makefile.am b/edit/Makefile.am > index 9b1998b..1e94ac9 100644 > --- a/edit/Makefile.am > +++ b/edit/Makefile.am > @@ -61,6 +61,7 @@ virt_edit_LDADD = \ > $(top_builddir)/src/libguestfs.la \ > $(LIBXML2_LIBS) \ > $(LIBVIRT_LIBS) \ > + $(LTLIBINTL) \ > ../gnulib/lib/libgnu.la > > # Manual pages and HTML files for the website. > diff --git a/erlang/Makefile.am b/erlang/Makefile.am > index c68641c..5a1658c 100644 > --- a/erlang/Makefile.am > +++ b/erlang/Makefile.am > @@ -71,6 +71,7 @@ erl_guestfs_LDADD = \ > $(top_builddir)/src/libguestfs.la \ > $(LIBXML2_LIBS) \ > $(LIBVIRT_LIBS) \ > + $(LTLIBINTL) \ > ../gnulib/lib/libgnu.la > > TESTS_ENVIRONMENT = $(top_builddir)/run --test > diff --git a/fish/Makefile.am b/fish/Makefile.am > index e633422..30097ec 100644 > --- a/fish/Makefile.am > +++ b/fish/Makefile.am > @@ -144,6 +144,7 @@ guestfish_LDADD = \ > $(top_builddir)/src/libguestfs.la \ > $(top_builddir)/src/libutils.la \ > $(LIBXML2_LIBS) \ > + $(LTLIBINTL) \ > -lm > > # Make guestfish use the convenience libraries. > diff --git a/format/Makefile.am b/format/Makefile.am > index 178c391..276cfc3 100644 > --- a/format/Makefile.am > +++ b/format/Makefile.am > @@ -57,6 +57,7 @@ virt_format_LDADD = \ > $(top_builddir)/src/libguestfs.la \ > $(LIBXML2_LIBS) \ > $(LIBVIRT_LIBS) \ > + $(LTLIBINTL) \ > ../gnulib/lib/libgnu.la > > # Manual pages and HTML files for the website. > diff --git a/fuse/Makefile.am b/fuse/Makefile.am > index 1573361..574e4e0 100644 > --- a/fuse/Makefile.am > +++ b/fuse/Makefile.am > @@ -71,6 +71,7 @@ guestmount_LDADD = \ > $(top_builddir)/src/libguestfs.la \ > $(LIBXML2_LIBS) \ > $(LIBVIRT_LIBS) \ > + $(LTLIBINTL) \ > ../gnulib/lib/libgnu.la > > # guestunmount > @@ -91,6 +92,7 @@ guestunmount_LDADD = \ > $(top_builddir)/src/libguestfs.la \ > $(LIBXML2_LIBS) \ > $(LIBVIRT_LIBS) \ > + $(LTLIBINTL) \ > ../gnulib/lib/libgnu.la > > # Documentation. > @@ -174,6 +176,7 @@ test_guestmount_fd_LDADD = \ > $(top_builddir)/src/libguestfs.la \ > $(LIBXML2_LIBS) \ > $(LIBVIRT_LIBS) \ > + $(LTLIBINTL) \ > ../gnulib/lib/libgnu.la > > test_guestunmount_fd_SOURCES = \ > @@ -191,6 +194,7 @@ test_guestunmount_fd_LDADD = \ > $(top_builddir)/src/libguestfs.la \ > $(LIBXML2_LIBS) \ > $(LIBVIRT_LIBS) \ > + $(LTLIBINTL) \ > ../gnulib/lib/libgnu.la > > endif HAVE_FUSE > diff --git a/inspector/Makefile.am b/inspector/Makefile.am > index 86e0cd7..e1f5acd 100644 > --- a/inspector/Makefile.am > +++ b/inspector/Makefile.am > @@ -84,6 +84,7 @@ virt_inspector_LDADD = \ > $(top_builddir)/src/libguestfs.la \ > $(LIBXML2_LIBS) \ > $(LIBVIRT_LIBS) \ > + $(LTLIBINTL) \ > ../gnulib/lib/libgnu.la > > # Manual pages and HTML files for the website. > diff --git a/make-fs/Makefile.am b/make-fs/Makefile.am > index 03e30ba..ba1380e 100644 > --- a/make-fs/Makefile.am > +++ b/make-fs/Makefile.am > @@ -50,6 +50,7 @@ virt_make_fs_LDADD = \ > $(top_builddir)/src/libutils.la \ > $(top_builddir)/src/libguestfs.la \ > $(LIBXML2_LIBS) \ > + $(LTLIBINTL) \ > ../gnulib/lib/libgnu.la > > # Manual pages and HTML files for the website. > diff --git a/mllib/Makefile.am b/mllib/Makefile.am > index 2ad4eaa..567ff84 100644 > --- a/mllib/Makefile.am > +++ b/mllib/Makefile.am > @@ -99,7 +99,7 @@ OCAMLCFLAGS = $(OCAML_FLAGS) $(OCAML_WARN_ERROR) $(OCAMLPACKAGES) > OCAMLOPTFLAGS = $(OCAMLCFLAGS) > > OCAMLCLIBS = \ > - $(LIBXML2_LIBS) -lncurses -lcrypt \ > + $(LIBXML2_LIBS) $(LIBINTL) -lncurses -lcrypt \ > -L../src/.libs -lutils \ > -L../gnulib/lib/.libs -lgnu > > diff --git a/ocaml/Makefile.am b/ocaml/Makefile.am > index 41270a6..9723af9 100644 > --- a/ocaml/Makefile.am > +++ b/ocaml/Makefile.am > @@ -66,10 +66,12 @@ endif > stamp-mlguestfs: libguestfsocaml.a $(guestfs_cmm) > $(OCAMLMKLIB) -o mlguestfs \ > $(libguestfsocaml_a_OBJECTS) guestfs.cmo \ > + $(LTLIBINTL) \ > -L$(top_builddir)/src/.libs -lguestfs > if HAVE_OCAMLOPT > $(OCAMLMKLIB) -o mlguestfs \ > $(libguestfsocaml_a_OBJECTS) guestfs.cmx \ > + $(LTLIBINTL) \ > -L$(top_builddir)/src/.libs -lguestfs > endif > touch $@ > diff --git a/rescue/Makefile.am b/rescue/Makefile.am > index 505b327..f380f04 100644 > --- a/rescue/Makefile.am > +++ b/rescue/Makefile.am > @@ -59,6 +59,7 @@ virt_rescue_LDADD = \ > $(top_builddir)/src/libguestfs.la \ > $(LIBXML2_LIBS) \ > $(LIBVIRT_LIBS) \ > + $(LTLIBINTL) \ > ../gnulib/lib/libgnu.la > > # Manual pages and HTML files for the website. > diff --git a/resize/Makefile.am b/resize/Makefile.am > index 629fa22..3a7483c 100644 > --- a/resize/Makefile.am > +++ b/resize/Makefile.am > @@ -71,7 +71,7 @@ OCAMLCFLAGS = $(OCAML_FLAGS) $(OCAML_WARN_ERROR) $(OCAMLPACKAGES) > OCAMLOPTFLAGS = $(OCAMLCFLAGS) > > OCAMLCLIBS = \ > - $(LIBXML2_LIBS) -lncurses \ > + $(LIBXML2_LIBS) $(LIBINTL) -lncurses \ > -L../src/.libs -lutils \ > -L../gnulib/lib/.libs -lgnu > > diff --git a/src/Makefile.am b/src/Makefile.am > index be8d3a3..a83f257 100644 > --- a/src/Makefile.am > +++ b/src/Makefile.am > @@ -159,7 +159,7 @@ libguestfs_la_LIBADD = \ > $(INET_NTOP_LIB) \ > $(LIBSOCKET) \ > $(LIB_CLOCK_GETTIME) \ > - $(LIBINTL) \ > + $(LTLIBINTL) \ > $(LTLIBTHREAD) \ > $(LTLIBICONV) \ > $(SERVENT_LIB) > @@ -238,7 +238,8 @@ noinst_PROGRAMS += libvirt-is-version > libvirt_is_version_SOURCES = libvirt-is-version.c > > libvirt_is_version_LDADD = \ > - $(LIBVIRT_LIBS) > + $(LIBVIRT_LIBS) \ > + $(LTLIBINTL) > > libvirt_is_version_CPPFLAGS = \ > -DLOCALEBASEDIR=\""$(datadir)/locale"\" > @@ -266,6 +267,7 @@ test_utils_CFLAGS = \ > test_utils_LDADD = \ > libguestfs_la-guid.lo \ > libutils.la \ > + $(LTLIBINTL) \ > $(top_builddir)/gnulib/lib/libgnu.la > > check-valgrind: > diff --git a/sysprep/Makefile.am b/sysprep/Makefile.am > index 17fe612..58c63bb 100644 > --- a/sysprep/Makefile.am > +++ b/sysprep/Makefile.am > @@ -136,7 +136,7 @@ OCAMLCFLAGS = $(OCAML_FLAGS) $(OCAML_WARN_ERROR) $(OCAMLPACKAGES) > OCAMLOPTFLAGS = $(OCAMLCFLAGS) > > OCAMLCLIBS = \ > - $(LIBXML2_LIBS) -lncurses -lcrypt \ > + $(LIBXML2_LIBS) $(LIBINTL) -lncurses -lcrypt \ > -L../src/.libs -lutils \ > -L../gnulib/lib/.libs -lgnu > > diff --git a/test-tool/Makefile.am b/test-tool/Makefile.am > index c0e958c..ca5b3ef 100644 > --- a/test-tool/Makefile.am > +++ b/test-tool/Makefile.am > @@ -37,6 +37,7 @@ libguestfs_test_tool_CFLAGS = \ > > libguestfs_test_tool_LDADD = \ > $(top_builddir)/src/libguestfs.la \ > + $(LTLIBINTL) \ > $(top_builddir)/gnulib/lib/libgnu.la > > libguestfs-test-tool.1 $(top_builddir)/html/libguestfs-test-tool.1.html: stamp-libguestfs-test-tool.pod > diff --git a/tests/c-api/Makefile.am b/tests/c-api/Makefile.am > index 6ea22e9..fed1923 100644 > --- a/tests/c-api/Makefile.am > +++ b/tests/c-api/Makefile.am > @@ -90,6 +90,7 @@ tests_LDADD = \ > $(top_builddir)/src/libguestfs.la \ > $(LIBXML2_LIBS) \ > $(LIBVIRT_LIBS) \ > + $(LTLIBINTL) \ > $(top_builddir)/gnulib/lib/libgnu.la > > # This binary must be statically linked. It is used for testing > @@ -162,6 +163,7 @@ test_backend_settings_CFLAGS = \ > $(WARN_CFLAGS) $(WERROR_CFLAGS) > test_backend_settings_LDADD = \ > $(top_builddir)/src/libutils_la-utils.lo \ > + $(LTLIBINTL) \ > $(top_builddir)/src/libguestfs.la > > test_private_data_SOURCES = test-private-data.c > @@ -203,6 +205,7 @@ test_environment_CFLAGS = \ > $(WARN_CFLAGS) $(WERROR_CFLAGS) > test_environment_LDADD = \ > $(top_builddir)/src/libguestfs.la \ > + $(LTLIBINTL) \ > $(top_builddir)/gnulib/lib/libgnu.la > > test_event_string_SOURCES = test-event-string.c > @@ -214,6 +217,7 @@ test_event_string_CFLAGS = \ > $(WARN_CFLAGS) $(WERROR_CFLAGS) > test_event_string_LDADD = \ > $(top_builddir)/src/libguestfs.la \ > + $(LTLIBINTL) \ > $(top_builddir)/gnulib/lib/libgnu.la > > #if HAVE_LIBVIRT > diff --git a/tests/charsets/Makefile.am b/tests/charsets/Makefile.am > index b7ec703..e71f76d 100644 > --- a/tests/charsets/Makefile.am > +++ b/tests/charsets/Makefile.am > @@ -33,4 +33,5 @@ test_charset_fidelity_LDADD = \ > $(top_builddir)/src/libutils.la \ > $(top_builddir)/src/libguestfs.la \ > $(LIBXML2_LIBS) \ > - $(LIBVIRT_LIBS) > + $(LIBVIRT_LIBS) \ > + $(LTLIBINTL) > diff --git a/tests/events/Makefile.am b/tests/events/Makefile.am > index 9f31e9e..9bbe322 100644 > --- a/tests/events/Makefile.am > +++ b/tests/events/Makefile.am > @@ -43,5 +43,6 @@ test_libvirt_auth_callbacks_LDADD = \ > $(top_builddir)/src/libguestfs.la \ > $(LIBVIRT_LIBS) \ > $(LIBXML2_LIBS) \ > + $(LTLIBINTL) \ > $(top_builddir)/gnulib/lib/libgnu.la > endif > diff --git a/tests/qemu/Makefile.am b/tests/qemu/Makefile.am > index b1b3555..e234063 100644 > --- a/tests/qemu/Makefile.am > +++ b/tests/qemu/Makefile.am > @@ -55,6 +55,7 @@ qemu_boot_LDADD = \ > $(top_builddir)/src/libguestfs.la \ > $(LIBXML2_LIBS) \ > $(LIBVIRT_LIBS) \ > + $(LTLIBINTL) \ > $(top_builddir)/gnulib/lib/libgnu.la > > qemu_speed_test_SOURCES = \ > @@ -71,4 +72,5 @@ qemu_speed_test_LDADD = \ > $(top_builddir)/src/libguestfs.la \ > $(LIBXML2_LIBS) \ > $(LIBVIRT_LIBS) \ > + $(LTLIBINTL) \ > $(top_builddir)/gnulib/lib/libgnu.la > diff --git a/v2v/link.sh.in b/v2v/link.sh.in > index a226947..d6313fe 100644 > --- a/v2v/link.sh.in > +++ b/v2v/link.sh.in > @@ -19,4 +19,4 @@ > # Hack automake to link binary properly. There is no other way to add > # the -cclib parameter to the end of the command line. > > -exec "$@" -linkpkg -cclib '-lutils -lncurses -lcrypt @LIBVIRT_LIBS@ @LIBXML2_LIBS@ -lgnu' > +exec "$@" -linkpkg -cclib '-lutils -lncurses -lcrypt @LIBVIRT_LIBS@ @LIBXML2_LIBS@ @LIBINTL@ -lgnu' > -- > 1.9.3 > > _______________________________________________ > Libguestfs mailing list > Libguestfs@redhat.com > https://www.redhat.com/mailman/listinfo/libguestfs-- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-builder quickly builds VMs from scratch http://libguestfs.org/virt-builder.1.html
Richard W.M. Jones
2014-Nov-04 16:11 UTC
Re: [Libguestfs] [PATCH 7/9] python: fix detection of libpython features
On Tue, Nov 04, 2014 at 04:35:30PM +0100, Pino Toscano wrote:> Instead of querying distutils.sysconfig for the library name, just use > the $PYTHON_LIBS returned by pkg-config. This makes sure the tests can > link even with a libpython in a non-standard library directory. > --- > configure.ac | 10 ++-------- > 1 file changed, 2 insertions(+), 8 deletions(-) > > diff --git a/configure.ac b/configure.ac > index 87e066c..1bf291c 100644 > --- a/configure.ac > +++ b/configure.ac > @@ -1216,20 +1216,14 @@ AS_IF([test "x$enable_python" != "xno"],[ > AC_MSG_RESULT([$PYTHON_EXT_SUFFIX]) > > dnl Look for some optional symbols in libpython. > - old_LIBS="$LIBS" > - > - PYTHON_BLDLIBRARY=`$PYTHON -c "import distutils.sysconfig; \ > - print (distutils.sysconfig.get_config_var('BLDLIBRARY'))"` > AC_CHECK_LIB([c],[PyCapsule_New], > [AC_DEFINE([HAVE_PYCAPSULE_NEW],1, > [Found PyCapsule_New in libpython.])], > - [],[$PYTHON_BLDLIBRARY]) > + [],[$PYTHON_LIBS]) > AC_CHECK_LIB([c],[PyString_AsString], > [AC_DEFINE([HAVE_PYSTRING_ASSTRING],1, > [Found PyString_AsString in libpython.])], > - [],[$PYTHON_BLDLIBRARY]) > - > - LIBS="$old_LIBS" > + [],[$PYTHON_LIBS]) > fi > > AC_SUBST(PYTHON_PREFIX) > -- > 1.9.3Will this break hillu's change (commit ad5b5f96da53)? Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com Fedora Windows cross-compiler. Compile Windows programs, test, and build Windows installers. Over 100 libraries supported. http://fedoraproject.org/wiki/MinGW
Richard W.M. Jones
2014-Nov-04 16:13 UTC
Re: [Libguestfs] [PATCH 9/9] tests/qemu: isolate MD5 calculation in an own shared function
On Tue, Nov 04, 2014 at 04:35:32PM +0100, Pino Toscano wrote:> + > +do_md5 () > +{ > + case "$(uname)" in > + Linux) > + md5sum "$1" | awk '{print $1}' > + ;; > + *) > + echo "$0: unknown method to calculate MD5 of file on $(uname)" > + exit 1 > + ;; > + esac > +}It's probably better to do something like: if md5sum --help >/dev/null 2>&1; then md5sum ... elif md5 --help >/dev/null 2>&1; then md5 ... else echo "$0: don't know how to calculate md5 sum on this host" exit 1 fi ? Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-builder quickly builds VMs from scratch http://libguestfs.org/virt-builder.1.html
Richard W.M. Jones
2014-Nov-04 16:13 UTC
Re: [Libguestfs] [PATCH 0/9] Small bits of non-Linux porting - #2
ACK everything except 3 & 7. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-p2v converts physical machines to virtual machines. Boot with a live CD or over the network (PXE) and turn machines into KVM guests. http://libguestfs.org/virt-v2v
Apparently Analagous Threads
- [PATCH 0/5] Rename src/ to lib/ and move common code to common/
- [PATCH 1/3] build: remove extra libconfig linkage
- [PATCH v2 0/7] Rename src/ to lib/ and move common code to common/
- Re: [PATCH 3/9] build: check for libintl, and use it
- [PATCH 00/12] Refactor utility functions.