tests: Split images -> tests/data + tests/guests
[libguestfs.git] / configure.ac
index d1b1c10..b0661a0 100644 (file)
 #
 # 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
 # The major, minor, and release fields MUST be numbers.  Packagers can
 # add extra information using --with-extra="..." which may be any
 # freeform string.
 m4_define([libguestfs_major],   [1])
-m4_define([libguestfs_minor],   [13])
-m4_define([libguestfs_release], [23])
+m4_define([libguestfs_minor],   [15])
+m4_define([libguestfs_release], [11])
 
 AC_INIT([libguestfs],libguestfs_major.libguestfs_minor.libguestfs_release)
 AC_CONFIG_AUX_DIR([build-aux])
@@ -121,6 +121,9 @@ if test "$gl_gcc_warnings" = yes; then
                                     # failures (seen on Ubuntu).
   nw="$nw -Wmissing-noreturn"       # Don't warn about missed noreturn funcs
                                     # (seen on Ubuntu).
+  nw="$nw -Wsuggest-attribute=pure" # Don't suggest pure functions.
+  nw="$nw -Wsuggest-attribute=const" # Don't suggest const functions.
+  nw="$nw -Wunsuffixed-float-constants" # Don't care about these.
 
   gl_MANYWARN_ALL_GCC([ws])
   gl_MANYWARN_COMPLEMENT([ws], [$ws], [$nw])
@@ -312,22 +315,19 @@ AC_CHECK_LIB([portablexdr],[xdrmem_create],[],[
         AC_SEARCH_LIBS([xdrmem_create],[rpc xdr nsl])
         ])
 
-dnl Check for Augeas (now optional).
-AC_CHECK_LIB([augeas],[aug_match],[
-        have_augeas=yes
-        AUGEAS_LIB="-laugeas"
-
-        old_LIBS="$LIBS"
-        LIBS="$LIBS $AUGEAS_LIB"
-        dnl Check for functions not available in earlier versions of Augeas.
-        AC_CHECK_FUNCS([aug_load aug_defvar aug_defnode])
-        LIBS="$old_LIBS"
-
-        ],[have_augeas=no])
-if test "x$have_augeas" = "xyes"; then
-        AC_DEFINE([HAVE_AUGEAS],[1],[Define to 1 if you have Augeas])
-fi
-AC_SUBST([AUGEAS_LIB])
+dnl Check for Augeas (optional).
+PKG_CHECK_MODULES([AUGEAS], [augeas],
+        [AC_SUBST([AUGEAS_CFLAGS])
+         AC_SUBST([AUGEAS_LIBS])
+         AC_DEFINE([HAVE_AUGEAS],[1],[Define to 1 if you have Augeas])
+
+         old_LIBS="$LIBS"
+         LIBS="$LIBS $AUGEAS_LIBS"
+         dnl Check for functions not available in earlier versions of Augeas.
+         AC_CHECK_FUNCS([aug_load aug_defvar aug_defnode])
+         LIBS="$old_LIBS"
+        ],
+        [AC_MSG_WARN([augeas not found, some core features will be disabled])])
 
 dnl Check for libselinux (optional).
 AC_CHECK_HEADERS([selinux/selinux.h])
@@ -652,14 +652,9 @@ AS_IF([test "x$enable_ocaml" != "xno"],
          OCAMLFIND=
          AC_PROG_OCAML
          AC_PROG_FINDLIB
-
-         AS_IF([test "x$OCAMLC" != "xno" && test "x$OCAMLFIND" != "xno"],
-               [AC_CHECK_OCAML_PKG([pcre])])
         ])
 AM_CONDITIONAL([HAVE_OCAML],
                [test "x$OCAMLC" != "xno" && test "x$OCAMLFIND" != "xno"])
-AM_CONDITIONAL([HAVE_OCAML_PCRE],
-               [test "x$OCAMLC" != "xno" && test "x$OCAMLFIND" != "xno" && test "x$OCAML_PKG_pcre" != "xno"])
 AM_CONDITIONAL([HAVE_OCAMLDOC],
                [test "x$OCAMLDOC" != "xno"])
 
