Use autoconf to generate the Makefile.
[virt-p2v.git] / configure.ac
diff --git a/configure.ac b/configure.ac
new file mode 100644 (file)
index 0000000..be821a0
--- /dev/null
@@ -0,0 +1,57 @@
+# virt-p2v
+# Copyright (C) 2007-2008 Red Hat Inc., Richard W.M. Jones
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2 of the License, or (at your option) any later version.
+#
+# This library 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
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
+
+dnl Process this file with autoconf to produce a configure script.
+AC_INIT(virt-p2v,0.9.2)
+
+dnl Check for basic OCaml script interpreter.
+AC_PROG_OCAML
+
+dnl Check for required OCaml modules.
+AC_CHECK_OCAML_MODULE(unix,pkg_unix,Unix,[.])
+if test "x$pkg_unix" = "xno"; then
+    AC_MSG_ERROR([Cannot find required OCaml package 'unix'])
+fi
+
+AC_CHECK_OCAML_MODULE(extlib,pkg_extlib,ExtString,[+extlib])
+if test "x$pkg_extlib" = "xno"; then
+    AC_MSG_ERROR([Cannot find required OCaml package 'extlib'])
+fi
+
+AC_CHECK_OCAML_MODULE(xml-light,pkg_xml_light,Xml,[+xml-light])
+if test "x$pkg_xml_light" = "xno"; then
+    AC_MSG_ERROR([Cannot find required OCaml package 'xml-light'])
+fi
+
+dnl Check for recommended livecd-creator (for building ISOs).
+AC_CHECK_PROG(HAVE_LIVECD_CREATOR,livecd-creator,livecd-creator)
+
+dnl Check for optional perldoc (for building manual pages).
+AC_CHECK_PROG(HAVE_PERLDOC,perldoc,perldoc)
+
+dnl Check for optional qemu or qemu-kvm (for test-booting).
+AC_CHECK_PROG(HAVE_QEMU,qemu,qemu)
+AC_CHECK_PROG(HAVE_QEMU_KVM,qemu-kvm,qemu-kvm)
+
+dnl Summary.
+echo "------------------------------------------------------------"
+echo "Thanks for downloading" $PACKAGE_STRING
+echo "------------------------------------------------------------"
+
+dnl Produce output files.
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT