diff options
author | Richard W.M. Jones <rjones@redhat.com> | 2008-01-05 15:16:31 +0000 |
---|---|---|
committer | Richard W.M. Jones <rjones@redhat.com> | 2008-01-05 15:16:31 +0000 |
commit | 3126bfee333b5c635dc60a54265936af06117f6a (patch) | |
tree | e08310b1d4b007eec44381390c84049b1dd8658b /aclocal.m4 | |
parent | 1e65c6c293a0f7917e87438330e2583bd38758dd (diff) | |
download | virt-top-3126bfee333b5c635dc60a54265936af06117f6a.tar.gz virt-top-3126bfee333b5c635dc60a54265936af06117f6a.tar.xz virt-top-3126bfee333b5c635dc60a54265936af06117f6a.zip |
Build libvirt and examples on Windows (MinGW).
* aclocal.m4: Add AC_CHECK_OCAML_MODULE to check for OCaml
modules directly (without ocamlfind being needed).
* configure.ac: Remove requirement for ocamlfind.
* config.guess, config.sub: Ship these files to guess host,
build and target.
* libvirt/Makefile.in, examples/Makefile.in: Change these
so they don't require ocamlfind, do the right thing on MinGW.
* Make.rules.in: Make.rules is now generated from this file.
File can use ocamlfind or direct ocaml commands as available.
* .hgignore: Ignore some generated files on Windows.
Diffstat (limited to 'aclocal.m4')
-rwxr-xr-x[-rw-r--r--] | aclocal.m4 | 49 |
1 files changed, 36 insertions, 13 deletions
diff --git a/aclocal.m4 b/aclocal.m4 index 55d5ceb..38ad15f 100644..100755 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -78,9 +78,8 @@ AC_SUBST(OCAMLLIB) AC_SUBST(OCAMLMKLIB) AC_SUBST(OCAMLDOC) ]) -dnl -dnl -dnl + + dnl macro AC_PROG_OCAML_TOOLS will check OCamllex and OCamlyacc : dnl OCAMLLEX "ocamllex" or "ocamllex.opt" if present dnl OCAMLYACC "ocamlyac" @@ -100,9 +99,8 @@ AC_CHECK_PROG(OCAMLYACC,ocamlyacc,ocamlyacc,AC_MSG_ERROR(Cannot find ocamlyacc.) AC_SUBST(OCAMLLEX) AC_SUBST(OCAMLYACC) ]) -dnl -dnl -dnl + + dnl AC_PROG_CAMLP4 checks for Camlp4 AC_DEFUN(AC_PROG_CAMLP4, [dnl @@ -116,21 +114,19 @@ if test "$CAMLP4"; then fi fi ]) -dnl -dnl -dnl + + dnl macro AC_PROG_FINDLIB will check for the presence of dnl ocamlfind AC_DEFUN(AC_PROG_FINDLIB, [dnl # checking for ocamlfind AC_CHECK_PROG(OCAMLFIND,ocamlfind,ocamlfind, - AC_MSG_ERROR(ocamlfind not found)) + AC_MSG_WARN([ocamlfind not found])) AC_SUBST(OCAMLFIND) ]) -dnl -dnl -dnl + + dnl AC_CHECK_OCAML_PKG checks wether a findlib package is present dnl defines pkg_name to "yes" AC_DEFUN(AC_CHECK_OCAML_PKG, @@ -145,3 +141,30 @@ AC_MSG_RESULT(not found) eval "pkg_`echo $1 | tr - _`=no" fi ]) + + +dnl AC_CHECK_OCAML_MODULE looks for a module in a given path +dnl 1st arg -> name (just for printing messages) +dnl 2nd arg -> env var name (set to include path, or "no" if not found) +dnl 3rd arg -> module to check +dnl 4th arg -> default include dirs to check +AC_DEFUN([AC_CHECK_OCAML_MODULE], +[dnl +AC_MSG_CHECKING(for module $1) +cat > conftest.ml <<EOF +open $3 +EOF +unset found +for $2 in $$2 $4 ; do + if $OCAMLC -c -I "$$2" conftest.ml >&5 2>&5 ; then + found=yes + break + fi +done +if test "$found" ; then + AC_MSG_RESULT($$2) +else + AC_MSG_RESULT(not found) + $2=no +fi +AC_SUBST($2)]) |