@@ -713,7 +708,9 @@ AS_IF([test "x$enable_python" != "xno"],
            AC_MSG_RESULT([$PYTHON_PREFIX])
 
            AC_MSG_CHECKING([Python version])
-            PYTHON_VERSION=`$PYTHON -c "import sys; print (sys.version[[0:3]])"`
+            PYTHON_VERSION_MAJOR=`$PYTHON -c "import sys; print (sys.version_info@<:@0@:>@)"`
+            PYTHON_VERSION_MINOR=`$PYTHON -c "import sys; print (sys.version_info@<:@1@:>@)"`
+            PYTHON_VERSION="$PYTHON_VERSION_MAJOR.$PYTHON_VERSION_MINOR"
            AC_MSG_RESULT([$PYTHON_VERSION])
 
             AC_MSG_CHECKING([for Python include path])
@@ -741,9 +738,19 @@ AS_IF([test "x$enable_python" != "xno"],
                 AC_MSG_RESULT([$PYTHON_INSTALLDIR])
             fi
 
+            dnl Look for libpython and some optional symbols in it.
             old_LIBS="$LIBS"
-            LIBS="$LIBS -lpython$PYTHON_VERSION"
-            AC_CHECK_FUNCS([PyCapsule_New])
+            if test "x$PYTHON_VERSION_MAJOR" = "x3"; then
+                dnl libpython3 is called "libpython3.Xmu.so"
+                LIBPYTHON="python${PYTHON_VERSION}mu"
+            else
+                LIBPYTHON="python$PYTHON_VERSION"
+            fi
+            AC_CHECK_LIB([$LIBPYTHON], [PyList_Size], [],
+                         [AC_MSG_FAILURE([$LIBPYTHON is not installed])])
+
+            AC_CHECK_FUNCS([PyCapsule_New \
+                            PyString_AsString])
             LIBS="$old_LIBS"
         fi
 
@@ -762,8 +769,10 @@ AC_ARG_ENABLE([ruby],
         [enable_ruby=yes])
 AS_IF([test "x$enable_ruby" != "xno"],
         [
-        AC_CHECK_LIB([ruby],[ruby_init],[HAVE_LIBRUBY=1],[HAVE_LIBRUBY=0])
+        AC_CHECK_PROG([RUBY],[ruby],[ruby],[no])
         AC_CHECK_PROG([RAKE],[rake],[rake],[no])
+        AC_CHECK_LIB([ruby],[ruby_init],[HAVE_LIBRUBY=1],[HAVE_LIBRUBY=0])
+        AC_SUBST([RAKE])
         ])
 AM_CONDITIONAL([HAVE_RUBY],
     [test "x$RAKE" != "xno" && test -n "$HAVE_LIBRUBY"])
@@ -997,9 +1006,7 @@ AC_CONFIG_FILES([run],
 AC_CONFIG_FILES([Makefile
                  align/Makefile
                  appliance/Makefile
-                 capitests/Makefile
                  cat/Makefile
-                 caution/Makefile
                  clone/Makefile
                  csharp/Makefile
                  daemon/Makefile
@@ -1015,7 +1022,6 @@ AC_CONFIG_FILES([Makefile
                  gnulib/lib/Makefile
                  gnulib/tests/Makefile
                  haskell/Makefile
-                 images/Makefile
                  inspector/Makefile
                  java/Makefile
                  java/examples/Makefile
@@ -1033,7 +1039,6 @@ AC_CONFIG_FILES([Makefile
                  po/Makefile.in
                  python/Makefile
                  python/examples/Makefile
-                 regressions/Makefile
                  rescue/Makefile
                  resize/Makefile
                  ruby/Makefile
@@ -1042,6 +1047,16 @@ AC_CONFIG_FILES([Makefile
                  sparsify/Makefile
                  src/Makefile
                  test-tool/Makefile
+                 tests/c-api/Makefile
+                 tests/data/Makefile
+                 tests/extra/Makefile
+                 tests/guests/Makefile
+                 tests/luks/Makefile
+                 tests/lvm/Makefile
+                 tests/md/Makefile
+                 tests/protocol/Makefile
+                 tests/qemu/Makefile
+                 tests/regressions/Makefile
                  tools/Makefile])
 AC_OUTPUT
 
@@ -1076,7 +1091,7 @@ echo    "guestfish and C virt tools .......... yes"
 echo -n "Perl virt tools ..................... "
 if test "x$HAVE_TOOLS_TRUE" = "x"; then echo "yes"; else echo "no"; fi
 echo -n "virt-resize ......................... "
-if test "x$HAVE_OCAML_TRUE" = "x" && test "x$HAVE_OCAML_PCRE_TRUE" = "x"; then echo "yes"; else echo "no"; fi
+if test "x$HAVE_OCAML_TRUE" = "x"; then echo "yes"; else echo "no"; fi
 echo "FUSE filesystem ..................... $enable_fuse"
 echo
 echo "If any optional component is configured 'no' when you expected 'yes'"