X-Git-Url: http://git.annexia.org/?p=virt-mem.git;a=blobdiff_plain;f=configure.ac;h=70aec5ab018cc7337346386ba7c72fa72e65feab;hp=c1475e9bb809cde79a2cce9faf4d5623f250111c;hb=2e2513f2b4ed367a353eaf3bfadfde9b978e8fb5;hpb=40940dbca159a90c43b46297011246256c5da30e diff --git a/configure.ac b/configure.ac index c1475e9..70aec5a 100644 --- a/configure.ac +++ b/configure.ac @@ -17,9 +17,22 @@ dnl Process this file with autoconf to produce a configure script. -AC_INIT(virt-mem,0.2.0) +AC_INIT(virt-mem,0.3.1) AC_PROG_INSTALL +AC_PROG_MKDIR_P + +dnl Check for an ANSI C compiler. +AC_GNU_SOURCE +AC_PROG_CC +AC_C_PROTOTYPES +test "x$U" != "x" && AC_MSG_ERROR(Compiler not ANSI compliant) +AC_PROG_CC_C_O + +AC_CHECK_FUNCS([memmem]) + +dnl Do we have pahole (from acme's "dwarves" library)? +AC_PATH_PROG(PAHOLE,pahole) dnl Check for basic OCaml environment & findlib. AC_PROG_OCAML @@ -52,22 +65,45 @@ if test "x$pkg_xml_light" != "xyes"; then AC_MSG_ERROR([Cannot find required OCaml package 'xml-light']) fi -AC_CHECK_OCAML_PKG(bitmatch) -if test "x$pkg_bitmatch" != "xyes"; then - AC_MSG_ERROR([Cannot find required OCaml package 'bitmatch']) +AC_CHECK_OCAML_PKG(bitstring) +if test "x$pkg_bitstring" != "xyes"; then + AC_MSG_ERROR([Cannot find required OCaml package 'bitstring']) fi dnl Check for optional OCaml packages. AC_CHECK_OCAML_PKG(gettext) AC_CHECK_OCAML_PKG(csv) +AC_CHECK_OCAML_PKG(xmlrpc-light) AC_SUBST(pkg_unix) AC_SUBST(pkg_extlib) AC_SUBST(pkg_libvirt) AC_SUBST(pkg_xml_light) -AC_SUBST(pkg_bitmatch) +AC_SUBST(pkg_bitstring) AC_SUBST(pkg_gettext) AC_SUBST(pkg_csv) +AC_SUBST(pkg_xmlrpc_light) + +dnl Check that libvirt / ocaml-libvirt support virDomainMemoryPeek, +dnl because without that call nothing is going to work. +old_libs="$LIBS" +AC_SEARCH_LIBS([virDomainMemoryPeek],[virt],[], + [AC_MSG_ERROR(virDomainMemoryPeek call not found in libvirt. You probably need to install a newer version of libvirt - try a version >= 0.4.4)]) +LIBS="$old_libs" + +AC_MSG_CHECKING([for Libvirt.Domain.memory_peek in ocaml-libvirt]) +echo "Libvirt.Domain.memory_peek" > conftest.ml +cmd="$OCAMLFIND ocamlc -package libvirt -c conftest.ml" +echo $cmd >&5 +$cmd >&5 2>&5 +r=$? +rm conftest.* +if test "$r" -eq 0 ; then + AC_MSG_RESULT([ok]) +else + AC_MSG_RESULT([not found]) + AC_MSG_FAILURE([Libvirt.Domain.memory_peek call not found in ocaml-libvirt. You probably need to install a newer version of ocaml-libvirt and libvirt - try versions >= 0.4.4]) +fi dnl Check for optional perldoc (for building manual pages). AC_CHECK_PROG(HAVE_PERLDOC,perldoc,perldoc) @@ -79,12 +115,12 @@ dnl Write gettext modules for the programs. dnl http://www.le-gall.net/sylvain+violaine/documentation/ocaml-gettext/html/reference-manual/ch03s04.html for d in virt-mem; do f=`echo $d | tr - _`_gettext.ml - AC_MSG_NOTICE([creating $f]) - rm -f $f - echo "(* This file is generated automatically by ./configure. *)" > $f + AC_MSG_NOTICE([creating lib/$f]) + rm -f lib/$f + echo "(* This file is generated automatically by ./configure. *)" > lib/$f if test "x$pkg_gettext" != "xno"; then # Gettext module is available, so use it. - cat <>$f + cat <>lib/$f module Gettext = Gettext.Program ( struct let textdomain = "$d" @@ -96,7 +132,7 @@ module Gettext = Gettext.Program ( EOT else # No gettext module is available, so fake the translation functions. - cat <>$f + cat <>lib/$f module Gettext = struct external s_ : string -> string = "%identity" external f_ : ('a -> 'b, 'c, 'd) format -> ('a -> 'b, 'c, 'd) format @@ -133,6 +169,16 @@ echo "------------------------------------------------------------" dnl Produce output files. AC_CONFIG_HEADERS([config.h]) AC_CONFIG_FILES([Makefile + Make.rules + lib/Makefile + lib/virt_mem_version.ml + uname/Makefile + dmesg/Makefile + ifconfig/Makefile + ps/Makefile + mem/Makefile po/Makefile + extract/fedora-koji/Makefile + extract/codegen/Makefile ]) AC_OUTPUT