RHEL 5.11 full-virt now boots to login prompt.
[virt-v2v-test-cases-nonfree.git] / configure.ac
1 # virt-v2v test cases (not redistributable)
2 # Copyright (C) 2014-2015 Red Hat Inc., Richard W.M. Jones
3 #
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 2 of the License, or
7 # (at your option) any later version.
8 #
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 # GNU General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17
18 dnl Process this file with autoconf to produce a configure script.
19
20 AC_INIT([virt-v2v-test-cases-nonfree],[1.0.0])
21 AC_CONFIG_MACRO_DIR([m4])
22 AM_INIT_AUTOMAKE([foreign])
23
24 AC_PROG_CC
25 AC_PROG_INSTALL
26
27 AC_PROG_SED
28
29 dnl Check for basic OCaml environment & findlib.
30 AC_PROG_OCAML
31 AC_PROG_FINDLIB
32
33 if test "x$OCAMLFIND" = "xno"; then
34     AC_MSG_ERROR([OCaml findlib is required])
35 fi
36
37 dnl Use ocamlfind to find the required packages ...
38
39 dnl Check for required OCaml packages.
40 AC_CHECK_OCAML_PKG(str)
41 if test "x$OCAML_PKG_str" = "xno"; then
42     AC_MSG_ERROR([Cannot find required OCaml package 'str'])
43 fi
44
45 AC_CHECK_OCAML_PKG(unix)
46 if test "x$OCAML_PKG_unix" = "xno"; then
47     AC_MSG_ERROR([Cannot find required OCaml package 'unix'])
48 fi
49
50 AC_CHECK_OCAML_PKG(gettext)
51 if test "x$OCAML_PKG_gettext" = "xno"; then
52     AC_MSG_ERROR([Cannot find required OCaml package 'gettext'])
53 fi
54
55 AC_CHECK_OCAML_PKG(libvirt)
56 if test "x$OCAML_PKG_libvirt" = "xno"; then
57     AC_MSG_ERROR([Cannot find required OCaml package 'libvirt'])
58 fi
59
60 AC_CHECK_OCAML_PKG(guestfs)
61 if test "x$OCAML_PKG_guestfs" = "xno"; then
62     AC_MSG_ERROR([Cannot find required OCaml package 'guestfs'])
63 fi
64
65 dnl Choose the installed v2v_test_harness module (default) or
66 dnl use --with-test-harness=/path/to/libguestfs/v2v/test-harness to
67 dnl compile against local libguestfs sources.
68
69 AC_ARG_WITH([test-harness],
70             [AS_HELP_STRING([--with-test-harness],
71                             [path to v2v test harness sources])],
72             [with_test_harness=$withval],
73             [with_test_harness=installed])
74 if test "x$with_test_harness" = "xinstalled"; then
75     AC_CHECK_OCAML_PKG(v2v_test_harness)
76     if test "x$OCAML_PKG_v2v_test_harness" = "xno"; then
77         AC_MSG_ERROR([Cannot find required OCaml package 'v2v_test_harness' (try: --with-test-harness=/path/to/libguestfs/v2v/test-harness)])
78     fi
79 else
80     AC_MSG_CHECKING([$with_test_harness contains the compiled v2v test harness])
81     if test ! -f $with_test_harness/v2v_test_harness.cmi ; then
82        AC_MSG_ERROR([$with_test_harness does not contain the compiled v2v test harness])
83     fi
84     AC_MSG_RESULT([yes])
85     AC_SUBST([TEST_HARNESS_DIR],[$with_test_harness])
86 fi
87 AM_CONDITIONAL([INSTALLED_TEST_HARNESS],
88                [test "x$with_test_harness" = "xinstalled"])
89
90 dnl libxml2 (required)
91 PKG_CHECK_MODULES([LIBXML2], [libxml-2.0])
92
93 dnl Summary.
94 echo "------------------------------------------------------------"
95 echo "Thanks for downloading" $PACKAGE_STRING
96 echo "------------------------------------------------------------"
97
98 dnl Produce output files.
99 AC_CONFIG_HEADERS([config.h])
100 AC_CONFIG_FILES([Makefile
101         rhel5xen-rhel/Makefile
102         vmware-rhel/Makefile
103         vmware-uefi/Makefile
104         vmware-win/Makefile
105         windows-virtio/Makefile])
106 AC_OUTPUT