[Libguestfs] [v2v PATCH v2 2/5] build: remove extra checks and submodules

Pino Toscano ptoscano at redhat.com
Wed Nov 27 14:40:37 UTC 2019


Remove various redundant checks for headers, functions, libraries,
tools, and other stuff not actually used neither by virt-v2v nor by its
submodules from common.

Also, stop building the mlaugeas, and windows submodules, as they are
not used.
---
 Makefile.am             |  2 -
 configure.ac            |  2 -
 m4/guestfs-c.m4         | 12 ------
 m4/guestfs-libraries.m4 | 90 +----------------------------------------
 m4/guestfs-perl.m4      | 27 +------------
 m4/guestfs-progs.m4     | 14 +------
 6 files changed, 3 insertions(+), 144 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index e80076bb..039921c2 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -34,10 +34,8 @@ endif
 SUBDIRS += common/qemuopts
 SUBDIRS += common/utils
 SUBDIRS += common/mlutils
-SUBDIRS += common/mlaugeas
 SUBDIRS += common/mlpcre
 SUBDIRS += common/options
-SUBDIRS += common/windows
 SUBDIRS += common/mlgettext
 SUBDIRS += common/mlxml
 SUBDIRS += common/mltools
diff --git a/configure.ac b/configure.ac
index fa893380..bc199df9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -102,7 +102,6 @@ dnl NB: Remove common/mlstdutils/guestfs_config.ml in future XXX
 AC_CONFIG_FILES([Makefile
                  bash/Makefile
                  common/options/Makefile
-                 common/mlaugeas/Makefile
                  common/mlcustomize/Makefile
                  common/mlgettext/Makefile
                  common/mllibvirt/Makefile
@@ -115,7 +114,6 @@ AC_CONFIG_FILES([Makefile
                  common/mlxml/Makefile
                  common/qemuopts/Makefile
                  common/utils/Makefile
-                 common/windows/Makefile
                  docs/Makefile
                  gnulib/lib/Makefile
                  gnulib/tests/Makefile
diff --git a/m4/guestfs-c.m4 b/m4/guestfs-c.m4
index e20721f5..55b180e0 100644
--- a/m4/guestfs-c.m4
+++ b/m4/guestfs-c.m4
@@ -138,18 +138,6 @@ AM_PROG_CC_C_O
 # deal with CPU architectures that do not exist.
 CFLAGS="$CFLAGS -fno-strict-overflow -Wno-strict-overflow"
 
-dnl Work out how to specify the linker script to the linker.
-VERSION_SCRIPT_FLAGS=-Wl,--version-script=
-`/usr/bin/ld --help 2>&1 | grep -- --version-script >/dev/null` || \
-    VERSION_SCRIPT_FLAGS="-Wl,-M -Wl,"
-AC_SUBST(VERSION_SCRIPT_FLAGS)
-
-dnl Use -fvisibility=hidden by default in the library.
-dnl http://gcc.gnu.org/wiki/Visibility
-AS_IF([test -n "$GCC"],
-    [AC_SUBST([GCC_VISIBILITY_HIDDEN], [-fvisibility=hidden])],
-    [AC_SUBST([GCC_VISIBILITY_HIDDEN], [:])])
-
 dnl Check support for 64 bit file offsets.
 AC_SYS_LARGEFILE
 
diff --git a/m4/guestfs-libraries.m4 b/m4/guestfs-libraries.m4
index 09d764f8..41f3a975 100644
--- a/m4/guestfs-libraries.m4
+++ b/m4/guestfs-libraries.m4
@@ -26,17 +26,9 @@ AC_DEFINE_UNQUOTED([host_cpu],["$host_cpu"],[Host architecture.])
 dnl Headers.
 AC_CHECK_HEADERS([\
     byteswap.h \
-    endian.h \
-    sys/endian.h \
     errno.h \
-    linux/fs.h \
     linux/magic.h \
-    linux/raid/md_u.h \
-    linux/rtc.h \
-    printf.h \
-    sys/inotify.h \
     sys/mount.h \
-    sys/resource.h \
     sys/socket.h \
     sys/statfs.h \
     sys/statvfs.h \
@@ -45,33 +37,12 @@ AC_CHECK_HEADERS([\
     sys/un.h \
     sys/vfs.h \
     sys/wait.h \
-    windows.h \
-    sys/xattr.h])
+    windows.h])
 
 dnl Functions.
 AC_CHECK_FUNCS([\
-    be32toh \
     fsync \
-    futimens \
-    getxattr \
-    htonl \
-    htons \
-    inotify_init1 \
-    lgetxattr \
-    listxattr \
-    llistxattr \
-    lsetxattr \
-    lremovexattr \
-    mknod \
-    ntohl \
-    ntohs \
-    posix_fallocate \
     posix_fadvise \
-    removexattr \
-    setitimer \
-    setrlimit \
-    setxattr \
-    sigaction \
     statfs \
     statvfs \
     sync])
@@ -79,30 +50,6 @@ AC_CHECK_FUNCS([\
 dnl Which header file defines major, minor, makedev.
 AC_HEADER_MAJOR
 
-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 GNU gettext tools (optional).
 AC_CHECK_PROG([XGETTEXT],[xgettext],[xgettext],[no])
 AC_CHECK_PROG([MSGCAT],[msgcat],[msgcat],[no])
@@ -123,22 +70,6 @@ AM_CONDITIONAL([HAVE_GNU_GETTEXT],
 dnl Check for gettext.
 AM_GNU_GETTEXT([external])
 
-dnl Check for libselinux (optional).
-AC_CHECK_HEADERS([selinux/selinux.h])
-AC_CHECK_LIB([selinux],[setexeccon],[
-    have_libselinux="$ac_cv_header_selinux_selinux_h"
-    SELINUX_LIBS="-lselinux"
-
-    old_LIBS="$LIBS"
-    LIBS="$LIBS $SELINUX_LIBS"
-    AC_CHECK_FUNCS([setcon getcon])
-    LIBS="$old_LIBS"
-],[have_libselinux=no])
-if test "x$have_libselinux" = "xyes"; then
-    AC_DEFINE([HAVE_LIBSELINUX],[1],[Define to 1 if you have libselinux.])
-fi
-AC_SUBST([SELINUX_LIBS])
-
 dnl Check for PCRE (required)
 PKG_CHECK_MODULES([PCRE], [libpcre], [], [
     AC_CHECK_PROGS([PCRE_CONFIG], [pcre-config pcre2-config], [no])
@@ -149,25 +80,6 @@ PKG_CHECK_MODULES([PCRE], [libpcre], [], [
     PCRE_LIBS=`$PCRE_CONFIG --libs`
 ])
 
-dnl Check for Augeas >= 1.2.0 (required).
-PKG_CHECK_MODULES([AUGEAS],[augeas >= 1.2.0])
-
-dnl Check for aug_source function, added in Augeas 1.8.0.
-old_LIBS="$LIBS"
-LIBS="$AUGEAS_LIBS"
-AC_CHECK_FUNCS([aug_source])
-LIBS="$old_LIBS"
-
-dnl libmagic (required)
-AC_CHECK_LIB([magic],[magic_file],[
-    AC_CHECK_HEADER([magic.h],[
-        AC_SUBST([MAGIC_LIBS], ["-lmagic"])
-    ], [])
-],[])
-AS_IF([test -z "$MAGIC_LIBS"],
-    [AC_MSG_ERROR([libmagic (part of the "file" command) is required.
-                   Please install the file devel package])])
-
 dnl libvirt (highly recommended)
 AC_ARG_WITH([libvirt],[
     AS_HELP_STRING([--without-libvirt],
diff --git a/m4/guestfs-perl.m4 b/m4/guestfs-perl.m4
index 71d02d97..16a83752 100644
--- a/m4/guestfs-perl.m4
+++ b/m4/guestfs-perl.m4
@@ -38,35 +38,10 @@ dnl Define the path to the podwrapper program.
 PODWRAPPER="\$(guestfs_am_v_podwrapper)$PERL $(pwd)/podwrapper.pl"
 AC_SUBST([PODWRAPPER])
 
-dnl Check for Perl for Perl bindings and Perl tools.
-AC_ARG_ENABLE([perl],
-    AS_HELP_STRING([--disable-perl], [disable Perl language bindings]),
-    [],
-    [enable_perl=yes])
-AS_IF([test "x$enable_perl" != "xno"],[
-    dnl Check for Perl modules that must be present to compile and
-    dnl test the Perl bindings.
-    missing_perl_modules=no
-    for pm in Test::More Module::Build; do
-        AC_MSG_CHECKING([for $pm])
-        if ! $PERL -M$pm -e1 >&AS_MESSAGE_LOG_FD 2>&1; then
-            AC_MSG_RESULT([no])
-            missing_perl_modules=yes
-        else
-            AC_MSG_RESULT([yes])
-        fi
-    done
-    if test "x$missing_perl_modules" = "xyes"; then
-        AC_MSG_WARN([some Perl modules required to compile or test the Perl bindings are missing])
-    fi
-])
-AM_CONDITIONAL([HAVE_PERL],
-    [test "x$enable_perl" != "xno" && test "x$PERL" != "xno" && test "x$missing_perl_modules" != "xyes"])
-
 dnl Check for Perl modules needed by Perl virt tools (virt-df, etc.)
 AS_IF([test "x$PERL" != "xno"],[
     missing_perl_modules=no
-    for pm in Pod::Usage Getopt::Long Sys::Virt Locale::TextDomain Win::Hivex Win::Hivex::Regedit ; do
+    for pm in Pod::Usage Getopt::Long ; do
         AC_MSG_CHECKING([for $pm])
         if ! $PERL -M$pm -e1 >&AS_MESSAGE_LOG_FD 2>&1; then
             AC_MSG_RESULT([no])
diff --git a/m4/guestfs-progs.m4 b/m4/guestfs-progs.m4
index 97a5bfc3..5f481a75 100644
--- a/m4/guestfs-progs.m4
+++ b/m4/guestfs-progs.m4
@@ -48,12 +48,8 @@ dnl po4a for translating man pages and POD files (optional).
 AC_CHECK_PROG([PO4A],[po4a],[po4a],[no])
 AM_CONDITIONAL([HAVE_PO4A], [test "x$PO4A" != "xno"])
 
-dnl Check for db_dump, db_load (optional).
-GUESTFS_FIND_DB_TOOL([DB_DUMP], [dump])
+dnl Check for db_load (optional).
 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
 if test "x$DB_LOAD" != "xno"; then
     AC_DEFINE_UNQUOTED([DB_LOAD],["$DB_LOAD"],[Name of db_load program.])
 fi
@@ -77,11 +73,3 @@ AS_IF([test "x$VALGRIND" != "xno"],[
 ])
 AC_SUBST([VG])
 AM_SUBST_NOTMAKE([VG])
-
-dnl Check for fuser (used in FUSE stuff).
-AC_PATH_PROGS([FUSER],[fuser],[/sbin/fuser])
-AC_DEFINE_UNQUOTED([FUSER],["$FUSER"],[Name of fuser program.])
-
-dnl Check for true (used in tests).
-AC_PATH_PROGS([TOOL_TRUE],[true],[/bin/true])
-AC_DEFINE_UNQUOTED([TOOL_TRUE],["$TOOL_TRUE"],[Name of 'true' program.])
-- 
2.21.0




More information about the Libguestfs mailing list