summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephane Glondu <steph@glondu.net>2019-08-21 16:31:45 +0200
committerStephane Glondu <steph@glondu.net>2019-08-21 16:31:45 +0200
commit44323d47b8f294ff3e6833865c551559e9edeff4 (patch)
tree8458b88fe2592d6a6298b8ae58186e4460e6c8a6
parente3abe2db017901c7d86880980f15abe72a09c809 (diff)
parentb90971105851c8462823929741336d93dc3895c3 (diff)
Merge tag 'upstream/0.6.1.4+git20190820.0.34f46b0' into debian/sid
Upstream git snapshot 34f46b0 of 2019-08-20
-rw-r--r--.gitignore63
-rw-r--r--MANIFEST3
-rw-r--r--Makefile.in4
-rw-r--r--README6
-rw-r--r--TODO.libvirt4
-rw-r--r--aclocal.m4170
-rwxr-xr-xconfig.guess1304
-rw-r--r--config.h.in61
-rwxr-xr-xconfig.sub2393
-rwxr-xr-xconfigure5531
-rw-r--r--configure.ac127
-rw-r--r--examples/.depend12
-rw-r--r--examples/Makefile.in30
-rw-r--r--examples/domain_events.ml5
-rw-r--r--examples/get_all_domain_stats.ml73
-rw-r--r--examples/get_cpu_stats.ml6
-rw-r--r--examples/list_domains.ml5
-rw-r--r--examples/list_secrets.ml48
-rw-r--r--examples/node_info.ml4
-rw-r--r--libvirt/.depend6
-rw-r--r--libvirt/Makefile.in27
-rwxr-xr-xlibvirt/generator.pl126
-rw-r--r--libvirt/libvirt.ml360
-rw-r--r--libvirt/libvirt.mli340
-rw-r--r--libvirt/libvirt_c.c2092
-rw-r--r--libvirt/libvirt_c_epilogue.c119
-rw-r--r--libvirt/libvirt_c_oneoffs.c596
-rw-r--r--libvirt/libvirt_c_prologue.c29
-rw-r--r--libvirt/libvirt_version.ml.in2
-rw-r--r--libvirt/libvirt_version.mli11
-rw-r--r--m4/ocaml.m4217
31 files changed, 3871 insertions, 9903 deletions
diff --git a/.gitignore b/.gitignore
index 71a245e..67f9134 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,41 +1,36 @@
-META
-ocaml-libvirt-*.tar.gz
-ocaml-libvirt-*.exe
-html
-configure
-config.log
-config.status
-config.h
-config.cache
-Makefile
-Make.rules
-*/Makefile
-autom4te.cache
-core
-core.*
+*.a
+*.cma
*.cmi
*.cmo
*.cmx
-*.cma
*.cmxa
-*.o
-*.so
-*.a
-*.opt
*.dll
*.exe
+*.o
+*.opt
+*.so
*~
-libvirt/libvirt_version.ml
-examples/domain_events
-examples/get_cpu_stats
-examples/list_domains
-examples/node_info
-virt-ctrl/virt-ctrl
-virt-top/virt-top
-virt-df/virt-df
-*.orig
-po/*.mo
-po/*.po.bak
-virt-df/virt_df_lvm2_lexer.ml
-virt-df/virt_df_lvm2_parser.ml
-virt-df/virt_df_lvm2_parser.mli
+Make.rules
+Makefile
+core
+core.*
+/META
+/aclocal.m4
+/autom4te.cache
+/config.cache
+/config.h
+/config.h.in
+/config.log
+/config.status
+/configure
+/examples/domain_events
+/examples/get_all_domain_stats
+/examples/get_cpu_stats
+/examples/list_domains
+/examples/list_secrets
+/examples/node_info
+/html/
+/libvirt/libvirt_c.c
+/libvirt/libvirt_version.ml
+/ocaml-libvirt-*.exe
+/ocaml-libvirt-*.tar.gz
diff --git a/MANIFEST b/MANIFEST
index b4f75d4..00d730b 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -10,14 +10,15 @@ COPYING.LIB
contrib/0001-Add-Libvirt.Domain.get_cpu_stats_total.patch
examples/.depend
examples/domain_events.ml
+examples/get_all_domain_stats.ml
examples/get_cpu_stats.ml
examples/list_domains.ml
+examples/list_secrets.ml
examples/node_info.ml
examples/Makefile.in
install-sh
libvirt/.depend
libvirt/generator.pl
-libvirt/libvirt_c.c
libvirt/libvirt_c_epilogue.c
libvirt/libvirt_c_oneoffs.c
libvirt/libvirt_c_prologue.c
diff --git a/Makefile.in b/Makefile.in
index 3b8b7ec..f119dbc 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -23,7 +23,7 @@ INSTALL = @INSTALL@
MAKENSIS = @MAKENSIS@
OCAMLDOC = @OCAMLDOC@
-OCAMLDOCFLAGS := -html -sort
+OCAMLDOCFLAGS := -html -sort -colorize-code
SUBDIRS = libvirt examples
@@ -37,10 +37,12 @@ clean:
for d in . $(SUBDIRS); do \
(cd $$d; rm -f *.cmi *.cmo *.cmx *.cma *.cmxa *.o *.a *.so *.opt *~ *.dll *.exe core); \
done
+ rm -f libvirt/libvirt_c.c
rm -f examples/list_domains
rm -f examples/node_info
rm -f examples/get_cpu_stats
rm -f examples/domain_events
+ rm -f examples/get_all_domain_stats
distclean: clean
rm -f config.h config.log config.status configure
diff --git a/README b/README
index 38a1902..5ff9829 100644
--- a/README
+++ b/README
@@ -2,8 +2,8 @@ ocaml-libvirt
----------------------------------------------------------------------
Copyright (C) 2007-2009 Richard W.M. Jones, Red Hat Inc.
-http://libvirt.org/ocaml/
-http://libvirt.org/
+https://libvirt.org/ocaml/
+https://libvirt.org/
This is a complete set of OCaml bindings around libvirt, exposing all
known functionality to OCaml programs.
@@ -28,7 +28,7 @@ Programming
For documentation on these bindings, read libvirt.mli and/or 'make
doc' and browse the HTML documentation in the html/ subdirectory.
-For documentation on libvirt itself, see http://libvirt.org/html/
+For documentation on libvirt itself, see https://libvirt.org/html/
License
diff --git a/TODO.libvirt b/TODO.libvirt
index d724074..d87b8b8 100644
--- a/TODO.libvirt
+++ b/TODO.libvirt
@@ -1,5 +1 @@
Turn VIR_ERR_NO_DOMAIN and NO_NETWORK errors into Not_found exceptions.
-
-We should add a way to use the authentication mechanisms, like
-virConnectOpenAuth:
-http://www.redhat.com/archives/libvir-list/2008-April/msg00235.html
diff --git a/aclocal.m4 b/aclocal.m4
deleted file mode 100644
index 38ad15f..0000000
--- a/aclocal.m4
+++ /dev/null
@@ -1,170 +0,0 @@
-dnl autoconf macros for OCaml
-dnl by Olivier Andrieu
-dnl modified by Richard W.M. Jones
-dnl from a configure.in by Jean-Christophe Filliâtre,
-dnl from a first script by Georges Mariano
-dnl
-dnl defines AC_PROG_OCAML that will check the OCaml compiler
-dnl and set the following variables :
-dnl OCAMLC "ocamlc" if present in the path, or a failure
-dnl or "ocamlc.opt" if present with same version number as ocamlc
-dnl OCAMLOPT "ocamlopt" (or "ocamlopt.opt" if present), or "no"
-dnl OCAMLBEST either "byte" if no native compiler was found,
-dnl or "opt" otherwise
-dnl OCAMLDEP "ocamldep"
-dnl OCAMLLIB the path to the ocaml standard library
-dnl OCAMLVERSION the ocaml version number
-AC_DEFUN(AC_PROG_OCAML,
-[dnl
-# checking for ocamlc
-AC_CHECK_PROG(OCAMLC,ocamlc,ocamlc,AC_MSG_ERROR(Cannot find ocamlc.))
-OCAMLVERSION=`$OCAMLC -v | sed -n -e 's|.*version* *\(.*\)$|\1|p' `
-AC_MSG_RESULT(OCaml version is $OCAMLVERSION)
-OCAMLLIB=`$OCAMLC -where 2>/dev/null || $OCAMLC -v|tail -1|cut -d ' ' -f 4`
-AC_MSG_RESULT(OCaml library path is $OCAMLLIB)
-# checking for ocamlopt
-AC_CHECK_PROG(OCAMLOPT,ocamlopt,ocamlopt)
-OCAMLBEST=byte
-if test -z "$OCAMLOPT"; then
- AC_MSG_WARN(Cannot find ocamlopt; bytecode compilation only.)
-else
- TMPVERSION=`$OCAMLOPT -v | sed -n -e 's|.*version* *\(.*\)$|\1|p' `
- if test "$TMPVERSION" != "$OCAMLVERSION" ; then
- AC_MSG_RESULT(versions differs from ocamlc; ocamlopt discarded.)
- unset OCAMLOPT
- else
- OCAMLBEST=opt
- fi
-fi
-# checking for ocamlc.opt
-AC_CHECK_PROG(OCAMLCDOTOPT,ocamlc.opt,ocamlc.opt)
-if test -z "$OCAMLCDOTOPT"; then
- TMPVERSION=`$OCAMLCDOTOPT -v | sed -n -e 's|.*version* *\(.*\)$|\1|p' `
- if test "$TMPVERSION" != "$OCAMLVERSION" ; then
- AC_MSG_RESULT(versions differs from ocamlc; ocamlc.opt discarded.)
- else
- OCAMLC=$OCAMLCDOTOPT
- fi
-fi
-# checking for ocamlopt.opt
-if test "$OCAMLOPT" ; then
- AC_CHECK_PROG(OCAMLOPTDOTOPT,ocamlopt.opt,ocamlopt.opt)
- if test "$OCAMLOPTDOTOPT"; then
- TMPVER=`$OCAMLOPTDOTOPT -v | sed -n -e 's|.*version* *\(.*\)$|\1|p' `
- if test "$TMPVER" != "$OCAMLVERSION" ; then
- AC_MSG_RESULT(version differs from ocamlc; ocamlopt.opt discarded.)
- else
- OCAMLOPT=$OCAMLOPTDOTOPT
- fi
- fi
-fi
-# checking for ocamldep
-AC_CHECK_PROG(OCAMLDEP,ocamldep,ocamldep,AC_MSG_ERROR(Cannot find ocamldep.))
-
-#checking for ocamlmktop
-AC_CHECK_PROG(OCAMLMKTOP,ocamlmktop,ocamlmktop, AC_MSG_WARN(Cannot find ocamlmktop.))
-#checking for ocamlmklib
-AC_CHECK_PROG(OCAMLMKLIB,ocamlmklib,ocamlmklib, AC_MSG_WARN(Cannot find ocamlmklib.))
-# checking for ocamldoc
-AC_CHECK_PROG(OCAMLDOC,ocamldoc,ocamldoc, AC_MSG_WARN(Cannot find ocamldoc.))
-
-
-AC_SUBST(OCAMLC)
-AC_SUBST(OCAMLOPT)
-AC_SUBST(OCAMLDEP)
-AC_SUBST(OCAMLBEST)
-AC_SUBST(OCAMLVERSION)
-AC_SUBST(OCAMLLIB)
-AC_SUBST(OCAMLMKLIB)
-AC_SUBST(OCAMLDOC)
-])
-
-
-dnl macro AC_PROG_OCAML_TOOLS will check OCamllex and OCamlyacc :
-dnl OCAMLLEX "ocamllex" or "ocamllex.opt" if present
-dnl OCAMLYACC "ocamlyac"
-AC_DEFUN(AC_PROG_OCAML_TOOLS,
-[dnl
-# checking for ocamllex and ocamlyacc
-AC_CHECK_PROG(OCAMLLEX,ocamllex,ocamllex)
-if test "$OCAMLLEX"; then
- AC_CHECK_PROG(OCAMLLEXDOTOPT,ocamllex.opt,ocamllex.opt)
- if test "$OCAMLLEXDOTOPT"; then
- OCAMLLEX=$OCAMLLEXDOTOPT
- fi
-else
- AC_MSG_ERROR(Cannot find ocamllex.)
-fi
-AC_CHECK_PROG(OCAMLYACC,ocamlyacc,ocamlyacc,AC_MSG_ERROR(Cannot find ocamlyacc.))
-AC_SUBST(OCAMLLEX)
-AC_SUBST(OCAMLYACC)
-])
-
-
-dnl AC_PROG_CAMLP4 checks for Camlp4
-AC_DEFUN(AC_PROG_CAMLP4,
-[dnl
-AC_REQUIRE([AC_PROG_OCAML])
-# checking for camlp4
-AC_CHECK_PROG(CAMLP4,camlp4,camlp4)
-if test "$CAMLP4"; then
- TMPVERSION=`$CAMLP4 -v 2>&1| sed -n -e 's|.*version *\(.*\)$|\1|p'`
- if test "$TMPVERSION" != "$OCAMLVERSION" ; then
- AC_MSG_RESULT(versions differs from ocamlc)
- fi
-fi
-])
-
-
-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_WARN([ocamlfind not found]))
-AC_SUBST(OCAMLFIND)
-])
-
-
-dnl AC_CHECK_OCAML_PKG checks wether a findlib package is present
-dnl defines pkg_name to "yes"
-AC_DEFUN(AC_CHECK_OCAML_PKG,
-[dnl
-AC_REQUIRE([AC_PROG_FINDLIB])
-AC_MSG_CHECKING(findlib package $1)
-if $OCAMLFIND query $1 >/dev/null 2>/dev/null; then
-AC_MSG_RESULT(found)
-eval "pkg_`echo $1 | tr - _`=yes"
-else
-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)])
diff --git a/config.guess b/config.guess
index 396482d..97ad073 100755
--- a/config.guess
+++ b/config.guess
@@ -1,14 +1,12 @@
#! /bin/sh
# Attempt to guess a canonical system name.
-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-# 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation,
-# Inc.
+# Copyright 1992-2019 Free Software Foundation, Inc.
-timestamp='2006-07-02'
+timestamp='2019-07-24'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
+# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
@@ -17,26 +15,22 @@ timestamp='2006-07-02'
# General Public License for more details.
#
# 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., 51 Franklin Street - Fifth Floor, Boston, MA
-# 02110-1301, USA.
+# along with this program; if not, see <https://www.gnu.org/licenses/>.
#
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-
-# Originally written by Per Bothner <per@bothner.com>.
-# Please send patches to <config-patches@gnu.org>. Submit a context
-# diff and a properly formatted ChangeLog entry.
+# the same distribution terms that you use for the rest of that
+# program. This Exception is an additional permission under section 7
+# of the GNU General Public License, version 3 ("GPLv3").
#
-# This script attempts to guess a canonical system name similar to
-# config.sub. If it succeeds, it prints the system name on stdout, and
-# exits with 0. Otherwise, it exits with 1.
+# Originally written by Per Bothner; maintained since 2000 by Ben Elliston.
#
-# The plan is that this can be called by configure scripts if you
-# don't specify an explicit build system type.
+# You can get the latest version of this script from:
+# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
+#
+# Please send patches to <config-patches@gnu.org>.
+
me=`echo "$0" | sed -e 's,.*/,,'`
@@ -45,7 +39,7 @@ Usage: $0 [OPTION]
Output the configuration name of the system \`$me' is run on.
-Operation modes:
+Options:
-h, --help print this help, then exit
-t, --time-stamp print date of last modification, then exit
-v, --version print version number, then exit
@@ -56,8 +50,7 @@ version="\
GNU config.guess ($timestamp)
Originally written by Per Bothner.
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
-Free Software Foundation, Inc.
+Copyright 1992-2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -91,8 +84,6 @@ if test $# != 0; then
exit 1
fi
-trap 'exit 1' 1 2 15
-
# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
# compiler to aid in system detection is discouraged as it requires
# temporary files to be created and, as you can see below, it is a
@@ -103,34 +94,38 @@ trap 'exit 1' 1 2 15
# Portable tmp directory creation inspired by the Autoconf team.
-set_cc_for_build='
-trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
-trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
-: ${TMPDIR=/tmp} ;
- { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
- { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
- { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
- { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
-dummy=$tmp/dummy ;
-tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
-case $CC_FOR_BUILD,$HOST_CC,$CC in
- ,,) echo "int x;" > $dummy.c ;
- for c in cc gcc c89 c99 ; do
- if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
- CC_FOR_BUILD="$c"; break ;
- fi ;
- done ;
- if test x"$CC_FOR_BUILD" = x ; then
- CC_FOR_BUILD=no_compiler_found ;
- fi
- ;;
- ,,*) CC_FOR_BUILD=$CC ;;
- ,*,*) CC_FOR_BUILD=$HOST_CC ;;
-esac ; set_cc_for_build= ;'
+tmp=
+# shellcheck disable=SC2172
+trap 'test -z "$tmp" || rm -fr "$tmp"' 0 1 2 13 15
+
+set_cc_for_build() {
+ : "${TMPDIR=/tmp}"
+ # shellcheck disable=SC2039
+ { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
+ { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir "$tmp" 2>/dev/null) ; } ||
+ { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir "$tmp" 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } ||
+ { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; }
+ dummy=$tmp/dummy
+ case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in
+ ,,) echo "int x;" > "$dummy.c"
+ for driver in cc gcc c89 c99 ; do
+ if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then
+ CC_FOR_BUILD="$driver"
+ break
+ fi
+ done
+ if test x"$CC_FOR_BUILD" = x ; then
+ CC_FOR_BUILD=no_compiler_found
+ fi
+ ;;
+ ,,*) CC_FOR_BUILD=$CC ;;
+ ,*,*) CC_FOR_BUILD=$HOST_CC ;;
+ esac
+}
# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
# (ghazi@noc.rutgers.edu 1994-08-24)
-if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
+if test -f /.attbin/uname ; then
PATH=$PATH:/.attbin ; export PATH
fi
@@ -139,12 +134,40 @@ UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
+case "$UNAME_SYSTEM" in
+Linux|GNU|GNU/*)
+ # If the system lacks a compiler, then just pick glibc.
+ # We could probably try harder.
+ LIBC=gnu
+
+ set_cc_for_build
+ cat <<-EOF > "$dummy.c"
+ #include <features.h>
+ #if defined(__UCLIBC__)
+ LIBC=uclibc
+ #elif defined(__dietlibc__)
+ LIBC=dietlibc
+ #else
+ LIBC=gnu
+ #endif
+ EOF
+ eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`"
+
+ # If ldd exists, use it to detect musl libc.
+ if command -v ldd >/dev/null && \
+ ldd --version 2>&1 | grep -q ^musl
+ then
+ LIBC=musl
+ fi
+ ;;
+esac
+
# Note: order is significant - the case branches are not exclusive.
-case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
+case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
*:NetBSD:*:*)
# NetBSD (nbsd) targets should (where applicable) match one or
- # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
+ # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
# *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
# switched to ELF, *-*-netbsd* would select the old
# object file format. This provides both forward
@@ -154,22 +177,33 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
# Note: NetBSD doesn't particularly care about the vendor
# portion of the name. We always set it to "unknown".
sysctl="sysctl -n hw.machine_arch"
- UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
- /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
- case "${UNAME_MACHINE_ARCH}" in
+ UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \
+ "/sbin/$sysctl" 2>/dev/null || \
+ "/usr/sbin/$sysctl" 2>/dev/null || \
+ echo unknown)`
+ case "$UNAME_MACHINE_ARCH" in
armeb) machine=armeb-unknown ;;
arm*) machine=arm-unknown ;;
sh3el) machine=shl-unknown ;;
sh3eb) machine=sh-unknown ;;
- *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
+ sh5el) machine=sh5le-unknown ;;
+ earmv*)
+ arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'`
+ endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'`
+ machine="${arch}${endian}"-unknown
+ ;;
+ *) machine="$UNAME_MACHINE_ARCH"-unknown ;;
esac
# The Operating System including object format, if it has switched
- # to ELF recently, or will in the future.
- case "${UNAME_MACHINE_ARCH}" in
+ # to ELF recently (or will in the future) and ABI.
+ case "$UNAME_MACHINE_ARCH" in
+ earm*)
+ os=netbsdelf
+ ;;
arm*|i386|m68k|ns32k|sh3*|sparc|vax)
- eval $set_cc_for_build
+ set_cc_for_build
if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
- | grep __ELF__ >/dev/null
+ | grep -q __ELF__
then
# Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
# Return netbsd for either. FIX?
@@ -179,7 +213,14 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
fi
;;
*)
- os=netbsd
+ os=netbsd
+ ;;
+ esac
+ # Determine ABI tags.
+ case "$UNAME_MACHINE_ARCH" in
+ earm*)
+ expr='s/^earmv[0-9]/-eabi/;s/eb$//'
+ abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"`
;;
esac
# The OS release
@@ -187,34 +228,57 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
# thus, need a distinct triplet. However, they do not need
# kernel version information, so it can be replaced with a
# suitable tag, in the style of linux-gnu.
- case "${UNAME_VERSION}" in
+ case "$UNAME_VERSION" in
Debian*)
release='-gnu'
;;
*)
- release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
+ release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2`
;;
esac
# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
# contains redundant information, the shorter form:
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
- echo "${machine}-${os}${release}"
+ echo "$machine-${os}${release}${abi-}"
+ exit ;;
+ *:Bitrig:*:*)
+ UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
+ echo "$UNAME_MACHINE_ARCH"-unknown-bitrig"$UNAME_RELEASE"
exit ;;
*:OpenBSD:*:*)
UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
- echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
+ echo "$UNAME_MACHINE_ARCH"-unknown-openbsd"$UNAME_RELEASE"
+ exit ;;
+ *:LibertyBSD:*:*)
+ UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'`
+ echo "$UNAME_MACHINE_ARCH"-unknown-libertybsd"$UNAME_RELEASE"
+ exit ;;
+ *:MidnightBSD:*:*)
+ echo "$UNAME_MACHINE"-unknown-midnightbsd"$UNAME_RELEASE"
exit ;;
*:ekkoBSD:*:*)
- echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
+ echo "$UNAME_MACHINE"-unknown-ekkobsd"$UNAME_RELEASE"
exit ;;
*:SolidBSD:*:*)
- echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
+ echo "$UNAME_MACHINE"-unknown-solidbsd"$UNAME_RELEASE"
+ exit ;;
+ *:OS108:*:*)
+ echo "$UNAME_MACHINE"-unknown-os108_"$UNAME_RELEASE"
exit ;;
macppc:MirBSD:*:*)
- echo powerpc-unknown-mirbsd${UNAME_RELEASE}
+ echo powerpc-unknown-mirbsd"$UNAME_RELEASE"
exit ;;
*:MirBSD:*:*)
- echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
+ echo "$UNAME_MACHINE"-unknown-mirbsd"$UNAME_RELEASE"
+ exit ;;
+ *:Sortix:*:*)
+ echo "$UNAME_MACHINE"-unknown-sortix
+ exit ;;
+ *:Redox:*:*)
+ echo "$UNAME_MACHINE"-unknown-redox
+ exit ;;
+ mips:OSF1:*.*)
+ echo mips-dec-osf1
exit ;;
alpha:OSF1:*:*)
case $UNAME_RELEASE in
@@ -222,7 +286,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
;;
*5.*)
- UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
+ UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
;;
esac
# According to Compaq, /usr/sbin/psrinfo has been available on
@@ -232,60 +296,54 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`
case "$ALPHA_CPU_TYPE" in
"EV4 (21064)")
- UNAME_MACHINE="alpha" ;;
+ UNAME_MACHINE=alpha ;;
"EV4.5 (21064)")
- UNAME_MACHINE="alpha" ;;
+ UNAME_MACHINE=alpha ;;
"LCA4 (21066/21068)")
- UNAME_MACHINE="alpha" ;;
+ UNAME_MACHINE=alpha ;;
"EV5 (21164)")
- UNAME_MACHINE="alphaev5" ;;
+ UNAME_MACHINE=alphaev5 ;;
"EV5.6 (21164A)")
- UNAME_MACHINE="alphaev56" ;;
+ UNAME_MACHINE=alphaev56 ;;
"EV5.6 (21164PC)")
- UNAME_MACHINE="alphapca56" ;;
+ UNAME_MACHINE=alphapca56 ;;
"EV5.7 (21164PC)")
- UNAME_MACHINE="alphapca57" ;;
+ UNAME_MACHINE=alphapca57 ;;
"EV6 (21264)")
- UNAME_MACHINE="alphaev6" ;;
+ UNAME_MACHINE=alphaev6 ;;
"EV6.7 (21264A)")
- UNAME_MACHINE="alphaev67" ;;
+ UNAME_MACHINE=alphaev67 ;;
"EV6.8CB (21264C)")
- UNAME_MACHINE="alphaev68" ;;
+ UNAME_MACHINE=alphaev68 ;;
"EV6.8AL (21264B)")
- UNAME_MACHINE="alphaev68" ;;
+ UNAME_MACHINE=alphaev68 ;;
"EV6.8CX (21264D)")
- UNAME_MACHINE="alphaev68" ;;
+ UNAME_MACHINE=alphaev68 ;;
"EV6.9A (21264/EV69A)")
- UNAME_MACHINE="alphaev69" ;;
+ UNAME_MACHINE=alphaev69 ;;
"EV7 (21364)")
- UNAME_MACHINE="alphaev7" ;;
+ UNAME_MACHINE=alphaev7 ;;
"EV7.9 (21364A)")
- UNAME_MACHINE="alphaev79" ;;
+ UNAME_MACHINE=alphaev79 ;;
esac
# A Pn.n version is a patched version.
# A Vn.n version is a released version.
# A Tn.n version is a released field test version.
# A Xn.n version is an unreleased experimental baselevel.
# 1.2 uses "1.2" for uname -r.
- echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
- exit ;;
- Alpha\ *:Windows_NT*:*)
- # How do we know it's Interix rather than the generic POSIX subsystem?
- # Should we change UNAME_MACHINE based on the output of uname instead
- # of the specific Alpha model?
- echo alpha-pc-interix
- exit ;;
- 21064:Windows_NT:50:3)
- echo alpha-dec-winnt3.5
- exit ;;
+ echo "$UNAME_MACHINE"-dec-osf"`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`"
+ # Reset EXIT trap before exiting to avoid spurious non-zero exit code.
+ exitcode=$?
+ trap '' 0
+ exit $exitcode ;;
Amiga*:UNIX_System_V:4.0:*)
echo m68k-unknown-sysv4
exit ;;
*:[Aa]miga[Oo][Ss]:*:*)
- echo ${UNAME_MACHINE}-unknown-amigaos
+ echo "$UNAME_MACHINE"-unknown-amigaos
exit ;;
*:[Mm]orph[Oo][Ss]:*:*)
- echo ${UNAME_MACHINE}-unknown-morphos
+ echo "$UNAME_MACHINE"-unknown-morphos
exit ;;
*:OS/390:*:*)
echo i370-ibm-openedition
@@ -294,12 +352,12 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
echo s390-ibm-zvmoe
exit ;;
*:OS400:*:*)
- echo powerpc-ibm-os400
+ echo powerpc-ibm-os400
exit ;;
arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
- echo arm-acorn-riscix${UNAME_RELEASE}
+ echo arm-acorn-riscix"$UNAME_RELEASE"
exit ;;
- arm:riscos:*:*|arm:RISCOS:*:*)
+ arm*:riscos:*:*|arm*:RISCOS:*:*)
echo arm-unknown-riscos
exit ;;
SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
@@ -323,20 +381,39 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
case `/usr/bin/uname -p` in
sparc) echo sparc-icl-nx7; exit ;;
esac ;;
+ s390x:SunOS:*:*)
+ echo "$UNAME_MACHINE"-ibm-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`"
+ exit ;;
sun4H:SunOS:5.*:*)
- echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ echo sparc-hal-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
exit ;;
sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
- echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit ;;
- i86pc:SunOS:5.*:*)
- echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ echo sparc-sun-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`"
+ exit ;;
+ i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
+ echo i386-pc-auroraux"$UNAME_RELEASE"
+ exit ;;
+ i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
+ set_cc_for_build
+ SUN_ARCH=i386
+ # If there is a compiler, see if it is configured for 64-bit objects.
+ # Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
+ # This test works for both compilers.
+ if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
+ if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
+ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
+ grep IS_64BIT_ARCH >/dev/null
+ then
+ SUN_ARCH=x86_64
+ fi
+ fi
+ echo "$SUN_ARCH"-pc-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
exit ;;
sun4*:SunOS:6*:*)
# According to config.sub, this is the proper way to canonicalize
# SunOS6. Hard to guess exactly what SunOS6 will be like, but
# it's likely to be more like Solaris than SunOS4.
- echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ echo sparc-sun-solaris3"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
exit ;;
sun4*:SunOS:*:*)
case "`/usr/bin/arch -k`" in
@@ -345,25 +422,25 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
;;
esac
# Japanese Language versions have a version number like `4.1.3-JL'.
- echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
+ echo sparc-sun-sunos"`echo "$UNAME_RELEASE"|sed -e 's/-/_/'`"
exit ;;
sun3*:SunOS:*:*)
- echo m68k-sun-sunos${UNAME_RELEASE}
+ echo m68k-sun-sunos"$UNAME_RELEASE"
exit ;;
sun*:*:4.2BSD:*)
UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
- test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
+ test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3
case "`/bin/arch`" in
sun3)
- echo m68k-sun-sunos${UNAME_RELEASE}
+ echo m68k-sun-sunos"$UNAME_RELEASE"
;;
sun4)
- echo sparc-sun-sunos${UNAME_RELEASE}
+ echo sparc-sun-sunos"$UNAME_RELEASE"
;;
esac
exit ;;
aushp:SunOS:*:*)
- echo sparc-auspex-sunos${UNAME_RELEASE}
+ echo sparc-auspex-sunos"$UNAME_RELEASE"
exit ;;
# The situation for MiNT is a little confusing. The machine name
# can be virtually everything (everything which is not
@@ -374,44 +451,44 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
# MiNT. But MiNT is downward compatible to TOS, so this should
# be no problem.
atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
- echo m68k-atari-mint${UNAME_RELEASE}
+ echo m68k-atari-mint"$UNAME_RELEASE"
exit ;;
atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
- echo m68k-atari-mint${UNAME_RELEASE}
- exit ;;
+ echo m68k-atari-mint"$UNAME_RELEASE"
+ exit ;;
*falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
- echo m68k-atari-mint${UNAME_RELEASE}
+ echo m68k-atari-mint"$UNAME_RELEASE"
exit ;;
milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
- echo m68k-milan-mint${UNAME_RELEASE}
- exit ;;
+ echo m68k-milan-mint"$UNAME_RELEASE"
+ exit ;;
hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
- echo m68k-hades-mint${UNAME_RELEASE}
- exit ;;
+ echo m68k-hades-mint"$UNAME_RELEASE"
+ exit ;;
*:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
- echo m68k-unknown-mint${UNAME_RELEASE}
- exit ;;
+ echo m68k-unknown-mint"$UNAME_RELEASE"
+ exit ;;
m68k:machten:*:*)
- echo m68k-apple-machten${UNAME_RELEASE}
+ echo m68k-apple-machten"$UNAME_RELEASE"
exit ;;
powerpc:machten:*:*)
- echo powerpc-apple-machten${UNAME_RELEASE}
+ echo powerpc-apple-machten"$UNAME_RELEASE"
exit ;;
RISC*:Mach:*:*)
echo mips-dec-mach_bsd4.3
exit ;;
RISC*:ULTRIX:*:*)
- echo mips-dec-ultrix${UNAME_RELEASE}
+ echo mips-dec-ultrix"$UNAME_RELEASE"
exit ;;
VAX*:ULTRIX*:*:*)
- echo vax-dec-ultrix${UNAME_RELEASE}
+ echo vax-dec-ultrix"$UNAME_RELEASE"
exit ;;
2020:CLIX:*:* | 2430:CLIX:*:*)
- echo clipper-intergraph-clix${UNAME_RELEASE}
+ echo clipper-intergraph-clix"$UNAME_RELEASE"
exit ;;
mips:*:*:UMIPS | mips:*:*:RISCos)
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
+ set_cc_for_build
+ sed 's/^ //' << EOF > "$dummy.c"
#ifdef __cplusplus
#include <stdio.h> /* for printf() prototype */
int main (int argc, char *argv[]) {
@@ -420,23 +497,23 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
#endif
#if defined (host_mips) && defined (MIPSEB)
#if defined (SYSTYPE_SYSV)
- printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
+ printf ("mips-mips-riscos%ssysv\\n", argv[1]); exit (0);
#endif
#if defined (SYSTYPE_SVR4)
- printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
+ printf ("mips-mips-riscos%ssvr4\\n", argv[1]); exit (0);
#endif
#if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
- printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
+ printf ("mips-mips-riscos%sbsd\\n", argv[1]); exit (0);
#endif
#endif
exit (-1);
}
EOF
- $CC_FOR_BUILD -o $dummy $dummy.c &&
- dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
- SYSTEM_NAME=`$dummy $dummyarg` &&
+ $CC_FOR_BUILD -o "$dummy" "$dummy.c" &&
+ dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` &&
+ SYSTEM_NAME=`"$dummy" "$dummyarg"` &&
{ echo "$SYSTEM_NAME"; exit; }
- echo mips-mips-riscos${UNAME_RELEASE}
+ echo mips-mips-riscos"$UNAME_RELEASE"
exit ;;
Motorola:PowerMAX_OS:*:*)
echo powerpc-motorola-powermax
@@ -460,21 +537,21 @@ EOF
echo m88k-motorola-sysv3
exit ;;
AViiON:dgux:*:*)
- # DG/UX returns AViiON for all architectures
- UNAME_PROCESSOR=`/usr/bin/uname -p`
- if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
+ # DG/UX returns AViiON for all architectures
+ UNAME_PROCESSOR=`/usr/bin/uname -p`
+ if [ "$UNAME_PROCESSOR" = mc88100 ] || [ "$UNAME_PROCESSOR" = mc88110 ]
then
- if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
- [ ${TARGET_BINARY_INTERFACE}x = x ]
+ if [ "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx ] || \
+ [ "$TARGET_BINARY_INTERFACE"x = x ]
then
- echo m88k-dg-dgux${UNAME_RELEASE}
+ echo m88k-dg-dgux"$UNAME_RELEASE"
else
- echo m88k-dg-dguxbcs${UNAME_RELEASE}
+ echo m88k-dg-dguxbcs"$UNAME_RELEASE"
fi
else
- echo i586-dg-dgux${UNAME_RELEASE}
+ echo i586-dg-dgux"$UNAME_RELEASE"
fi
- exit ;;
+ exit ;;
M88*:DolphinOS:*:*) # DolphinOS (SVR3)
echo m88k-dolphin-sysv3
exit ;;
@@ -489,7 +566,7 @@ EOF
echo m68k-tektronix-bsd
exit ;;
*:IRIX*:*:*)
- echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
+ echo mips-sgi-irix"`echo "$UNAME_RELEASE"|sed -e 's/-/_/g'`"
exit ;;
????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
@@ -501,14 +578,14 @@ EOF
if [ -x /usr/bin/oslevel ] ; then
IBM_REV=`/usr/bin/oslevel`
else
- IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+ IBM_REV="$UNAME_VERSION.$UNAME_RELEASE"
fi
- echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
+ echo "$UNAME_MACHINE"-ibm-aix"$IBM_REV"
exit ;;
*:AIX:2:3)
if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
+ set_cc_for_build
+ sed 's/^ //' << EOF > "$dummy.c"
#include <sys/systemcfg.h>
main()
@@ -519,7 +596,7 @@ EOF
exit(0);
}
EOF
- if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
+ if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"`
then
echo "$SYSTEM_NAME"
else
@@ -531,28 +608,29 @@ EOF
echo rs6000-ibm-aix3.2
fi
exit ;;
- *:AIX:*:[45])
+ *:AIX:*:[4567])
IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
- if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
+ if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then
IBM_ARCH=rs6000
else
IBM_ARCH=powerpc
fi
- if [ -x /usr/bin/oslevel ] ; then
- IBM_REV=`/usr/bin/oslevel`
+ if [ -x /usr/bin/lslpp ] ; then
+ IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc |
+ awk -F: '{ print $3 }' | sed s/[0-9]*$/0/`
else
- IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+ IBM_REV="$UNAME_VERSION.$UNAME_RELEASE"
fi
- echo ${IBM_ARCH}-ibm-aix${IBM_REV}
+ echo "$IBM_ARCH"-ibm-aix"$IBM_REV"
exit ;;
*:AIX:*:*)
echo rs6000-ibm-aix
exit ;;
- ibmrt:4.4BSD:*|romp-ibm:BSD:*)
+ ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*)
echo romp-ibm-bsd4.4
exit ;;
ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
- echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
+ echo romp-ibm-bsd"$UNAME_RELEASE" # 4.3 with uname added to
exit ;; # report: romp-ibm BSD 4.3
*:BOSX:*:*)
echo rs6000-bull-bosx
@@ -567,67 +645,67 @@ EOF
echo m68k-hp-bsd4.4
exit ;;
9000/[34678]??:HP-UX:*:*)
- HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
- case "${UNAME_MACHINE}" in
- 9000/31? ) HP_ARCH=m68000 ;;
- 9000/[34]?? ) HP_ARCH=m68k ;;
+ HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'`
+ case "$UNAME_MACHINE" in
+ 9000/31?) HP_ARCH=m68000 ;;
+ 9000/[34]??) HP_ARCH=m68k ;;
9000/[678][0-9][0-9])
if [ -x /usr/bin/getconf ]; then
sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
- sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
- case "${sc_cpu_version}" in
- 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
- 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
- 532) # CPU_PA_RISC2_0
- case "${sc_kernel_bits}" in
- 32) HP_ARCH="hppa2.0n" ;;
- 64) HP_ARCH="hppa2.0w" ;;
- '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20
- esac ;;
- esac
+ sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
+ case "$sc_cpu_version" in
+ 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0
+ 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1
+ 532) # CPU_PA_RISC2_0
+ case "$sc_kernel_bits" in
+ 32) HP_ARCH=hppa2.0n ;;
+ 64) HP_ARCH=hppa2.0w ;;
+ '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20
+ esac ;;
+ esac
fi
- if [ "${HP_ARCH}" = "" ]; then
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
+ if [ "$HP_ARCH" = "" ]; then
+ set_cc_for_build
+ sed 's/^ //' << EOF > "$dummy.c"
- #define _HPUX_SOURCE
- #include <stdlib.h>
- #include <unistd.h>
+ #define _HPUX_SOURCE
+ #include <stdlib.h>
+ #include <unistd.h>
- int main ()
- {
- #if defined(_SC_KERNEL_BITS)
- long bits = sysconf(_SC_KERNEL_BITS);
- #endif
- long cpu = sysconf (_SC_CPU_VERSION);
+ int main ()
+ {
+ #if defined(_SC_KERNEL_BITS)
+ long bits = sysconf(_SC_KERNEL_BITS);
+ #endif
+ long cpu = sysconf (_SC_CPU_VERSION);
- switch (cpu)
- {
- case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
- case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
- case CPU_PA_RISC2_0:
- #if defined(_SC_KERNEL_BITS)
- switch (bits)
- {
- case 64: puts ("hppa2.0w"); break;
- case 32: puts ("hppa2.0n"); break;
- default: puts ("hppa2.0"); break;
- } break;
- #else /* !defined(_SC_KERNEL_BITS) */
- puts ("hppa2.0"); break;
- #endif
- default: puts ("hppa1.0"); break;
- }
- exit (0);
- }
+ switch (cpu)
+ {
+ case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
+ case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
+ case CPU_PA_RISC2_0:
+ #if defined(_SC_KERNEL_BITS)
+ switch (bits)
+ {
+ case 64: puts ("hppa2.0w"); break;
+ case 32: puts ("hppa2.0n"); break;
+ default: puts ("hppa2.0"); break;
+ } break;
+ #else /* !defined(_SC_KERNEL_BITS) */
+ puts ("hppa2.0"); break;
+ #endif
+ default: puts ("hppa1.0"); break;
+ }
+ exit (0);
+ }
EOF
- (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
+ (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"`
test -z "$HP_ARCH" && HP_ARCH=hppa
fi ;;
esac
- if [ ${HP_ARCH} = "hppa2.0w" ]
+ if [ "$HP_ARCH" = hppa2.0w ]
then
- eval $set_cc_for_build
+ set_cc_for_build
# hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
# 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler
@@ -638,23 +716,23 @@ EOF
# $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
# => hppa64-hp-hpux11.23
- if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
- grep __LP64__ >/dev/null
+ if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) |
+ grep -q __LP64__
then
- HP_ARCH="hppa2.0w"
+ HP_ARCH=hppa2.0w
else
- HP_ARCH="hppa64"
+ HP_ARCH=hppa64
fi
fi
- echo ${HP_ARCH}-hp-hpux${HPUX_REV}
+ echo "$HP_ARCH"-hp-hpux"$HPUX_REV"
exit ;;
ia64:HP-UX:*:*)
- HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
- echo ia64-hp-hpux${HPUX_REV}
+ HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'`
+ echo ia64-hp-hpux"$HPUX_REV"
exit ;;
3050*:HI-UX:*:*)
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
+ set_cc_for_build
+ sed 's/^ //' << EOF > "$dummy.c"
#include <unistd.h>
int
main ()
@@ -679,11 +757,11 @@ EOF
exit (0);
}
EOF
- $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
+ $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` &&
{ echo "$SYSTEM_NAME"; exit; }
echo unknown-hitachi-hiuxwe2
exit ;;
- 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
+ 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*)
echo hppa1.1-hp-bsd
exit ;;
9000/8??:4.3bsd:*:*)
@@ -692,7 +770,7 @@ EOF
*9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
echo hppa1.0-hp-mpeix
exit ;;
- hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
+ hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*)
echo hppa1.1-hp-osf
exit ;;
hp8??:OSF1:*:*)
@@ -700,9 +778,9 @@ EOF
exit ;;
i*86:OSF1:*:*)
if [ -x /usr/sbin/sysversion ] ; then
- echo ${UNAME_MACHINE}-unknown-osf1mk
+ echo "$UNAME_MACHINE"-unknown-osf1mk
else
- echo ${UNAME_MACHINE}-unknown-osf1
+ echo "$UNAME_MACHINE"-unknown-osf1
fi
exit ;;
parisc*:Lites*:*:*)
@@ -710,309 +788,313 @@ EOF
exit ;;
C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
echo c1-convex-bsd
- exit ;;
+ exit ;;
C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
if getsysinfo -f scalar_acc
then echo c32-convex-bsd
else echo c2-convex-bsd
fi
- exit ;;
+ exit ;;
C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
echo c34-convex-bsd
- exit ;;
+ exit ;;
C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
echo c38-convex-bsd
- exit ;;
+ exit ;;
C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
echo c4-convex-bsd
- exit ;;
+ exit ;;
CRAY*Y-MP:*:*:*)
- echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ echo ymp-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
exit ;;
CRAY*[A-Z]90:*:*:*)
- echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
+ echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \
| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
-e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
-e 's/\.[^.]*$/.X/'
exit ;;
CRAY*TS:*:*:*)
- echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ echo t90-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
exit ;;
CRAY*T3E:*:*:*)
- echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ echo alphaev5-cray-unicosmk"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
exit ;;
CRAY*SV1:*:*:*)
- echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ echo sv1-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
exit ;;
*:UNICOS/mp:*:*)
- echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ echo craynv-cray-unicosmp"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
exit ;;
F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
- FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
- FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
- FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
- echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
- exit ;;
+ FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
+ FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
+ FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'`
+ echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+ exit ;;
5000:UNIX_System_V:4.*:*)
- FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
- FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
- echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+ FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
+ FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'`
+ echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
exit ;;
i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
- echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
+ echo "$UNAME_MACHINE"-pc-bsdi"$UNAME_RELEASE"
exit ;;
sparc*:BSD/OS:*:*)
- echo sparc-unknown-bsdi${UNAME_RELEASE}
+ echo sparc-unknown-bsdi"$UNAME_RELEASE"
exit ;;
*:BSD/OS:*:*)
- echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
+ echo "$UNAME_MACHINE"-unknown-bsdi"$UNAME_RELEASE"
+ exit ;;
+ arm:FreeBSD:*:*)
+ UNAME_PROCESSOR=`uname -p`
+ set_cc_for_build
+ if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
+ | grep -q __ARM_PCS_VFP
+ then
+ echo "${UNAME_PROCESSOR}"-unknown-freebsd"`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`"-gnueabi
+ else
+ echo "${UNAME_PROCESSOR}"-unknown-freebsd"`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`"-gnueabihf
+ fi
exit ;;
*:FreeBSD:*:*)
- case ${UNAME_MACHINE} in
- pc98)
- echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+ UNAME_PROCESSOR=`/usr/bin/uname -p`
+ case "$UNAME_PROCESSOR" in
amd64)
- echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
- *)
- echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+ UNAME_PROCESSOR=x86_64 ;;
+ i386)
+ UNAME_PROCESSOR=i586 ;;
esac
+ echo "$UNAME_PROCESSOR"-unknown-freebsd"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`"
exit ;;
i*:CYGWIN*:*)
- echo ${UNAME_MACHINE}-pc-cygwin
+ echo "$UNAME_MACHINE"-pc-cygwin
exit ;;
- i*:MINGW*:*)
- echo ${UNAME_MACHINE}-pc-mingw32
+ *:MINGW64*:*)
+ echo "$UNAME_MACHINE"-pc-mingw64
exit ;;
- i*:windows32*:*)
- # uname -m includes "-pc" on this system.
- echo ${UNAME_MACHINE}-mingw32
+ *:MINGW*:*)
+ echo "$UNAME_MACHINE"-pc-mingw32
exit ;;
- i*:PW*:*)
- echo ${UNAME_MACHINE}-pc-pw32
+ *:MSYS*:*)
+ echo "$UNAME_MACHINE"-pc-msys
exit ;;
- x86:Interix*:[3456]*)
- echo i586-pc-interix${UNAME_RELEASE}
- exit ;;
- EM64T:Interix*:[3456]*)
- echo x86_64-unknown-interix${UNAME_RELEASE}
- exit ;;
- [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
- echo i${UNAME_MACHINE}-pc-mks
- exit ;;
- i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
- # How do we know it's Interix rather than the generic POSIX subsystem?
- # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
- # UNAME_MACHINE based on the output of uname instead of i386?
- echo i586-pc-interix
+ i*:PW*:*)
+ echo "$UNAME_MACHINE"-pc-pw32
exit ;;
+ *:Interix*:*)
+ case "$UNAME_MACHINE" in
+ x86)
+ echo i586-pc-interix"$UNAME_RELEASE"
+ exit ;;
+ authenticamd | genuineintel | EM64T)
+ echo x86_64-unknown-interix"$UNAME_RELEASE"
+ exit ;;
+ IA64)
+ echo ia64-unknown-interix"$UNAME_RELEASE"
+ exit ;;
+ esac ;;
i*:UWIN*:*)
- echo ${UNAME_MACHINE}-pc-uwin
+ echo "$UNAME_MACHINE"-pc-uwin
exit ;;
amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
- echo x86_64-unknown-cygwin
- exit ;;
- p*:CYGWIN*:*)
- echo powerpcle-unknown-cygwin
+ echo x86_64-pc-cygwin
exit ;;
prep*:SunOS:5.*:*)
- echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ echo powerpcle-unknown-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
exit ;;
*:GNU:*:*)
# the GNU system
- echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
+ echo "`echo "$UNAME_MACHINE"|sed -e 's,[-/].*$,,'`-unknown-$LIBC`echo "$UNAME_RELEASE"|sed -e 's,/.*$,,'`"
exit ;;
*:GNU/*:*:*)
# other systems with GNU libc and userland
- echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
+ echo "$UNAME_MACHINE-unknown-`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`-$LIBC"
+ exit ;;
+ *:Minix:*:*)
+ echo "$UNAME_MACHINE"-unknown-minix
+ exit ;;
+ aarch64:Linux:*:*)
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
+ exit ;;
+ aarch64_be:Linux:*:*)
+ UNAME_MACHINE=aarch64_be
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
+ exit ;;
+ alpha:Linux:*:*)
+ case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
+ EV5) UNAME_MACHINE=alphaev5 ;;
+ EV56) UNAME_MACHINE=alphaev56 ;;
+ PCA56) UNAME_MACHINE=alphapca56 ;;
+ PCA57) UNAME_MACHINE=alphapca56 ;;
+ EV6) UNAME_MACHINE=alphaev6 ;;
+ EV67) UNAME_MACHINE=alphaev67 ;;
+ EV68*) UNAME_MACHINE=alphaev68 ;;
+ esac
+ objdump --private-headers /bin/sh | grep -q ld.so.1
+ if test "$?" = 0 ; then LIBC=gnulibc1 ; fi
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
exit ;;
- i*86:Minix:*:*)
- echo ${UNAME_MACHINE}-pc-minix
+ arc:Linux:*:* | arceb:Linux:*:*)
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
exit ;;
arm*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
+ set_cc_for_build
+ if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
+ | grep -q __ARM_EABI__
+ then
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
+ else
+ if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
+ | grep -q __ARM_PCS_VFP
+ then
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabi
+ else
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabihf
+ fi
+ fi
exit ;;
avr32*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
exit ;;
cris:Linux:*:*)
- echo cris-axis-linux-gnu
+ echo "$UNAME_MACHINE"-axis-linux-"$LIBC"
exit ;;
crisv32:Linux:*:*)
- echo crisv32-axis-linux-gnu
+ echo "$UNAME_MACHINE"-axis-linux-"$LIBC"
+ exit ;;
+ e2k:Linux:*:*)
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
exit ;;
frv:Linux:*:*)
- echo frv-unknown-linux-gnu
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
+ exit ;;
+ hexagon:Linux:*:*)
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
+ exit ;;
+ i*86:Linux:*:*)
+ echo "$UNAME_MACHINE"-pc-linux-"$LIBC"
exit ;;
ia64:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
+ exit ;;
+ k1om:Linux:*:*)
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
exit ;;
m32r*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
exit ;;
m68*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
exit ;;
- mips:Linux:*:*)
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
+ mips:Linux:*:* | mips64:Linux:*:*)
+ set_cc_for_build
+ IS_GLIBC=0
+ test x"${LIBC}" = xgnu && IS_GLIBC=1
+ sed 's/^ //' << EOF > "$dummy.c"
#undef CPU
#undef mips
#undef mipsel
- #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
- CPU=mipsel
+ #undef mips64
+ #undef mips64el
+ #if ${IS_GLIBC} && defined(_ABI64)
+ LIBCABI=gnuabi64
#else
- #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
- CPU=mips
+ #if ${IS_GLIBC} && defined(_ABIN32)
+ LIBCABI=gnuabin32
#else
- CPU=
+ LIBCABI=${LIBC}
#endif
#endif
-EOF
- eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
- /^CPU/{
- s: ::g
- p
- }'`"
- test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
- ;;
- mips64:Linux:*:*)
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
- #undef CPU
- #undef mips64
- #undef mips64el
+
+ #if ${IS_GLIBC} && defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6
+ CPU=mipsisa64r6
+ #else
+ #if ${IS_GLIBC} && !defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6
+ CPU=mipsisa32r6
+ #else
+ #if defined(__mips64)
+ CPU=mips64
+ #else
+ CPU=mips
+ #endif
+ #endif
+ #endif
+
#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
- CPU=mips64el
+ MIPS_ENDIAN=el
#else
#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
- CPU=mips64
+ MIPS_ENDIAN=
#else
- CPU=
+ MIPS_ENDIAN=
#endif
#endif
EOF
- eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
- /^CPU/{
- s: ::g
- p
- }'`"
- test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
+ eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU\|^MIPS_ENDIAN\|^LIBCABI'`"
+ test "x$CPU" != x && { echo "$CPU${MIPS_ENDIAN}-unknown-linux-$LIBCABI"; exit; }
;;
- or32:Linux:*:*)
- echo or32-unknown-linux-gnu
+ mips64el:Linux:*:*)
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
exit ;;
- ppc:Linux:*:*)
- echo powerpc-unknown-linux-gnu
+ openrisc*:Linux:*:*)
+ echo or1k-unknown-linux-"$LIBC"
exit ;;
- ppc64:Linux:*:*)
- echo powerpc64-unknown-linux-gnu
+ or32:Linux:*:* | or1k*:Linux:*:*)
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
exit ;;
- alpha:Linux:*:*)
- case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
- EV5) UNAME_MACHINE=alphaev5 ;;
- EV56) UNAME_MACHINE=alphaev56 ;;
- PCA56) UNAME_MACHINE=alphapca56 ;;
- PCA57) UNAME_MACHINE=alphapca56 ;;
- EV6) UNAME_MACHINE=alphaev6 ;;
- EV67) UNAME_MACHINE=alphaev67 ;;
- EV68*) UNAME_MACHINE=alphaev68 ;;
- esac
- objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
- if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
- echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
+ padre:Linux:*:*)
+ echo sparc-unknown-linux-"$LIBC"
+ exit ;;
+ parisc64:Linux:*:* | hppa64:Linux:*:*)
+ echo hppa64-unknown-linux-"$LIBC"
exit ;;
parisc:Linux:*:* | hppa:Linux:*:*)
# Look for CPU level
case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
- PA7*) echo hppa1.1-unknown-linux-gnu ;;
- PA8*) echo hppa2.0-unknown-linux-gnu ;;
- *) echo hppa-unknown-linux-gnu ;;
+ PA7*) echo hppa1.1-unknown-linux-"$LIBC" ;;
+ PA8*) echo hppa2.0-unknown-linux-"$LIBC" ;;
+ *) echo hppa-unknown-linux-"$LIBC" ;;
esac
exit ;;
- parisc64:Linux:*:* | hppa64:Linux:*:*)
- echo hppa64-unknown-linux-gnu
+ ppc64:Linux:*:*)
+ echo powerpc64-unknown-linux-"$LIBC"
+ exit ;;
+ ppc:Linux:*:*)
+ echo powerpc-unknown-linux-"$LIBC"
+ exit ;;
+ ppc64le:Linux:*:*)
+ echo powerpc64le-unknown-linux-"$LIBC"
+ exit ;;
+ ppcle:Linux:*:*)
+ echo powerpcle-unknown-linux-"$LIBC"
+ exit ;;
+ riscv32:Linux:*:* | riscv64:Linux:*:*)
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
exit ;;
s390:Linux:*:* | s390x:Linux:*:*)
- echo ${UNAME_MACHINE}-ibm-linux
+ echo "$UNAME_MACHINE"-ibm-linux-"$LIBC"
exit ;;
sh64*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
exit ;;
sh*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
exit ;;
sparc:Linux:*:* | sparc64:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
+ exit ;;
+ tile*:Linux:*:*)
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
exit ;;
vax:Linux:*:*)
- echo ${UNAME_MACHINE}-dec-linux-gnu
+ echo "$UNAME_MACHINE"-dec-linux-"$LIBC"
exit ;;
x86_64:Linux:*:*)
- echo x86_64-unknown-linux-gnu
+ echo "$UNAME_MACHINE"-pc-linux-"$LIBC"
+ exit ;;
+ xtensa*:Linux:*:*)
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
exit ;;
- i*86:Linux:*:*)
- # The BFD linker knows what the default object file format is, so
- # first see if it will tell us. cd to the root directory to prevent
- # problems with other programs or directories called `ld' in the path.
- # Set LC_ALL=C to ensure ld outputs messages in English.
- ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
- | sed -ne '/supported targets:/!d
- s/[ ][ ]*/ /g
- s/.*supported targets: *//
- s/ .*//
- p'`
- case "$ld_supported_targets" in
- elf32-i386)
- TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
- ;;
- a.out-i386-linux)
- echo "${UNAME_MACHINE}-pc-linux-gnuaout"
- exit ;;
- coff-i386)
- echo "${UNAME_MACHINE}-pc-linux-gnucoff"
- exit ;;
- "")
- # Either a pre-BFD a.out linker (linux-gnuoldld) or
- # one that does not give us useful --help.
- echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
- exit ;;
- esac
- # Determine whether the default compiler is a.out or elf
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
- #include <features.h>
- #ifdef __ELF__
- # ifdef __GLIBC__
- # if __GLIBC__ >= 2
- LIBC=gnu
- # else
- LIBC=gnulibc1
- # endif
- # else
- LIBC=gnulibc1
- # endif
- #else
- #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
- LIBC=gnu
- #else
- LIBC=gnuaout
- #endif
- #endif
- #ifdef __dietlibc__
- LIBC=dietlibc
- #endif
-EOF
- eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
- /^LIBC/{
- s: ::g
- p
- }'`"
- test x"${LIBC}" != x && {
- echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
- exit
- }
- test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; }
- ;;
i*86:DYNIX/ptx:4*:*)
# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
# earlier versions are messed up and put the nodename in both
@@ -1020,54 +1102,54 @@ EOF
echo i386-sequent-sysv4
exit ;;
i*86:UNIX_SV:4.2MP:2.*)
- # Unixware is an offshoot of SVR4, but it has its own version
- # number series starting with 2...
- # I am not positive that other SVR4 systems won't match this,
+ # Unixware is an offshoot of SVR4, but it has its own version
+ # number series starting with 2...
+ # I am not positive that other SVR4 systems won't match this,
# I just have to hope. -- rms.
- # Use sysv4.2uw... so that sysv4* matches it.
- echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
+ # Use sysv4.2uw... so that sysv4* matches it.
+ echo "$UNAME_MACHINE"-pc-sysv4.2uw"$UNAME_VERSION"
exit ;;
i*86:OS/2:*:*)
# If we were able to find `uname', then EMX Unix compatibility
# is probably installed.
- echo ${UNAME_MACHINE}-pc-os2-emx
+ echo "$UNAME_MACHINE"-pc-os2-emx
exit ;;
i*86:XTS-300:*:STOP)
- echo ${UNAME_MACHINE}-unknown-stop
+ echo "$UNAME_MACHINE"-unknown-stop
exit ;;
i*86:atheos:*:*)
- echo ${UNAME_MACHINE}-unknown-atheos
+ echo "$UNAME_MACHINE"-unknown-atheos
exit ;;
i*86:syllable:*:*)
- echo ${UNAME_MACHINE}-pc-syllable
+ echo "$UNAME_MACHINE"-pc-syllable
exit ;;
- i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
- echo i386-unknown-lynxos${UNAME_RELEASE}
+ i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
+ echo i386-unknown-lynxos"$UNAME_RELEASE"
exit ;;
i*86:*DOS:*:*)
- echo ${UNAME_MACHINE}-pc-msdosdjgpp
+ echo "$UNAME_MACHINE"-pc-msdosdjgpp
exit ;;
- i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
- UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
+ i*86:*:4.*:*)
+ UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'`
if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
- echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
+ echo "$UNAME_MACHINE"-univel-sysv"$UNAME_REL"
else
- echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
+ echo "$UNAME_MACHINE"-pc-sysv"$UNAME_REL"
fi
exit ;;
i*86:*:5:[678]*)
- # UnixWare 7.x, OpenUNIX and OpenServer 6.
+ # UnixWare 7.x, OpenUNIX and OpenServer 6.
case `/bin/uname -X | grep "^Machine"` in
*486*) UNAME_MACHINE=i486 ;;
*Pentium) UNAME_MACHINE=i586 ;;
*Pent*|*Celeron) UNAME_MACHINE=i686 ;;
esac
- echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
+ echo "$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}"
exit ;;
i*86:*:3.2:*)
if test -f /usr/options/cb.name; then
UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
- echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
+ echo "$UNAME_MACHINE"-pc-isc"$UNAME_REL"
elif /bin/uname -X 2>/dev/null >/dev/null ; then
UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
(/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
@@ -1077,17 +1159,20 @@ EOF
&& UNAME_MACHINE=i686
(/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
&& UNAME_MACHINE=i686
- echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
+ echo "$UNAME_MACHINE"-pc-sco"$UNAME_REL"
else
- echo ${UNAME_MACHINE}-pc-sysv32
+ echo "$UNAME_MACHINE"-pc-sysv32
fi
exit ;;
pc:*:*:*)
# Left here for compatibility:
- # uname -m prints for DJGPP always 'pc', but it prints nothing about
- # the processor, so we play safe by assuming i386.
- echo i386-pc-msdosdjgpp
- exit ;;
+ # uname -m prints for DJGPP always 'pc', but it prints nothing about
+ # the processor, so we play safe by assuming i586.
+ # Note: whatever this is, it MUST be the same as what config.sub
+ # prints for the "djgpp" host, or else GDB configure will decide that
+ # this is a cross-build.
+ echo i586-pc-msdosdjgpp
+ exit ;;
Intel:Mach:3*:*)
echo i386-pc-mach3
exit ;;
@@ -1096,9 +1181,9 @@ EOF
exit ;;
i860:*:4.*:*) # i860-SVR4
if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
- echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
+ echo i860-stardent-sysv"$UNAME_RELEASE" # Stardent Vistra i860-SVR4
else # Add other i860-SVR4 vendors below as they are discovered.
- echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
+ echo i860-unknown-sysv"$UNAME_RELEASE" # Unknown i860-SVR4
fi
exit ;;
mini*:CTIX:SYS*5:*)
@@ -1118,29 +1203,39 @@ EOF
test -r /etc/.relid \
&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
- && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
+ && { echo i486-ncr-sysv4.3"$OS_REL"; exit; }
/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
- && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
+ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;;
3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
- /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
- && { echo i486-ncr-sysv4; exit; } ;;
+ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+ && { echo i486-ncr-sysv4; exit; } ;;
+ NCR*:*:4.2:* | MPRAS*:*:4.2:*)
+ OS_REL='.3'
+ test -r /etc/.relid \
+ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
+ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+ && { echo i486-ncr-sysv4.3"$OS_REL"; exit; }
+ /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
+ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; }
+ /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
+ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;;
m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
- echo m68k-unknown-lynxos${UNAME_RELEASE}
+ echo m68k-unknown-lynxos"$UNAME_RELEASE"
exit ;;
mc68030:UNIX_System_V:4.*:*)
echo m68k-atari-sysv4
exit ;;
TSUNAMI:LynxOS:2.*:*)
- echo sparc-unknown-lynxos${UNAME_RELEASE}
+ echo sparc-unknown-lynxos"$UNAME_RELEASE"
exit ;;
rs6000:LynxOS:2.*:*)
- echo rs6000-unknown-lynxos${UNAME_RELEASE}
+ echo rs6000-unknown-lynxos"$UNAME_RELEASE"
exit ;;
- PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
- echo powerpc-unknown-lynxos${UNAME_RELEASE}
+ PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
+ echo powerpc-unknown-lynxos"$UNAME_RELEASE"
exit ;;
SM[BE]S:UNIX_SV:*:*)
- echo mips-dde-sysv${UNAME_RELEASE}
+ echo mips-dde-sysv"$UNAME_RELEASE"
exit ;;
RM*:ReliantUNIX-*:*:*)
echo mips-sni-sysv4
@@ -1151,15 +1246,15 @@ EOF
*:SINIX-*:*:*)
if uname -p 2>/dev/null >/dev/null ; then
UNAME_MACHINE=`(uname -p) 2>/dev/null`
- echo ${UNAME_MACHINE}-sni-sysv4
+ echo "$UNAME_MACHINE"-sni-sysv4
else
echo ns32k-sni-sysv
fi
exit ;;
- PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
- # says <Richard.M.Bartel@ccMail.Census.GOV>
- echo i586-unisys-sysv4
- exit ;;
+ PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
+ # says <Richard.M.Bartel@ccMail.Census.GOV>
+ echo i586-unisys-sysv4
+ exit ;;
*:UNIX_System_V:4*:FTX*)
# From Gerald Hewes <hewes@openmarket.com>.
# How about differentiating between stratus architectures? -djm
@@ -1171,25 +1266,25 @@ EOF
exit ;;
i*86:VOS:*:*)
# From Paul.Green@stratus.com.
- echo ${UNAME_MACHINE}-stratus-vos
+ echo "$UNAME_MACHINE"-stratus-vos
exit ;;
*:VOS:*:*)
# From Paul.Green@stratus.com.
echo hppa1.1-stratus-vos
exit ;;
mc68*:A/UX:*:*)
- echo m68k-apple-aux${UNAME_RELEASE}
+ echo m68k-apple-aux"$UNAME_RELEASE"
exit ;;
news*:NEWS-OS:6*:*)
echo mips-sony-newsos6
exit ;;
R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
if [ -d /usr/nec ]; then
- echo mips-nec-sysv${UNAME_RELEASE}
+ echo mips-nec-sysv"$UNAME_RELEASE"
else
- echo mips-unknown-sysv${UNAME_RELEASE}
+ echo mips-unknown-sysv"$UNAME_RELEASE"
fi
- exit ;;
+ exit ;;
BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
echo powerpc-be-beos
exit ;;
@@ -1199,44 +1294,101 @@ EOF
BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
echo i586-pc-beos
exit ;;
+ BePC:Haiku:*:*) # Haiku running on Intel PC compatible.
+ echo i586-pc-haiku
+ exit ;;
+ x86_64:Haiku:*:*)
+ echo x86_64-unknown-haiku
+ exit ;;
SX-4:SUPER-UX:*:*)
- echo sx4-nec-superux${UNAME_RELEASE}
+ echo sx4-nec-superux"$UNAME_RELEASE"
exit ;;
SX-5:SUPER-UX:*:*)
- echo sx5-nec-superux${UNAME_RELEASE}
+ echo sx5-nec-superux"$UNAME_RELEASE"
exit ;;
SX-6:SUPER-UX:*:*)
- echo sx6-nec-superux${UNAME_RELEASE}
+ echo sx6-nec-superux"$UNAME_RELEASE"
+ exit ;;
+ SX-7:SUPER-UX:*:*)
+ echo sx7-nec-superux"$UNAME_RELEASE"
+ exit ;;
+ SX-8:SUPER-UX:*:*)
+ echo sx8-nec-superux"$UNAME_RELEASE"
+ exit ;;
+ SX-8R:SUPER-UX:*:*)
+ echo sx8r-nec-superux"$UNAME_RELEASE"
+ exit ;;
+ SX-ACE:SUPER-UX:*:*)
+ echo sxace-nec-superux"$UNAME_RELEASE"
exit ;;
Power*:Rhapsody:*:*)
- echo powerpc-apple-rhapsody${UNAME_RELEASE}
+ echo powerpc-apple-rhapsody"$UNAME_RELEASE"
exit ;;
*:Rhapsody:*:*)
- echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
+ echo "$UNAME_MACHINE"-apple-rhapsody"$UNAME_RELEASE"
exit ;;
*:Darwin:*:*)
- UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
+ UNAME_PROCESSOR=`uname -p`
case $UNAME_PROCESSOR in
unknown) UNAME_PROCESSOR=powerpc ;;
esac
- echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
+ if command -v xcode-select > /dev/null 2> /dev/null && \
+ ! xcode-select --print-path > /dev/null 2> /dev/null ; then
+ # Avoid executing cc if there is no toolchain installed as
+ # cc will be a stub that puts up a graphical alert
+ # prompting the user to install developer tools.
+ CC_FOR_BUILD=no_compiler_found
+ else
+ set_cc_for_build
+ fi
+ if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
+ if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
+ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
+ grep IS_64BIT_ARCH >/dev/null
+ then
+ case $UNAME_PROCESSOR in
+ i386) UNAME_PROCESSOR=x86_64 ;;
+ powerpc) UNAME_PROCESSOR=powerpc64 ;;
+ esac
+ fi
+ # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc
+ if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \
+ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
+ grep IS_PPC >/dev/null
+ then
+ UNAME_PROCESSOR=powerpc
+ fi
+ elif test "$UNAME_PROCESSOR" = i386 ; then
+ # uname -m returns i386 or x86_64
+ UNAME_PROCESSOR=$UNAME_MACHINE
+ fi
+ echo "$UNAME_PROCESSOR"-apple-darwin"$UNAME_RELEASE"
exit ;;
*:procnto*:*:* | *:QNX:[0123456789]*:*)
UNAME_PROCESSOR=`uname -p`
- if test "$UNAME_PROCESSOR" = "x86"; then
+ if test "$UNAME_PROCESSOR" = x86; then
UNAME_PROCESSOR=i386
UNAME_MACHINE=pc
fi
- echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
+ echo "$UNAME_PROCESSOR"-"$UNAME_MACHINE"-nto-qnx"$UNAME_RELEASE"
exit ;;
*:QNX:*:4*)
echo i386-pc-qnx
exit ;;
- NSE-?:NONSTOP_KERNEL:*:*)
- echo nse-tandem-nsk${UNAME_RELEASE}
+ NEO-*:NONSTOP_KERNEL:*:*)
+ echo neo-tandem-nsk"$UNAME_RELEASE"
exit ;;
- NSR-?:NONSTOP_KERNEL:*:*)
- echo nsr-tandem-nsk${UNAME_RELEASE}
+ NSE-*:NONSTOP_KERNEL:*:*)
+ echo nse-tandem-nsk"$UNAME_RELEASE"
+ exit ;;
+ NSR-*:NONSTOP_KERNEL:*:*)
+ echo nsr-tandem-nsk"$UNAME_RELEASE"
+ exit ;;
+ NSV-*:NONSTOP_KERNEL:*:*)
+ echo nsv-tandem-nsk"$UNAME_RELEASE"
+ exit ;;
+ NSX-*:NONSTOP_KERNEL:*:*)
+ echo nsx-tandem-nsk"$UNAME_RELEASE"
exit ;;
*:NonStop-UX:*:*)
echo mips-compaq-nonstopux
@@ -1245,18 +1397,19 @@ EOF
echo bs2000-siemens-sysv
exit ;;
DS/*:UNIX_System_V:*:*)
- echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
+ echo "$UNAME_MACHINE"-"$UNAME_SYSTEM"-"$UNAME_RELEASE"
exit ;;
*:Plan9:*:*)
# "uname -m" is not consistent, so use $cputype instead. 386
# is converted to i386 for consistency with other x86
# operating systems.
- if test "$cputype" = "386"; then
+ # shellcheck disable=SC2154
+ if test "$cputype" = 386; then
UNAME_MACHINE=i386
else
UNAME_MACHINE="$cputype"
fi
- echo ${UNAME_MACHINE}-unknown-plan9
+ echo "$UNAME_MACHINE"-unknown-plan9
exit ;;
*:TOPS-10:*:*)
echo pdp10-unknown-tops10
@@ -1277,14 +1430,14 @@ EOF
echo pdp10-unknown-its
exit ;;
SEI:*:*:SEIUX)
- echo mips-sei-seiux${UNAME_RELEASE}
+ echo mips-sei-seiux"$UNAME_RELEASE"
exit ;;
*:DragonFly:*:*)
- echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
+ echo "$UNAME_MACHINE"-unknown-dragonfly"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`"
exit ;;
*:*VMS:*:*)
- UNAME_MACHINE=`(uname -p) 2>/dev/null`
- case "${UNAME_MACHINE}" in
+ UNAME_MACHINE=`(uname -p) 2>/dev/null`
+ case "$UNAME_MACHINE" in
A*) echo alpha-dec-vms ; exit ;;
I*) echo ia64-dec-vms ; exit ;;
V*) echo vax-dec-vms ; exit ;;
@@ -1293,21 +1446,39 @@ EOF
echo i386-pc-xenix
exit ;;
i*86:skyos:*:*)
- echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
+ echo "$UNAME_MACHINE"-pc-skyos"`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'`"
exit ;;
i*86:rdos:*:*)
- echo ${UNAME_MACHINE}-pc-rdos
+ echo "$UNAME_MACHINE"-pc-rdos
+ exit ;;
+ i*86:AROS:*:*)
+ echo "$UNAME_MACHINE"-pc-aros
+ exit ;;
+ x86_64:VMkernel:*:*)
+ echo "$UNAME_MACHINE"-unknown-esx
+ exit ;;
+ amd64:Isilon\ OneFS:*:*)
+ echo x86_64-unknown-onefs
+ exit ;;
+ *:Unleashed:*:*)
+ echo "$UNAME_MACHINE"-unknown-unleashed"$UNAME_RELEASE"
exit ;;
esac
-#echo '(No uname command or uname output not recognized.)' 1>&2
-#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
-
-eval $set_cc_for_build
-cat >$dummy.c <<EOF
+# No uname command or uname output not recognized.
+set_cc_for_build
+cat > "$dummy.c" <<EOF
#ifdef _SEQUENT_
-# include <sys/types.h>
-# include <sys/utsname.h>
+#include <sys/types.h>
+#include <sys/utsname.h>
+#endif
+#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__)
+#if defined (vax) || defined (__vax) || defined (__vax__) || defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__)
+#include <signal.h>
+#if defined(_SIZE_T_) || defined(SIGLOST)
+#include <sys/utsname.h>
+#endif
+#endif
#endif
main ()
{
@@ -1320,20 +1491,12 @@ main ()
#include <sys/param.h>
printf ("m68k-sony-newsos%s\n",
#ifdef NEWSOS4
- "4"
+ "4"
#else
- ""
+ ""
#endif
- ); exit (0);
-#endif
-#endif
-
-#if defined (__arm) && defined (__acorn) && defined (__unix)
- printf ("arm-acorn-riscix\n"); exit (0);
+ ); exit (0);
#endif
-
-#if defined (hp300) && !defined (hpux)
- printf ("m68k-hp-bsd\n"); exit (0);
#endif
#if defined (NeXT)
@@ -1375,39 +1538,54 @@ main ()
#endif
#if defined (_SEQUENT_)
- struct utsname un;
-
- uname(&un);
-
- if (strncmp(un.version, "V2", 2) == 0) {
- printf ("i386-sequent-ptx2\n"); exit (0);
- }
- if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
- printf ("i386-sequent-ptx1\n"); exit (0);
- }
- printf ("i386-sequent-ptx\n"); exit (0);
+ struct utsname un;
+ uname(&un);
+ if (strncmp(un.version, "V2", 2) == 0) {
+ printf ("i386-sequent-ptx2\n"); exit (0);
+ }
+ if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
+ printf ("i386-sequent-ptx1\n"); exit (0);
+ }
+ printf ("i386-sequent-ptx\n"); exit (0);
#endif
#if defined (vax)
-# if !defined (ultrix)
-# include <sys/param.h>
-# if defined (BSD)
-# if BSD == 43
- printf ("vax-dec-bsd4.3\n"); exit (0);
-# else
-# if BSD == 199006
- printf ("vax-dec-bsd4.3reno\n"); exit (0);
-# else
- printf ("vax-dec-bsd\n"); exit (0);
-# endif
-# endif
-# else
- printf ("vax-dec-bsd\n"); exit (0);
-# endif
-# else
- printf ("vax-dec-ultrix\n"); exit (0);
-# endif
+#if !defined (ultrix)
+#include <sys/param.h>
+#if defined (BSD)
+#if BSD == 43
+ printf ("vax-dec-bsd4.3\n"); exit (0);
+#else
+#if BSD == 199006
+ printf ("vax-dec-bsd4.3reno\n"); exit (0);
+#else
+ printf ("vax-dec-bsd\n"); exit (0);
+#endif
+#endif
+#else
+ printf ("vax-dec-bsd\n"); exit (0);
+#endif
+#else
+#if defined(_SIZE_T_) || defined(SIGLOST)
+ struct utsname un;
+ uname (&un);
+ printf ("vax-dec-ultrix%s\n", un.release); exit (0);
+#else
+ printf ("vax-dec-ultrix\n"); exit (0);
+#endif
+#endif
+#endif
+#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__)
+#if defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__)
+#if defined(_SIZE_T_) || defined(SIGLOST)
+ struct utsname *un;
+ uname (&un);
+ printf ("mips-dec-ultrix%s\n", un.release); exit (0);
+#else
+ printf ("mips-dec-ultrix\n"); exit (0);
+#endif
+#endif
#endif
#if defined (alliant) && defined (i860)
@@ -1418,54 +1596,38 @@ main ()
}
EOF
-$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
+$CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null && SYSTEM_NAME=`$dummy` &&
{ echo "$SYSTEM_NAME"; exit; }
# Apollos put the system type in the environment.
+test -d /usr/apollo && { echo "$ISP-apollo-$SYSTYPE"; exit; }
-test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
+echo "$0: unable to guess system type" >&2
-# Convex versions that predate uname can use getsysinfo(1)
+case "$UNAME_MACHINE:$UNAME_SYSTEM" in
+ mips:Linux | mips64:Linux)
+ # If we got here on MIPS GNU/Linux, output extra information.
+ cat >&2 <<EOF
-if [ -x /usr/convex/getsysinfo ]
-then
- case `getsysinfo -f cpu_type` in
- c1*)
- echo c1-convex-bsd
- exit ;;
- c2*)
- if getsysinfo -f scalar_acc
- then echo c32-convex-bsd
- else echo c2-convex-bsd
- fi
- exit ;;
- c34*)
- echo c34-convex-bsd
- exit ;;
- c38*)
- echo c38-convex-bsd
- exit ;;
- c4*)
- echo c4-convex-bsd
- exit ;;
- esac
-fi
+NOTE: MIPS GNU/Linux systems require a C compiler to fully recognize
+the system type. Please install a C compiler and try again.
+EOF
+ ;;
+esac
cat >&2 <<EOF
-$0: unable to guess system type
-This script, last modified $timestamp, has failed to recognize
-the operating system you are using. It is advised that you
-download the most up to date version of the config scripts from
+This script (version $timestamp), has failed to recognize the
+operating system you are using. If your script is old, overwrite *all*
+copies of config.guess and config.sub with the latest versions from:
- http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.guess
+ https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
and
- http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.sub
+ https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
-If the version you run ($0) is already up to date, please
-send the following data and any information you think might be
-pertinent to <config-patches@gnu.org> in order to provide the needed
-information to handle your system.
+If $0 has already been updated, send the following data and any
+information you think might be pertinent to config-patches@gnu.org to
+provide the necessary information to handle your system.
config.guess timestamp = $timestamp
@@ -1484,16 +1646,16 @@ hostinfo = `(hostinfo) 2>/dev/null`
/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null`
/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
-UNAME_MACHINE = ${UNAME_MACHINE}
-UNAME_RELEASE = ${UNAME_RELEASE}
-UNAME_SYSTEM = ${UNAME_SYSTEM}
-UNAME_VERSION = ${UNAME_VERSION}
+UNAME_MACHINE = "$UNAME_MACHINE"
+UNAME_RELEASE = "$UNAME_RELEASE"
+UNAME_SYSTEM = "$UNAME_SYSTEM"
+UNAME_VERSION = "$UNAME_VERSION"
EOF
exit 1
# Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
# time-stamp-start: "timestamp='"
# time-stamp-format: "%:y-%02m-%02d"
# time-stamp-end: "'"
diff --git a/config.h.in b/config.h.in
deleted file mode 100644
index c0bd102..0000000
--- a/config.h.in
+++ /dev/null
@@ -1,61 +0,0 @@
-/* config.h.in. Generated from configure.ac by autoheader. */
-
-/* Define to 1 if you have the <inttypes.h> header file. */
-#undef HAVE_INTTYPES_H
-
-/* Define to 1 if you have the `virt' library (-lvirt). */
-#undef HAVE_LIBVIRT
-
-/* Define to 1 if you have the <memory.h> header file. */
-#undef HAVE_MEMORY_H
-
-/* Define to 1 if you have the <stdint.h> header file. */
-#undef HAVE_STDINT_H
-
-/* Define to 1 if you have the <stdlib.h> header file. */
-#undef HAVE_STDLIB_H
-
-/* Define to 1 if you have the <strings.h> header file. */
-#undef HAVE_STRINGS_H
-
-/* Define to 1 if you have the <string.h> header file. */
-#undef HAVE_STRING_H
-
-/* Define to 1 if you have the <sys/stat.h> header file. */
-#undef HAVE_SYS_STAT_H
-
-/* Define to 1 if you have the <sys/types.h> header file. */
-#undef HAVE_SYS_TYPES_H
-
-/* Define to 1 if you have the <unistd.h> header file. */
-#undef HAVE_UNISTD_H
-
-/* Define to 1 if your C compiler doesn't accept -c and -o together. */
-#undef NO_MINUS_C_MINUS_O
-
-/* Define to the address where bug reports for this package should be sent. */
-#undef PACKAGE_BUGREPORT
-
-/* Define to the full name of this package. */
-#undef PACKAGE_NAME
-
-/* Define to the full name and version of this package. */
-#undef PACKAGE_STRING
-
-/* Define to the one symbol short name of this package. */
-#undef PACKAGE_TARNAME
-
-/* Define to the home page for this package. */
-#undef PACKAGE_URL
-
-/* Define to the version of this package. */
-#undef PACKAGE_VERSION
-
-/* Define to 1 if the C compiler supports function prototypes. */
-#undef PROTOTYPES
-
-/* Define to 1 if you have the ANSI C header files. */
-#undef STDC_HEADERS
-
-/* Define like PROTOTYPES; this can be used by system headers. */
-#undef __PROTOTYPES
diff --git a/config.sub b/config.sub
index fab0aa3..a318a46 100755
--- a/config.sub
+++ b/config.sub
@@ -1,44 +1,40 @@
#! /bin/sh
# Configuration validation subroutine script.
-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-# 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation,
-# Inc.
+# Copyright 1992-2019 Free Software Foundation, Inc.
-timestamp='2006-09-20'
+timestamp='2019-06-30'
-# This file is (in principle) common to ALL GNU software.
-# The presence of a machine in this file suggests that SOME GNU software
-# can handle that machine. It does not imply ALL GNU software can.
-#
-# This file is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
+# This file is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
-# This program 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 General Public License for more details.
+# This program 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
+# General Public License for more details.
#
# 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., 51 Franklin Street - Fifth Floor, Boston, MA
-# 02110-1301, USA.
+# along with this program; if not, see <https://www.gnu.org/licenses/>.
#
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
+# the same distribution terms that you use for the rest of that
+# program. This Exception is an additional permission under section 7
+# of the GNU General Public License, version 3 ("GPLv3").
-# Please send patches to <config-patches@gnu.org>. Submit a context
-# diff and a properly formatted ChangeLog entry.
+# Please send patches to <config-patches@gnu.org>.
#
# Configuration subroutine to validate and canonicalize a configuration type.
# Supply the specified configuration type as an argument.
# If it is invalid, we print an error message on stderr and exit with code 1.
# Otherwise, we print the canonical config type on stdout and succeed.
+# You can get the latest version of this script from:
+# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
+
# This file is supposed to be the same for all GNU packages
# and recognize all the CPU types, system types and aliases
# that are meaningful with *any* GNU software.
@@ -57,12 +53,11 @@ timestamp='2006-09-20'
me=`echo "$0" | sed -e 's,.*/,,'`
usage="\
-Usage: $0 [OPTION] CPU-MFR-OPSYS
- $0 [OPTION] ALIAS
+Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS
Canonicalize a configuration name.
-Operation modes:
+Options:
-h, --help print this help, then exit
-t, --time-stamp print date of last modification, then exit
-v, --version print version number, then exit
@@ -72,8 +67,7 @@ Report bugs and patches to <config-patches@gnu.org>."
version="\
GNU config.sub ($timestamp)
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
-Free Software Foundation, Inc.
+Copyright 1992-2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -95,12 +89,12 @@ while test $# -gt 0 ; do
- ) # Use stdin as input.
break ;;
-* )
- echo "$me: invalid option $1$help"
+ echo "$me: invalid option $1$help" >&2
exit 1 ;;
*local*)
# First pass through any local machine types.
- echo $1
+ echo "$1"
exit ;;
* )
@@ -116,1054 +110,1164 @@ case $# in
exit 1;;
esac
-# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
-# Here we must recognize all the valid KERNEL-OS combinations.
-maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
-case $maybe_os in
- nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
- uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
- storm-chaos* | os2-emx* | rtmk-nova*)
- os=-$maybe_os
- basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
- ;;
- *)
- basic_machine=`echo $1 | sed 's/-[^-]*$//'`
- if [ $basic_machine != $1 ]
- then os=`echo $1 | sed 's/.*-/-/'`
- else os=; fi
- ;;
-esac
+# Split fields of configuration type
+# shellcheck disable=SC2162
+IFS="-" read field1 field2 field3 field4 <<EOF
+$1
+EOF
-### Let's recognize common machines as not being operating systems so
-### that things like config.sub decstation-3100 work. We also
-### recognize some manufacturers as not being operating systems, so we
-### can provide default operating systems below.
-case $os in
- -sun*os*)
- # Prevent following clause from handling this invalid input.
- ;;
- -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
- -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
- -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
- -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
- -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
- -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
- -apple | -axis | -knuth | -cray)
- os=
- basic_machine=$1
- ;;
- -sim | -cisco | -oki | -wec | -winbond)
- os=
- basic_machine=$1
- ;;
- -scout)
- ;;
- -wrs)
- os=-vxworks
- basic_machine=$1
- ;;
- -chorusos*)
- os=-chorusos
- basic_machine=$1
- ;;
- -chorusrdb)
- os=-chorusrdb
- basic_machine=$1
- ;;
- -hiux*)
- os=-hiuxwe2
- ;;
- -sco6)
- os=-sco5v6
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco5)
- os=-sco3.2v5
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco4)
- os=-sco3.2v4
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco3.2.[4-9]*)
- os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco3.2v[4-9]*)
- # Don't forget version if it is 3.2v4 or newer.
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco5v6*)
- # Don't forget version if it is 3.2v4 or newer.
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+# Separate into logical components for further validation
+case $1 in
+ *-*-*-*-*)
+ echo Invalid configuration \`"$1"\': more than four components >&2
+ exit 1
;;
- -sco*)
- os=-sco3.2v2
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ *-*-*-*)
+ basic_machine=$field1-$field2
+ os=$field3-$field4
;;
- -udk*)
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ *-*-*)
+ # Ambiguous whether COMPANY is present, or skipped and KERNEL-OS is two
+ # parts
+ maybe_os=$field2-$field3
+ case $maybe_os in
+ nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc \
+ | linux-newlib* | linux-musl* | linux-uclibc* | uclinux-uclibc* \
+ | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \
+ | netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \
+ | storm-chaos* | os2-emx* | rtmk-nova*)
+ basic_machine=$field1
+ os=$maybe_os
+ ;;
+ android-linux)
+ basic_machine=$field1-unknown
+ os=linux-android
+ ;;
+ *)
+ basic_machine=$field1-$field2
+ os=$field3
+ ;;
+ esac
;;
- -isc)
- os=-isc2.2
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ *-*)
+ # A lone config we happen to match not fitting any pattern
+ case $field1-$field2 in
+ decstation-3100)
+ basic_machine=mips-dec
+ os=
+ ;;
+ *-*)
+ # Second component is usually, but not always the OS
+ case $field2 in
+ # Prevent following clause from handling this valid os
+ sun*os*)
+ basic_machine=$field1
+ os=$field2
+ ;;
+ # Manufacturers
+ dec* | mips* | sequent* | encore* | pc533* | sgi* | sony* \
+ | att* | 7300* | 3300* | delta* | motorola* | sun[234]* \
+ | unicom* | ibm* | next | hp | isi* | apollo | altos* \
+ | convergent* | ncr* | news | 32* | 3600* | 3100* \
+ | hitachi* | c[123]* | convex* | sun | crds | omron* | dg \
+ | ultra | tti* | harris | dolphin | highlevel | gould \
+ | cbm | ns | masscomp | apple | axis | knuth | cray \
+ | microblaze* | sim | cisco \
+ | oki | wec | wrs | winbond)
+ basic_machine=$field1-$field2
+ os=
+ ;;
+ *)
+ basic_machine=$field1
+ os=$field2
+ ;;
+ esac
+ ;;
+ esac
;;
- -clix*)
- basic_machine=clipper-intergraph
+ *)
+ # Convert single-component short-hands not valid as part of
+ # multi-component configurations.
+ case $field1 in
+ 386bsd)
+ basic_machine=i386-pc
+ os=bsd
+ ;;
+ a29khif)
+ basic_machine=a29k-amd
+ os=udi
+ ;;
+ adobe68k)
+ basic_machine=m68010-adobe
+ os=scout
+ ;;
+ alliant)
+ basic_machine=fx80-alliant
+ os=
+ ;;
+ altos | altos3068)
+ basic_machine=m68k-altos
+ os=
+ ;;
+ am29k)
+ basic_machine=a29k-none
+ os=bsd
+ ;;
+ amdahl)
+ basic_machine=580-amdahl
+ os=sysv
+ ;;
+ amiga)
+ basic_machine=m68k-unknown
+ os=
+ ;;
+ amigaos | amigados)
+ basic_machine=m68k-unknown
+ os=amigaos
+ ;;
+ amigaunix | amix)
+ basic_machine=m68k-unknown
+ os=sysv4
+ ;;
+ apollo68)
+ basic_machine=m68k-apollo
+ os=sysv
+ ;;
+ apollo68bsd)
+ basic_machine=m68k-apollo
+ os=bsd
+ ;;
+ aros)
+ basic_machine=i386-pc
+ os=aros
+ ;;
+ aux)
+ basic_machine=m68k-apple
+ os=aux
+ ;;
+ balance)
+ basic_machine=ns32k-sequent
+ os=dynix
+ ;;
+ blackfin)
+ basic_machine=bfin-unknown
+ os=linux
+ ;;
+ cegcc)
+ basic_machine=arm-unknown
+ os=cegcc
+ ;;
+ convex-c1)
+ basic_machine=c1-convex
+ os=bsd
+ ;;
+ convex-c2)
+ basic_machine=c2-convex
+ os=bsd
+ ;;
+ convex-c32)
+ basic_machine=c32-convex
+ os=bsd
+ ;;
+ convex-c34)
+ basic_machine=c34-convex
+ os=bsd
+ ;;
+ convex-c38)
+ basic_machine=c38-convex
+ os=bsd
+ ;;
+ cray)
+ basic_machine=j90-cray
+ os=unicos
+ ;;
+ crds | unos)
+ basic_machine=m68k-crds
+ os=
+ ;;
+ da30)
+ basic_machine=m68k-da30
+ os=
+ ;;
+ decstation | pmax | pmin | dec3100 | decstatn)
+ basic_machine=mips-dec
+ os=
+ ;;
+ delta88)
+ basic_machine=m88k-motorola
+ os=sysv3
+ ;;
+ dicos)
+ basic_machine=i686-pc
+ os=dicos
+ ;;
+ djgpp)
+ basic_machine=i586-pc
+ os=msdosdjgpp
+ ;;
+ ebmon29k)
+ basic_machine=a29k-amd
+ os=ebmon
+ ;;
+ es1800 | OSE68k | ose68k | ose | OSE)
+ basic_machine=m68k-ericsson
+ os=ose
+ ;;
+ gmicro)
+ basic_machine=tron-gmicro
+ os=sysv
+ ;;
+ go32)
+ basic_machine=i386-pc
+ os=go32
+ ;;
+ h8300hms)
+ basic_machine=h8300-hitachi
+ os=hms
+ ;;
+ h8300xray)
+ basic_machine=h8300-hitachi
+ os=xray
+ ;;
+ h8500hms)
+ basic_machine=h8500-hitachi
+ os=hms
+ ;;
+ harris)
+ basic_machine=m88k-harris
+ os=sysv3
+ ;;
+ hp300 | hp300hpux)
+ basic_machine=m68k-hp
+ os=hpux
+ ;;
+ hp300bsd)
+ basic_machine=m68k-hp
+ os=bsd
+ ;;
+ hppaosf)
+ basic_machine=hppa1.1-hp
+ os=osf
+ ;;
+ hppro)
+ basic_machine=hppa1.1-hp
+ os=proelf
+ ;;
+ i386mach)
+ basic_machine=i386-mach
+ os=mach
+ ;;
+ isi68 | isi)
+ basic_machine=m68k-isi
+ os=sysv
+ ;;
+ m68knommu)
+ basic_machine=m68k-unknown
+ os=linux
+ ;;
+ magnum | m3230)
+ basic_machine=mips-mips
+ os=sysv
+ ;;
+ merlin)
+ basic_machine=ns32k-utek
+ os=sysv
+ ;;
+ mingw64)
+ basic_machine=x86_64-pc
+ os=mingw64
+ ;;
+ mingw32)
+ basic_machine=i686-pc
+ os=mingw32
+ ;;
+ mingw32ce)
+ basic_machine=arm-unknown
+ os=mingw32ce
+ ;;
+ monitor)
+ basic_machine=m68k-rom68k
+ os=coff
+ ;;
+ morphos)
+ basic_machine=powerpc-unknown
+ os=morphos
+ ;;
+ moxiebox)
+ basic_machine=moxie-unknown
+ os=moxiebox
+ ;;
+ msdos)
+ basic_machine=i386-pc
+ os=msdos
+ ;;
+ msys)
+ basic_machine=i686-pc
+ os=msys
+ ;;
+ mvs)
+ basic_machine=i370-ibm
+ os=mvs
+ ;;
+ nacl)
+ basic_machine=le32-unknown
+ os=nacl
+ ;;
+ ncr3000)
+ basic_machine=i486-ncr
+ os=sysv4
+ ;;
+ netbsd386)
+ basic_machine=i386-pc
+ os=netbsd
+ ;;
+ netwinder)
+ basic_machine=armv4l-rebel
+ os=linux
+ ;;
+ news | news700 | news800 | news900)
+ basic_machine=m68k-sony
+ os=newsos
+ ;;
+ news1000)
+ basic_machine=m68030-sony
+ os=newsos
+ ;;
+ necv70)
+ basic_machine=v70-nec
+ os=sysv
+ ;;
+ nh3000)
+ basic_machine=m68k-harris
+ os=cxux
+ ;;
+ nh[45]000)
+ basic_machine=m88k-harris
+ os=cxux
+ ;;
+ nindy960)
+ basic_machine=i960-intel
+ os=nindy
+ ;;
+ mon960)
+ basic_machine=i960-intel
+ os=mon960
+ ;;
+ nonstopux)
+ basic_machine=mips-compaq
+ os=nonstopux
+ ;;
+ os400)
+ basic_machine=powerpc-ibm
+ os=os400
+ ;;
+ OSE68000 | ose68000)
+ basic_machine=m68000-ericsson
+ os=ose
+ ;;
+ os68k)
+ basic_machine=m68k-none
+ os=os68k
+ ;;
+ paragon)
+ basic_machine=i860-intel
+ os=osf
+ ;;
+ parisc)
+ basic_machine=hppa-unknown
+ os=linux
+ ;;
+ pw32)
+ basic_machine=i586-unknown
+ os=pw32
+ ;;
+ rdos | rdos64)
+ basic_machine=x86_64-pc
+ os=rdos
+ ;;
+ rdos32)
+ basic_machine=i386-pc
+ os=rdos
+ ;;
+ rom68k)
+ basic_machine=m68k-rom68k
+ os=coff
+ ;;
+ sa29200)
+ basic_machine=a29k-amd
+ os=udi
+ ;;
+ sei)
+ basic_machine=mips-sei
+ os=seiux
+ ;;
+ sequent)
+ basic_machine=i386-sequent
+ os=
+ ;;
+ sps7)
+ basic_machine=m68k-bull
+ os=sysv2
+ ;;
+ st2000)
+ basic_machine=m68k-tandem
+ os=
+ ;;
+ stratus)
+ basic_machine=i860-stratus
+ os=sysv4
+ ;;
+ sun2)
+ basic_machine=m68000-sun
+ os=
+ ;;
+ sun2os3)
+ basic_machine=m68000-sun
+ os=sunos3
+ ;;
+ sun2os4)
+ basic_machine=m68000-sun
+ os=sunos4
+ ;;
+ sun3)
+ basic_machine=m68k-sun
+ os=
+ ;;
+ sun3os3)
+ basic_machine=m68k-sun
+ os=sunos3
+ ;;
+ sun3os4)
+ basic_machine=m68k-sun
+ os=sunos4
+ ;;
+ sun4)
+ basic_machine=sparc-sun
+ os=
+ ;;
+ sun4os3)
+ basic_machine=sparc-sun
+ os=sunos3
+ ;;
+ sun4os4)
+ basic_machine=sparc-sun
+ os=sunos4
+ ;;
+ sun4sol2)
+ basic_machine=sparc-sun
+ os=solaris2
+ ;;
+ sun386 | sun386i | roadrunner)
+ basic_machine=i386-sun
+ os=
+ ;;
+ sv1)
+ basic_machine=sv1-cray
+ os=unicos
+ ;;
+ symmetry)
+ basic_machine=i386-sequent
+ os=dynix
+ ;;
+ t3e)
+ basic_machine=alphaev5-cray
+ os=unicos
+ ;;
+ t90)
+ basic_machine=t90-cray
+ os=unicos
+ ;;
+ toad1)
+ basic_machine=pdp10-xkl
+ os=tops20
+ ;;
+ tpf)
+ basic_machine=s390x-ibm
+ os=tpf
+ ;;
+ udi29k)
+ basic_machine=a29k-amd
+ os=udi
+ ;;
+ ultra3)
+ basic_machine=a29k-nyu
+ os=sym1
+ ;;
+ v810 | necv810)
+ basic_machine=v810-nec
+ os=none
+ ;;
+ vaxv)
+ basic_machine=vax-dec
+ os=sysv
+ ;;
+ vms)
+ basic_machine=vax-dec
+ os=vms
+ ;;
+ vsta)
+ basic_machine=i386-pc
+ os=vsta
+ ;;
+ vxworks960)
+ basic_machine=i960-wrs
+ os=vxworks
+ ;;
+ vxworks68)
+ basic_machine=m68k-wrs
+ os=vxworks
+ ;;
+ vxworks29k)
+ basic_machine=a29k-wrs
+ os=vxworks
+ ;;
+ xbox)
+ basic_machine=i686-pc
+ os=mingw32
+ ;;
+ ymp)
+ basic_machine=ymp-cray
+ os=unicos
+ ;;
+ *)
+ basic_machine=$1
+ os=
+ ;;
+ esac
;;
- -isc*)
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+esac
+
+# Decode 1-component or ad-hoc basic machines
+case $basic_machine in
+ # Here we handle the default manufacturer of certain CPU types. It is in
+ # some cases the only manufacturer, in others, it is the most popular.
+ w89k)
+ cpu=hppa1.1
+ vendor=winbond
;;
- -lynx*)
- os=-lynxos
+ op50n)
+ cpu=hppa1.1
+ vendor=oki
;;
- -ptx*)
- basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
+ op60c)
+ cpu=hppa1.1
+ vendor=oki
;;
- -windowsnt*)
- os=`echo $os | sed -e 's/windowsnt/winnt/'`
+ ibm*)
+ cpu=i370
+ vendor=ibm
;;
- -psos*)
- os=-psos
+ orion105)
+ cpu=clipper
+ vendor=highlevel
;;
- -mint | -mint[0-9]*)
- basic_machine=m68k-atari
- os=-mint
+ mac | mpw | mac-mpw)
+ cpu=m68k
+ vendor=apple
;;
-esac
-
-# Decode aliases for certain CPU-COMPANY combinations.
-case $basic_machine in
- # Recognize the basic CPU types without company name.
- # Some are omitted here because they have special meanings below.
- 1750a | 580 \
- | a29k \
- | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
- | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
- | am33_2.0 \
- | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
- | bfin \
- | c4x | clipper \
- | d10v | d30v | dlx | dsp16xx \
- | fr30 | frv \
- | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
- | i370 | i860 | i960 | ia64 \
- | ip2k | iq2000 \
- | m32c | m32r | m32rle | m68000 | m68k | m88k \
- | maxq | mb | microblaze | mcore \
- | mips | mipsbe | mipseb | mipsel | mipsle \
- | mips16 \
- | mips64 | mips64el \
- | mips64vr | mips64vrel \
- | mips64orion | mips64orionel \
- | mips64vr4100 | mips64vr4100el \
- | mips64vr4300 | mips64vr4300el \
- | mips64vr5000 | mips64vr5000el \
- | mips64vr5900 | mips64vr5900el \
- | mipsisa32 | mipsisa32el \
- | mipsisa32r2 | mipsisa32r2el \
- | mipsisa64 | mipsisa64el \
- | mipsisa64r2 | mipsisa64r2el \
- | mipsisa64sb1 | mipsisa64sb1el \
- | mipsisa64sr71k | mipsisa64sr71kel \
- | mipstx39 | mipstx39el \
- | mn10200 | mn10300 \
- | mt \
- | msp430 \
- | nios | nios2 \
- | ns16k | ns32k \
- | or32 \
- | pdp10 | pdp11 | pj | pjl \
- | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
- | pyramid \
- | score \
- | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
- | sh64 | sh64le \
- | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
- | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
- | spu | strongarm \
- | tahoe | thumb | tic4x | tic80 | tron \
- | v850 | v850e \
- | we32k \
- | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
- | z8k)
- basic_machine=$basic_machine-unknown
- ;;
- m6811 | m68hc11 | m6812 | m68hc12)
- # Motorola 68HC11/12.
- basic_machine=$basic_machine-unknown
- os=-none
- ;;
- m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
- ;;
- ms1)
- basic_machine=mt-unknown
+ pmac | pmac-mpw)
+ cpu=powerpc
+ vendor=apple
;;
- # We use `pc' rather than `unknown'
- # because (1) that's what they normally are, and
- # (2) the word "unknown" tends to confuse beginning users.
- i*86 | x86_64)
- basic_machine=$basic_machine-pc
- ;;
- # Object if more than one company name word.
- *-*-*)
- echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
- exit 1
- ;;
- # Recognize the basic CPU types with company name.
- 580-* \
- | a29k-* \
- | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
- | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
- | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
- | arm-* | armbe-* | armle-* | armeb-* | armv*-* \
- | avr-* | avr32-* \
- | bfin-* | bs2000-* \
- | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
- | clipper-* | craynv-* | cydra-* \
- | d10v-* | d30v-* | dlx-* \
- | elxsi-* \
- | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \
- | h8300-* | h8500-* \
- | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
- | i*86-* | i860-* | i960-* | ia64-* \
- | ip2k-* | iq2000-* \
- | m32c-* | m32r-* | m32rle-* \
- | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
- | m88110-* | m88k-* | maxq-* | mcore-* \
- | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
- | mips16-* \
- | mips64-* | mips64el-* \
- | mips64vr-* | mips64vrel-* \
- | mips64orion-* | mips64orionel-* \
- | mips64vr4100-* | mips64vr4100el-* \
- | mips64vr4300-* | mips64vr4300el-* \
- | mips64vr5000-* | mips64vr5000el-* \
- | mips64vr5900-* | mips64vr5900el-* \
- | mipsisa32-* | mipsisa32el-* \
- | mipsisa32r2-* | mipsisa32r2el-* \
- | mipsisa64-* | mipsisa64el-* \
- | mipsisa64r2-* | mipsisa64r2el-* \
- | mipsisa64sb1-* | mipsisa64sb1el-* \
- | mipsisa64sr71k-* | mipsisa64sr71kel-* \
- | mipstx39-* | mipstx39el-* \
- | mmix-* \
- | mt-* \
- | msp430-* \
- | nios-* | nios2-* \
- | none-* | np1-* | ns16k-* | ns32k-* \
- | orion-* \
- | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
- | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
- | pyramid-* \
- | romp-* | rs6000-* \
- | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
- | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
- | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
- | sparclite-* \
- | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
- | tahoe-* | thumb-* \
- | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
- | tron-* \
- | v850-* | v850e-* | vax-* \
- | we32k-* \
- | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
- | xstormy16-* | xtensa-* \
- | ymp-* \
- | z8k-*)
- ;;
# Recognize the various machine names and aliases which stand
# for a CPU type and a company and sometimes even an OS.
- 386bsd)
- basic_machine=i386-unknown
- os=-bsd
- ;;
3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
- basic_machine=m68000-att
+ cpu=m68000
+ vendor=att
;;
3b*)
- basic_machine=we32k-att
- ;;
- a29khif)
- basic_machine=a29k-amd
- os=-udi
- ;;
- abacus)
- basic_machine=abacus-unknown
- ;;
- adobe68k)
- basic_machine=m68010-adobe
- os=-scout
- ;;
- alliant | fx80)
- basic_machine=fx80-alliant
- ;;
- altos | altos3068)
- basic_machine=m68k-altos
- ;;
- am29k)
- basic_machine=a29k-none
- os=-bsd
- ;;
- amd64)
- basic_machine=x86_64-pc
- ;;
- amd64-*)
- basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- amdahl)
- basic_machine=580-amdahl
- os=-sysv
- ;;
- amiga | amiga-*)
- basic_machine=m68k-unknown
- ;;
- amigaos | amigados)
- basic_machine=m68k-unknown
- os=-amigaos
- ;;
- amigaunix | amix)
- basic_machine=m68k-unknown
- os=-sysv4
- ;;
- apollo68)
- basic_machine=m68k-apollo
- os=-sysv
- ;;
- apollo68bsd)
- basic_machine=m68k-apollo
- os=-bsd
- ;;
- aux)
- basic_machine=m68k-apple
- os=-aux
- ;;
- balance)
- basic_machine=ns32k-sequent
- os=-dynix
- ;;
- c90)
- basic_machine=c90-cray
- os=-unicos
- ;;
- convex-c1)
- basic_machine=c1-convex
- os=-bsd
- ;;
- convex-c2)
- basic_machine=c2-convex
- os=-bsd
- ;;
- convex-c32)
- basic_machine=c32-convex
- os=-bsd
- ;;
- convex-c34)
- basic_machine=c34-convex
- os=-bsd
- ;;
- convex-c38)
- basic_machine=c38-convex
- os=-bsd
- ;;
- cray | j90)
- basic_machine=j90-cray
- os=-unicos
- ;;
- craynv)
- basic_machine=craynv-cray
- os=-unicosmp
+ cpu=we32k
+ vendor=att
;;
- cr16c)
- basic_machine=cr16c-unknown
- os=-elf
- ;;
- crds | unos)
- basic_machine=m68k-crds
- ;;
- crisv32 | crisv32-* | etraxfs*)
- basic_machine=crisv32-axis
- ;;
- cris | cris-* | etrax*)
- basic_machine=cris-axis
- ;;
- crx)
- basic_machine=crx-unknown
- os=-elf
- ;;
- da30 | da30-*)
- basic_machine=m68k-da30
- ;;
- decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
- basic_machine=mips-dec
+ bluegene*)
+ cpu=powerpc
+ vendor=ibm
+ os=cnk
;;
decsystem10* | dec10*)
- basic_machine=pdp10-dec
- os=-tops10
+ cpu=pdp10
+ vendor=dec
+ os=tops10
;;
decsystem20* | dec20*)
- basic_machine=pdp10-dec
- os=-tops20
+ cpu=pdp10
+ vendor=dec
+ os=tops20
;;
delta | 3300 | motorola-3300 | motorola-delta \
| 3300-motorola | delta-motorola)
- basic_machine=m68k-motorola
+ cpu=m68k
+ vendor=motorola
;;
- delta88)
- basic_machine=m88k-motorola
- os=-sysv3
- ;;
- djgpp)
- basic_machine=i586-pc
- os=-msdosdjgpp
- ;;
- dpx20 | dpx20-*)
- basic_machine=rs6000-bull
- os=-bosx
- ;;
- dpx2* | dpx2*-bull)
- basic_machine=m68k-bull
- os=-sysv3
- ;;
- ebmon29k)
- basic_machine=a29k-amd
- os=-ebmon
- ;;
- elxsi)
- basic_machine=elxsi-elxsi
- os=-bsd
+ dpx2*)
+ cpu=m68k
+ vendor=bull
+ os=sysv3
;;
encore | umax | mmax)
- basic_machine=ns32k-encore
+ cpu=ns32k
+ vendor=encore
;;
- es1800 | OSE68k | ose68k | ose | OSE)
- basic_machine=m68k-ericsson
- os=-ose
+ elxsi)
+ cpu=elxsi
+ vendor=elxsi
+ os=${os:-bsd}
;;
fx2800)
- basic_machine=i860-alliant
+ cpu=i860
+ vendor=alliant
;;
genix)
- basic_machine=ns32k-ns
- ;;
- gmicro)
- basic_machine=tron-gmicro
- os=-sysv
- ;;
- go32)
- basic_machine=i386-pc
- os=-go32
+ cpu=ns32k
+ vendor=ns
;;
h3050r* | hiux*)
- basic_machine=hppa1.1-hitachi
- os=-hiuxwe2
- ;;
- h8300hms)
- basic_machine=h8300-hitachi
- os=-hms
- ;;
- h8300xray)
- basic_machine=h8300-hitachi
- os=-xray
- ;;
- h8500hms)
- basic_machine=h8500-hitachi
- os=-hms
- ;;
- harris)
- basic_machine=m88k-harris
- os=-sysv3
- ;;
- hp300-*)
- basic_machine=m68k-hp
- ;;
- hp300bsd)
- basic_machine=m68k-hp
- os=-bsd
- ;;
- hp300hpux)
- basic_machine=m68k-hp
- os=-hpux
+ cpu=hppa1.1
+ vendor=hitachi
+ os=hiuxwe2
;;
hp3k9[0-9][0-9] | hp9[0-9][0-9])
- basic_machine=hppa1.0-hp
+ cpu=hppa1.0
+ vendor=hp
;;
hp9k2[0-9][0-9] | hp9k31[0-9])
- basic_machine=m68000-hp
+ cpu=m68000
+ vendor=hp
;;
hp9k3[2-9][0-9])
- basic_machine=m68k-hp
+ cpu=m68k
+ vendor=hp
;;
hp9k6[0-9][0-9] | hp6[0-9][0-9])
- basic_machine=hppa1.0-hp
+ cpu=hppa1.0
+ vendor=hp
;;
hp9k7[0-79][0-9] | hp7[0-79][0-9])
- basic_machine=hppa1.1-hp
+ cpu=hppa1.1
+ vendor=hp
;;
hp9k78[0-9] | hp78[0-9])
# FIXME: really hppa2.0-hp
- basic_machine=hppa1.1-hp
+ cpu=hppa1.1
+ vendor=hp
;;
hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
# FIXME: really hppa2.0-hp
- basic_machine=hppa1.1-hp
+ cpu=hppa1.1
+ vendor=hp
;;
hp9k8[0-9][13679] | hp8[0-9][13679])
- basic_machine=hppa1.1-hp
+ cpu=hppa1.1
+ vendor=hp
;;
hp9k8[0-9][0-9] | hp8[0-9][0-9])
- basic_machine=hppa1.0-hp
- ;;
- hppa-next)
- os=-nextstep3
+ cpu=hppa1.0
+ vendor=hp
;;
- hppaosf)
- basic_machine=hppa1.1-hp
- os=-osf
- ;;
- hppro)
- basic_machine=hppa1.1-hp
- os=-proelf
- ;;
- i370-ibm* | ibm*)
- basic_machine=i370-ibm
- ;;
-# I'm not sure what "Sysv32" means. Should this be sysv3.2?
i*86v32)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
- os=-sysv32
+ cpu=`echo "$1" | sed -e 's/86.*/86/'`
+ vendor=pc
+ os=sysv32
;;
i*86v4*)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
- os=-sysv4
+ cpu=`echo "$1" | sed -e 's/86.*/86/'`
+ vendor=pc
+ os=sysv4
;;
i*86v)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
- os=-sysv
+ cpu=`echo "$1" | sed -e 's/86.*/86/'`
+ vendor=pc
+ os=sysv
;;
i*86sol2)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
- os=-solaris2
+ cpu=`echo "$1" | sed -e 's/86.*/86/'`
+ vendor=pc
+ os=solaris2
;;
- i386mach)
- basic_machine=i386-mach
- os=-mach
- ;;
- i386-vsta | vsta)
- basic_machine=i386-unknown
- os=-vsta
+ j90 | j90-cray)
+ cpu=j90
+ vendor=cray
+ os=${os:-unicos}
;;
iris | iris4d)
- basic_machine=mips-sgi
+ cpu=mips
+ vendor=sgi
case $os in
- -irix*)
+ irix*)
;;
*)
- os=-irix4
+ os=irix4
;;
esac
;;
- isi68 | isi)
- basic_machine=m68k-isi
- os=-sysv
- ;;
- m88k-omron*)
- basic_machine=m88k-omron
- ;;
- magnum | m3230)
- basic_machine=mips-mips
- os=-sysv
- ;;
- merlin)
- basic_machine=ns32k-utek
- os=-sysv
- ;;
- mingw32)
- basic_machine=i386-pc
- os=-mingw32
- ;;
miniframe)
- basic_machine=m68000-convergent
- ;;
- *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
- basic_machine=m68k-atari
- os=-mint
- ;;
- mips3*-*)
- basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
- ;;
- mips3*)
- basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
- ;;
- monitor)
- basic_machine=m68k-rom68k
- os=-coff
- ;;
- morphos)
- basic_machine=powerpc-unknown
- os=-morphos
- ;;
- msdos)
- basic_machine=i386-pc
- os=-msdos
- ;;
- ms1-*)
- basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
- ;;
- mvs)
- basic_machine=i370-ibm
- os=-mvs
- ;;
- ncr3000)
- basic_machine=i486-ncr
- os=-sysv4
- ;;
- netbsd386)
- basic_machine=i386-unknown
- os=-netbsd
+ cpu=m68000
+ vendor=convergent
;;
- netwinder)
- basic_machine=armv4l-rebel
- os=-linux
- ;;
- news | news700 | news800 | news900)
- basic_machine=m68k-sony
- os=-newsos
- ;;
- news1000)
- basic_machine=m68030-sony
- os=-newsos
+ *mint | mint[0-9]* | *MiNT | *MiNT[0-9]*)
+ cpu=m68k
+ vendor=atari
+ os=mint
;;
news-3600 | risc-news)
- basic_machine=mips-sony
- os=-newsos
- ;;
- necv70)
- basic_machine=v70-nec
- os=-sysv
+ cpu=mips
+ vendor=sony
+ os=newsos
;;
- next | m*-next )
- basic_machine=m68k-next
+ next | m*-next)
+ cpu=m68k
+ vendor=next
case $os in
- -nextstep* )
+ openstep*)
+ ;;
+ nextstep*)
;;
- -ns2*)
- os=-nextstep2
+ ns2*)
+ os=nextstep2
;;
*)
- os=-nextstep3
+ os=nextstep3
;;
esac
;;
- nh3000)
- basic_machine=m68k-harris
- os=-cxux
- ;;
- nh[45]000)
- basic_machine=m88k-harris
- os=-cxux
- ;;
- nindy960)
- basic_machine=i960-intel
- os=-nindy
- ;;
- mon960)
- basic_machine=i960-intel
- os=-mon960
- ;;
- nonstopux)
- basic_machine=mips-compaq
- os=-nonstopux
- ;;
np1)
- basic_machine=np1-gould
- ;;
- nsr-tandem)
- basic_machine=nsr-tandem
+ cpu=np1
+ vendor=gould
;;
op50n-* | op60c-*)
- basic_machine=hppa1.1-oki
- os=-proelf
- ;;
- openrisc | openrisc-*)
- basic_machine=or32-unknown
- ;;
- os400)
- basic_machine=powerpc-ibm
- os=-os400
- ;;
- OSE68000 | ose68000)
- basic_machine=m68000-ericsson
- os=-ose
- ;;
- os68k)
- basic_machine=m68k-none
- os=-os68k
+ cpu=hppa1.1
+ vendor=oki
+ os=proelf
;;
pa-hitachi)
- basic_machine=hppa1.1-hitachi
- os=-hiuxwe2
- ;;
- paragon)
- basic_machine=i860-intel
- os=-osf
+ cpu=hppa1.1
+ vendor=hitachi
+ os=hiuxwe2
;;
pbd)
- basic_machine=sparc-tti
+ cpu=sparc
+ vendor=tti
;;
pbb)
- basic_machine=m68k-tti
- ;;
- pc532 | pc532-*)
- basic_machine=ns32k-pc532
- ;;
- pc98)
- basic_machine=i386-pc
- ;;
- pc98-*)
- basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- pentium | p5 | k5 | k6 | nexgen | viac3)
- basic_machine=i586-pc
- ;;
- pentiumpro | p6 | 6x86 | athlon | athlon_*)
- basic_machine=i686-pc
- ;;
- pentiumii | pentium2 | pentiumiii | pentium3)
- basic_machine=i686-pc
+ cpu=m68k
+ vendor=tti
;;
- pentium4)
- basic_machine=i786-pc
- ;;
- pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
- basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- pentiumpro-* | p6-* | 6x86-* | athlon-*)
- basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
- basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- pentium4-*)
- basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
+ pc532)
+ cpu=ns32k
+ vendor=pc532
;;
pn)
- basic_machine=pn-gould
- ;;
- power) basic_machine=power-ibm
- ;;
- ppc) basic_machine=powerpc-unknown
- ;;
- ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- ppcle | powerpclittle | ppc-le | powerpc-little)
- basic_machine=powerpcle-unknown
+ cpu=pn
+ vendor=gould
;;
- ppcle-* | powerpclittle-*)
- basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- ppc64) basic_machine=powerpc64-unknown
- ;;
- ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- ppc64le | powerpc64little | ppc64-le | powerpc64-little)
- basic_machine=powerpc64le-unknown
- ;;
- ppc64le-* | powerpc64little-*)
- basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
+ power)
+ cpu=power
+ vendor=ibm
;;
ps2)
- basic_machine=i386-ibm
- ;;
- pw32)
- basic_machine=i586-unknown
- os=-pw32
- ;;
- rdos)
- basic_machine=i386-pc
- os=-rdos
- ;;
- rom68k)
- basic_machine=m68k-rom68k
- os=-coff
+ cpu=i386
+ vendor=ibm
;;
rm[46]00)
- basic_machine=mips-siemens
+ cpu=mips
+ vendor=siemens
;;
rtpc | rtpc-*)
- basic_machine=romp-ibm
+ cpu=romp
+ vendor=ibm
;;
- s390 | s390-*)
- basic_machine=s390-ibm
- ;;
- s390x | s390x-*)
- basic_machine=s390x-ibm
+ sde)
+ cpu=mipsisa32
+ vendor=sde
+ os=${os:-elf}
;;
- sa29200)
- basic_machine=a29k-amd
- os=-udi
+ simso-wrs)
+ cpu=sparclite
+ vendor=wrs
+ os=vxworks
;;
- sb1)
- basic_machine=mipsisa64sb1-unknown
+ tower | tower-32)
+ cpu=m68k
+ vendor=ncr
;;
- sb1el)
- basic_machine=mipsisa64sb1el-unknown
+ vpp*|vx|vx-*)
+ cpu=f301
+ vendor=fujitsu
;;
- sde)
- basic_machine=mipsisa32-sde
- os=-elf
+ w65)
+ cpu=w65
+ vendor=wdc
;;
- sei)
- basic_machine=mips-sei
- os=-seiux
+ w89k-*)
+ cpu=hppa1.1
+ vendor=winbond
+ os=proelf
;;
- sequent)
- basic_machine=i386-sequent
+ none)
+ cpu=none
+ vendor=none
;;
- sh)
- basic_machine=sh-hitachi
- os=-hms
+ leon|leon[3-9])
+ cpu=sparc
+ vendor=$basic_machine
;;
- sh64)
- basic_machine=sh64-unknown
+ leon-*|leon[3-9]-*)
+ cpu=sparc
+ vendor=`echo "$basic_machine" | sed 's/-.*//'`
;;
- sparclite-wrs | simso-wrs)
- basic_machine=sparclite-wrs
- os=-vxworks
+
+ *-*)
+ # shellcheck disable=SC2162
+ IFS="-" read cpu vendor <<EOF
+$basic_machine
+EOF
;;
- sps7)
- basic_machine=m68k-bull
- os=-sysv2
+ # We use `pc' rather than `unknown'
+ # because (1) that's what they normally are, and
+ # (2) the word "unknown" tends to confuse beginning users.
+ i*86 | x86_64)
+ cpu=$basic_machine
+ vendor=pc
;;
- spur)
- basic_machine=spur-unknown
+ # These rules are duplicated from below for sake of the special case above;
+ # i.e. things that normalized to x86 arches should also default to "pc"
+ pc98)
+ cpu=i386
+ vendor=pc
;;
- st2000)
- basic_machine=m68k-tandem
+ x64 | amd64)
+ cpu=x86_64
+ vendor=pc
;;
- stratus)
- basic_machine=i860-stratus
- os=-sysv4
+ # Recognize the basic CPU types without company name.
+ *)
+ cpu=$basic_machine
+ vendor=unknown
;;
- sun2)
- basic_machine=m68000-sun
+esac
+
+unset -v basic_machine
+
+# Decode basic machines in the full and proper CPU-Company form.
+case $cpu-$vendor in
+ # Here we handle the default manufacturer of certain CPU types in canonical form. It is in
+ # some cases the only manufacturer, in others, it is the most popular.
+ craynv-unknown)
+ vendor=cray
+ os=${os:-unicosmp}
;;
- sun2os3)
- basic_machine=m68000-sun
- os=-sunos3
+ c90-unknown | c90-cray)
+ vendor=cray
+ os=${os:-unicos}
;;
- sun2os4)
- basic_machine=m68000-sun
- os=-sunos4
+ fx80-unknown)
+ vendor=alliant
;;
- sun3os3)
- basic_machine=m68k-sun
- os=-sunos3
+ romp-unknown)
+ vendor=ibm
;;
- sun3os4)
- basic_machine=m68k-sun
- os=-sunos4
+ mmix-unknown)
+ vendor=knuth
;;
- sun4os3)
- basic_machine=sparc-sun
- os=-sunos3
+ microblaze-unknown | microblazeel-unknown)
+ vendor=xilinx
;;
- sun4os4)
- basic_machine=sparc-sun
- os=-sunos4
+ rs6000-unknown)
+ vendor=ibm
;;
- sun4sol2)
- basic_machine=sparc-sun
- os=-solaris2
+ vax-unknown)
+ vendor=dec
;;
- sun3 | sun3-*)
- basic_machine=m68k-sun
+ pdp11-unknown)
+ vendor=dec
;;
- sun4)
- basic_machine=sparc-sun
+ we32k-unknown)
+ vendor=att
;;
- sun386 | sun386i | roadrunner)
- basic_machine=i386-sun
+ cydra-unknown)
+ vendor=cydrome
;;
- sv1)
- basic_machine=sv1-cray
- os=-unicos
+ i370-ibm*)
+ vendor=ibm
;;
- symmetry)
- basic_machine=i386-sequent
- os=-dynix
+ orion-unknown)
+ vendor=highlevel
;;
- t3e)
- basic_machine=alphaev5-cray
- os=-unicos
+ xps-unknown | xps100-unknown)
+ cpu=xps100
+ vendor=honeywell
;;
- t90)
- basic_machine=t90-cray
- os=-unicos
+
+ # Here we normalize CPU types with a missing or matching vendor
+ dpx20-unknown | dpx20-bull)
+ cpu=rs6000
+ vendor=bull
+ os=${os:-bosx}
;;
- tic54x | c54x*)
- basic_machine=tic54x-unknown
- os=-coff
+
+ # Here we normalize CPU types irrespective of the vendor
+ amd64-*)
+ cpu=x86_64
;;
- tic55x | c55x*)
- basic_machine=tic55x-unknown
- os=-coff
+ blackfin-*)
+ cpu=bfin
+ os=linux
;;
- tic6x | c6x*)
- basic_machine=tic6x-unknown
- os=-coff
+ c54x-*)
+ cpu=tic54x
;;
- tx39)
- basic_machine=mipstx39-unknown
+ c55x-*)
+ cpu=tic55x
;;
- tx39el)
- basic_machine=mipstx39el-unknown
+ c6x-*)
+ cpu=tic6x
;;
- toad1)
- basic_machine=pdp10-xkl
- os=-tops20
+ e500v[12]-*)
+ cpu=powerpc
+ os=$os"spe"
;;
- tower | tower-32)
- basic_machine=m68k-ncr
+ mips3*-*)
+ cpu=mips64
;;
- tpf)
- basic_machine=s390x-ibm
- os=-tpf
+ ms1-*)
+ cpu=mt
;;
- udi29k)
- basic_machine=a29k-amd
- os=-udi
+ m68knommu-*)
+ cpu=m68k
+ os=linux
;;
- ultra3)
- basic_machine=a29k-nyu
- os=-sym1
+ m9s12z-* | m68hcs12z-* | hcs12z-* | s12z-*)
+ cpu=s12z
;;
- v810 | necv810)
- basic_machine=v810-nec
- os=-none
+ openrisc-*)
+ cpu=or32
;;
- vaxv)
- basic_machine=vax-dec
- os=-sysv
+ parisc-*)
+ cpu=hppa
+ os=linux
;;
- vms)
- basic_machine=vax-dec
- os=-vms
+ pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
+ cpu=i586
;;
- vpp*|vx|vx-*)
- basic_machine=f301-fujitsu
+ pentiumpro-* | p6-* | 6x86-* | athlon-* | athalon_*-*)
+ cpu=i686
;;
- vxworks960)
- basic_machine=i960-wrs
- os=-vxworks
+ pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
+ cpu=i686
;;
- vxworks68)
- basic_machine=m68k-wrs
- os=-vxworks
+ pentium4-*)
+ cpu=i786
;;
- vxworks29k)
- basic_machine=a29k-wrs
- os=-vxworks
+ pc98-*)
+ cpu=i386
;;
- w65*)
- basic_machine=w65-wdc
- os=-none
+ ppc-* | ppcbe-*)
+ cpu=powerpc
;;
- w89k-*)
- basic_machine=hppa1.1-winbond
- os=-proelf
+ ppcle-* | powerpclittle-*)
+ cpu=powerpcle
;;
- xbox)
- basic_machine=i686-pc
- os=-mingw32
+ ppc64-*)
+ cpu=powerpc64
;;
- xps | xps100)
- basic_machine=xps100-honeywell
+ ppc64le-* | powerpc64little-*)
+ cpu=powerpc64le
;;
- ymp)
- basic_machine=ymp-cray
- os=-unicos
+ sb1-*)
+ cpu=mipsisa64sb1
;;
- z8k-*-coff)
- basic_machine=z8k-unknown
- os=-sim
+ sb1el-*)
+ cpu=mipsisa64sb1el
;;
- none)
- basic_machine=none-none
- os=-none
+ sh5e[lb]-*)
+ cpu=`echo "$cpu" | sed 's/^\(sh.\)e\(.\)$/\1\2e/'`
;;
-
-# Here we handle the default manufacturer of certain CPU types. It is in
-# some cases the only manufacturer, in others, it is the most popular.
- w89k)
- basic_machine=hppa1.1-winbond
+ spur-*)
+ cpu=spur
;;
- op50n)
- basic_machine=hppa1.1-oki
+ strongarm-* | thumb-*)
+ cpu=arm
;;
- op60c)
- basic_machine=hppa1.1-oki
+ tx39-*)
+ cpu=mipstx39
;;
- romp)
- basic_machine=romp-ibm
+ tx39el-*)
+ cpu=mipstx39el
;;
- mmix)
- basic_machine=mmix-knuth
+ x64-*)
+ cpu=x86_64
;;
- rs6000)
- basic_machine=rs6000-ibm
+ xscale-* | xscalee[bl]-*)
+ cpu=`echo "$cpu" | sed 's/^xscale/arm/'`
;;
- vax)
- basic_machine=vax-dec
+
+ # Recognize the canonical CPU Types that limit and/or modify the
+ # company names they are paired with.
+ cr16-*)
+ os=${os:-elf}
;;
- pdp10)
- # there are many clones, so DEC is not a safe bet
- basic_machine=pdp10-unknown
+ crisv32-* | etraxfs*-*)
+ cpu=crisv32
+ vendor=axis
;;
- pdp11)
- basic_machine=pdp11-dec
+ cris-* | etrax*-*)
+ cpu=cris
+ vendor=axis
;;
- we32k)
- basic_machine=we32k-att
+ crx-*)
+ os=${os:-elf}
;;
- sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele)
- basic_machine=sh-unknown
+ neo-tandem)
+ cpu=neo
+ vendor=tandem
;;
- sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
- basic_machine=sparc-sun
+ nse-tandem)
+ cpu=nse
+ vendor=tandem
;;
- cydra)
- basic_machine=cydra-cydrome
+ nsr-tandem)
+ cpu=nsr
+ vendor=tandem
;;
- orion)
- basic_machine=orion-highlevel
+ nsv-tandem)
+ cpu=nsv
+ vendor=tandem
;;
- orion105)
- basic_machine=clipper-highlevel
+ nsx-tandem)
+ cpu=nsx
+ vendor=tandem
;;
- mac | mpw | mac-mpw)
- basic_machine=m68k-apple
+ s390-*)
+ cpu=s390
+ vendor=ibm
;;
- pmac | pmac-mpw)
- basic_machine=powerpc-apple
+ s390x-*)
+ cpu=s390x
+ vendor=ibm
;;
- *-unknown)
- # Make sure to match an already-canonicalized machine name.
+ tile*-*)
+ os=${os:-linux-gnu}
;;
+
*)
- echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
- exit 1
+ # Recognize the canonical CPU types that are allowed with any
+ # company name.
+ case $cpu in
+ 1750a | 580 \
+ | a29k \
+ | aarch64 | aarch64_be \
+ | abacus \
+ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] \
+ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] \
+ | alphapca5[67] | alpha64pca5[67] \
+ | am33_2.0 \
+ | amdgcn \
+ | arc | arceb \
+ | arm | arm[lb]e | arme[lb] | armv* \
+ | avr | avr32 \
+ | asmjs \
+ | ba \
+ | be32 | be64 \
+ | bfin | bpf | bs2000 \
+ | c[123]* | c30 | [cjt]90 | c4x \
+ | c8051 | clipper | craynv | csky | cydra \
+ | d10v | d30v | dlx | dsp16xx \
+ | e2k | elxsi | epiphany \
+ | f30[01] | f700 | fido | fr30 | frv | ft32 | fx80 \
+ | h8300 | h8500 \
+ | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+ | hexagon \
+ | i370 | i*86 | i860 | i960 | ia16 | ia64 \
+ | ip2k | iq2000 \
+ | k1om \
+ | le32 | le64 \
+ | lm32 \
+ | m32c | m32r | m32rle \
+ | m5200 | m68000 | m680[012346]0 | m68360 | m683?2 | m68k \
+ | m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x \
+ | m88110 | m88k | maxq | mb | mcore | mep | metag \
+ | microblaze | microblazeel \
+ | mips | mipsbe | mipseb | mipsel | mipsle \
+ | mips16 \
+ | mips64 | mips64eb | mips64el \
+ | mips64octeon | mips64octeonel \
+ | mips64orion | mips64orionel \
+ | mips64r5900 | mips64r5900el \
+ | mips64vr | mips64vrel \
+ | mips64vr4100 | mips64vr4100el \
+ | mips64vr4300 | mips64vr4300el \
+ | mips64vr5000 | mips64vr5000el \
+ | mips64vr5900 | mips64vr5900el \
+ | mipsisa32 | mipsisa32el \
+ | mipsisa32r2 | mipsisa32r2el \
+ | mipsisa32r6 | mipsisa32r6el \
+ | mipsisa64 | mipsisa64el \
+ | mipsisa64r2 | mipsisa64r2el \
+ | mipsisa64r6 | mipsisa64r6el \
+ | mipsisa64sb1 | mipsisa64sb1el \
+ | mipsisa64sr71k | mipsisa64sr71kel \
+ | mipsr5900 | mipsr5900el \
+ | mipstx39 | mipstx39el \
+ | mmix \
+ | mn10200 | mn10300 \
+ | moxie \
+ | mt \
+ | msp430 \
+ | nds32 | nds32le | nds32be \
+ | nfp \
+ | nios | nios2 | nios2eb | nios2el \
+ | none | np1 | ns16k | ns32k | nvptx \
+ | open8 \
+ | or1k* \
+ | or32 \
+ | orion \
+ | picochip \
+ | pdp10 | pdp11 | pj | pjl | pn | power \
+ | powerpc | powerpc64 | powerpc64le | powerpcle | powerpcspe \
+ | pru \
+ | pyramid \
+ | riscv | riscv32 | riscv64 \
+ | rl78 | romp | rs6000 | rx \
+ | score \
+ | sh | shl \
+ | sh[1234] | sh[24]a | sh[24]ae[lb] | sh[23]e | she[lb] | sh[lb]e \
+ | sh[1234]e[lb] | sh[12345][lb]e | sh[23]ele | sh64 | sh64le \
+ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet \
+ | sparclite \
+ | sparcv8 | sparcv9 | sparcv9b | sparcv9v | sv1 | sx* \
+ | spu \
+ | tahoe \
+ | tic30 | tic4x | tic54x | tic55x | tic6x | tic80 \
+ | tron \
+ | ubicom32 \
+ | v70 | v850 | v850e | v850e1 | v850es | v850e2 | v850e2v3 \
+ | vax \
+ | visium \
+ | w65 \
+ | wasm32 | wasm64 \
+ | we32k \
+ | x86 | x86_64 | xc16x | xgate | xps100 \
+ | xstormy16 | xtensa* \
+ | ymp \
+ | z8k | z80)
+ ;;
+
+ *)
+ echo Invalid configuration \`"$1"\': machine \`"$cpu-$vendor"\' not recognized 1>&2
+ exit 1
+ ;;
+ esac
;;
esac
# Here we canonicalize certain aliases for manufacturers.
-case $basic_machine in
- *-digital*)
- basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
+case $vendor in
+ digital*)
+ vendor=dec
;;
- *-commodore*)
- basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
+ commodore*)
+ vendor=cbm
;;
*)
;;
@@ -1171,190 +1275,244 @@ esac
# Decode manufacturer-specific aliases for certain operating systems.
-if [ x"$os" != x"" ]
+if [ x$os != x ]
then
case $os in
- # First match some system type aliases
- # that might get confused with valid system types.
- # -solaris* is a basic system type, with this one exception.
- -solaris1 | -solaris1.*)
- os=`echo $os | sed -e 's|solaris1|sunos4|'`
+ # First match some system type aliases that might get confused
+ # with valid system types.
+ # solaris* is a basic system type, with this one exception.
+ auroraux)
+ os=auroraux
;;
- -solaris)
- os=-solaris2
+ bluegene*)
+ os=cnk
;;
- -svr4*)
- os=-sysv4
+ solaris1 | solaris1.*)
+ os=`echo $os | sed -e 's|solaris1|sunos4|'`
+ ;;
+ solaris)
+ os=solaris2
;;
- -unixware*)
- os=-sysv4.2uw
+ unixware*)
+ os=sysv4.2uw
;;
- -gnu/linux*)
+ gnu/linux*)
os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
;;
- # First accept the basic system types.
+ # es1800 is here to avoid being matched by es* (a different OS)
+ es1800*)
+ os=ose
+ ;;
+ # Some version numbers need modification
+ chorusos*)
+ os=chorusos
+ ;;
+ isc)
+ os=isc2.2
+ ;;
+ sco6)
+ os=sco5v6
+ ;;
+ sco5)
+ os=sco3.2v5
+ ;;
+ sco4)
+ os=sco3.2v4
+ ;;
+ sco3.2.[4-9]*)
+ os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
+ ;;
+ sco3.2v[4-9]* | sco5v6*)
+ # Don't forget version if it is 3.2v4 or newer.
+ ;;
+ scout)
+ # Don't match below
+ ;;
+ sco*)
+ os=sco3.2v2
+ ;;
+ psos*)
+ os=psos
+ ;;
+ # Now accept the basic system types.
# The portable systems comes first.
- # Each alternative MUST END IN A *, to match a version number.
- # -sysv* is not here because it comes later, after sysvr4.
- -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
- | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
- | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
- | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
- | -aos* \
- | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
- | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
- | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
- | -openbsd* | -solidbsd* \
- | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
- | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
- | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
- | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
- | -chorusos* | -chorusrdb* \
- | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
- | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
- | -uxpv* | -beos* | -mpeix* | -udk* \
- | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
- | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
- | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
- | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
- | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
- | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
- | -skyos* | -haiku* | -rdos* | -toppers*)
+ # Each alternative MUST end in a * to match a version number.
+ # sysv* is not here because it comes later, after sysvr4.
+ gnu* | bsd* | mach* | minix* | genix* | ultrix* | irix* \
+ | *vms* | esix* | aix* | cnk* | sunos | sunos[34]*\
+ | hpux* | unos* | osf* | luna* | dgux* | auroraux* | solaris* \
+ | sym* | kopensolaris* | plan9* \
+ | amigaos* | amigados* | msdos* | newsos* | unicos* | aof* \
+ | aos* | aros* | cloudabi* | sortix* \
+ | nindy* | vxsim* | vxworks* | ebmon* | hms* | mvs* \
+ | clix* | riscos* | uniplus* | iris* | isc* | rtu* | xenix* \
+ | knetbsd* | mirbsd* | netbsd* \
+ | bitrig* | openbsd* | solidbsd* | libertybsd* | os108* \
+ | ekkobsd* | kfreebsd* | freebsd* | riscix* | lynxos* \
+ | bosx* | nextstep* | cxux* | aout* | elf* | oabi* \
+ | ptx* | coff* | ecoff* | winnt* | domain* | vsta* \
+ | udi* | eabi* | lites* | ieee* | go32* | aux* | hcos* \
+ | chorusrdb* | cegcc* | glidix* \
+ | cygwin* | msys* | pe* | moss* | proelf* | rtems* \
+ | midipix* | mingw32* | mingw64* | linux-gnu* | linux-android* \
+ | linux-newlib* | linux-musl* | linux-uclibc* \
+ | uxpv* | beos* | mpeix* | udk* | moxiebox* \
+ | interix* | uwin* | mks* | rhapsody* | darwin* \
+ | openstep* | oskit* | conix* | pw32* | nonstopux* \
+ | storm-chaos* | tops10* | tenex* | tops20* | its* \
+ | os2* | vos* | palmos* | uclinux* | nucleus* \
+ | morphos* | superux* | rtmk* | windiss* \
+ | powermax* | dnix* | nx6 | nx7 | sei* | dragonfly* \
+ | skyos* | haiku* | rdos* | toppers* | drops* | es* \
+ | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \
+ | midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \
+ | nsk* | powerunix)
# Remember, each alternative MUST END IN *, to match a version number.
;;
- -qnx*)
- case $basic_machine in
- x86-* | i*86-*)
+ qnx*)
+ case $cpu in
+ x86 | i*86)
;;
*)
- os=-nto$os
+ os=nto-$os
;;
esac
;;
- -nto-qnx*)
+ hiux*)
+ os=hiuxwe2
;;
- -nto*)
- os=`echo $os | sed -e 's|nto|nto-qnx|'`
+ nto-qnx*)
;;
- -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
- | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
- | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
+ nto*)
+ os=`echo $os | sed -e 's|nto|nto-qnx|'`
;;
- -mac*)
- os=`echo $os | sed -e 's|mac|macos|'`
+ sim | xray | os68k* | v88r* \
+ | windows* | osx | abug | netware* | os9* \
+ | macos* | mpw* | magic* | mmixware* | mon960* | lnews*)
;;
- -linux-dietlibc)
- os=-linux-dietlibc
+ linux-dietlibc)
+ os=linux-dietlibc
;;
- -linux*)
+ linux*)
os=`echo $os | sed -e 's|linux|linux-gnu|'`
;;
- -sunos5*)
- os=`echo $os | sed -e 's|sunos5|solaris2|'`
+ lynx*178)
+ os=lynxos178
;;
- -sunos6*)
- os=`echo $os | sed -e 's|sunos6|solaris3|'`
+ lynx*5)
+ os=lynxos5
;;
- -opened*)
- os=-openedition
+ lynx*)
+ os=lynxos
;;
- -os400*)
- os=-os400
+ mac*)
+ os=`echo "$os" | sed -e 's|mac|macos|'`
;;
- -wince*)
- os=-wince
+ opened*)
+ os=openedition
;;
- -osfrose*)
- os=-osfrose
+ os400*)
+ os=os400
;;
- -osf*)
- os=-osf
+ sunos5*)
+ os=`echo "$os" | sed -e 's|sunos5|solaris2|'`
;;
- -utek*)
- os=-bsd
+ sunos6*)
+ os=`echo "$os" | sed -e 's|sunos6|solaris3|'`
;;
- -dynix*)
- os=-bsd
+ wince*)
+ os=wince
;;
- -acis*)
- os=-aos
+ utek*)
+ os=bsd
;;
- -atheos*)
- os=-atheos
+ dynix*)
+ os=bsd
;;
- -syllable*)
- os=-syllable
+ acis*)
+ os=aos
;;
- -386bsd)
- os=-bsd
+ atheos*)
+ os=atheos
;;
- -ctix* | -uts*)
- os=-sysv
+ syllable*)
+ os=syllable
+ ;;
+ 386bsd)
+ os=bsd
;;
- -nova*)
- os=-rtmk-nova
+ ctix* | uts*)
+ os=sysv
;;
- -ns2 )
- os=-nextstep2
+ nova*)
+ os=rtmk-nova
;;
- -nsk*)
- os=-nsk
+ ns2)
+ os=nextstep2
;;
# Preserve the version number of sinix5.
- -sinix5.*)
+ sinix5.*)
os=`echo $os | sed -e 's|sinix|sysv|'`
;;
- -sinix*)
- os=-sysv4
+ sinix*)
+ os=sysv4
;;
- -tpf*)
- os=-tpf
+ tpf*)
+ os=tpf
;;
- -triton*)
- os=-sysv3
+ triton*)
+ os=sysv3
;;
- -oss*)
- os=-sysv3
+ oss*)
+ os=sysv3
;;
- -svr4)
- os=-sysv4
+ svr4*)
+ os=sysv4
;;
- -svr3)
- os=-sysv3
+ svr3)
+ os=sysv3
;;
- -sysvr4)
- os=-sysv4
+ sysvr4)
+ os=sysv4
;;
- # This must come after -sysvr4.
- -sysv*)
+ # This must come after sysvr4.
+ sysv*)
;;
- -ose*)
- os=-ose
+ ose*)
+ os=ose
;;
- -es1800*)
- os=-ose
+ *mint | mint[0-9]* | *MiNT | MiNT[0-9]*)
+ os=mint
;;
- -xenix)
- os=-xenix
+ zvmoe)
+ os=zvmoe
;;
- -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
- os=-mint
+ dicos*)
+ os=dicos
;;
- -aros*)
- os=-aros
+ pikeos*)
+ # Until real need of OS specific support for
+ # particular features comes up, bare metal
+ # configurations are quite functional.
+ case $cpu in
+ arm*)
+ os=eabi
+ ;;
+ *)
+ os=elf
+ ;;
+ esac
+ ;;
+ nacl*)
;;
- -kaos*)
- os=-kaos
+ ios)
;;
- -zvmoe)
- os=-zvmoe
+ none)
;;
- -none)
+ *-eabi)
;;
*)
- # Get rid of the `-' at the beginning of $os.
- os=`echo $os | sed 's/[^-]*-//'`
- echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
+ echo Invalid configuration \`"$1"\': system \`"$os"\' not recognized 1>&2
exit 1
;;
esac
@@ -1370,246 +1528,265 @@ else
# will signal an error saying that MANUFACTURER isn't an operating
# system, and we'll never get to this point.
-case $basic_machine in
- score-*)
- os=-elf
+case $cpu-$vendor in
+ score-*)
+ os=elf
;;
- spu-*)
- os=-elf
+ spu-*)
+ os=elf
;;
*-acorn)
- os=-riscix1.2
+ os=riscix1.2
;;
arm*-rebel)
- os=-linux
+ os=linux
;;
arm*-semi)
- os=-aout
+ os=aout
+ ;;
+ c4x-* | tic4x-*)
+ os=coff
+ ;;
+ c8051-*)
+ os=elf
+ ;;
+ clipper-intergraph)
+ os=clix
+ ;;
+ hexagon-*)
+ os=elf
;;
- c4x-* | tic4x-*)
- os=-coff
+ tic54x-*)
+ os=coff
+ ;;
+ tic55x-*)
+ os=coff
+ ;;
+ tic6x-*)
+ os=coff
;;
# This must come before the *-dec entry.
pdp10-*)
- os=-tops20
+ os=tops20
;;
pdp11-*)
- os=-none
+ os=none
;;
*-dec | vax-*)
- os=-ultrix4.2
+ os=ultrix4.2
;;
m68*-apollo)
- os=-domain
+ os=domain
;;
i386-sun)
- os=-sunos4.0.2
+ os=sunos4.0.2
;;
m68000-sun)
- os=-sunos3
- # This also exists in the configure program, but was not the
- # default.
- # os=-sunos4
+ os=sunos3
;;
m68*-cisco)
- os=-aout
+ os=aout
+ ;;
+ mep-*)
+ os=elf
;;
mips*-cisco)
- os=-elf
+ os=elf
;;
mips*-*)
- os=-elf
+ os=elf
;;
or32-*)
- os=-coff
+ os=coff
;;
*-tti) # must be before sparc entry or we get the wrong os.
- os=-sysv3
+ os=sysv3
;;
sparc-* | *-sun)
- os=-sunos4.1.1
+ os=sunos4.1.1
;;
- *-be)
- os=-beos
+ pru-*)
+ os=elf
;;
- *-haiku)
- os=-haiku
+ *-be)
+ os=beos
;;
*-ibm)
- os=-aix
+ os=aix
;;
- *-knuth)
- os=-mmixware
+ *-knuth)
+ os=mmixware
;;
*-wec)
- os=-proelf
+ os=proelf
;;
*-winbond)
- os=-proelf
+ os=proelf
;;
*-oki)
- os=-proelf
+ os=proelf
;;
*-hp)
- os=-hpux
+ os=hpux
;;
*-hitachi)
- os=-hiux
+ os=hiux
;;
i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
- os=-sysv
+ os=sysv
;;
*-cbm)
- os=-amigaos
+ os=amigaos
;;
*-dg)
- os=-dgux
+ os=dgux
;;
*-dolphin)
- os=-sysv3
+ os=sysv3
;;
m68k-ccur)
- os=-rtu
+ os=rtu
;;
m88k-omron*)
- os=-luna
+ os=luna
;;
- *-next )
- os=-nextstep
+ *-next)
+ os=nextstep
;;
*-sequent)
- os=-ptx
+ os=ptx
;;
*-crds)
- os=-unos
+ os=unos
;;
*-ns)
- os=-genix
+ os=genix
;;
i370-*)
- os=-mvs
- ;;
- *-next)
- os=-nextstep3
+ os=mvs
;;
*-gould)
- os=-sysv
+ os=sysv
;;
*-highlevel)
- os=-bsd
+ os=bsd
;;
*-encore)
- os=-bsd
+ os=bsd
;;
*-sgi)
- os=-irix
+ os=irix
;;
*-siemens)
- os=-sysv4
+ os=sysv4
;;
*-masscomp)
- os=-rtu
+ os=rtu
;;
f30[01]-fujitsu | f700-fujitsu)
- os=-uxpv
+ os=uxpv
;;
*-rom68k)
- os=-coff
+ os=coff
;;
*-*bug)
- os=-coff
+ os=coff
;;
*-apple)
- os=-macos
+ os=macos
;;
*-atari*)
- os=-mint
+ os=mint
+ ;;
+ *-wrs)
+ os=vxworks
;;
*)
- os=-none
+ os=none
;;
esac
fi
# Here we handle the case where we know the os, and the CPU type, but not the
# manufacturer. We pick the logical manufacturer.
-vendor=unknown
-case $basic_machine in
- *-unknown)
+case $vendor in
+ unknown)
case $os in
- -riscix*)
+ riscix*)
vendor=acorn
;;
- -sunos*)
+ sunos*)
vendor=sun
;;
- -aix*)
+ cnk*|-aix*)
vendor=ibm
;;
- -beos*)
+ beos*)
vendor=be
;;
- -hpux*)
+ hpux*)
vendor=hp
;;
- -mpeix*)
+ mpeix*)
vendor=hp
;;
- -hiux*)
+ hiux*)
vendor=hitachi
;;
- -unos*)
+ unos*)
vendor=crds
;;
- -dgux*)
+ dgux*)
vendor=dg
;;
- -luna*)
+ luna*)
vendor=omron
;;
- -genix*)
+ genix*)
vendor=ns
;;
- -mvs* | -opened*)
+ clix*)
+ vendor=intergraph
+ ;;
+ mvs* | opened*)
vendor=ibm
;;
- -os400*)
+ os400*)
vendor=ibm
;;
- -ptx*)
+ ptx*)
vendor=sequent
;;
- -tpf*)
+ tpf*)
vendor=ibm
;;
- -vxsim* | -vxworks* | -windiss*)
+ vxsim* | vxworks* | windiss*)
vendor=wrs
;;
- -aux*)
+ aux*)
vendor=apple
;;
- -hms*)
+ hms*)
vendor=hitachi
;;
- -mpw* | -macos*)
+ mpw* | macos*)
vendor=apple
;;
- -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+ *mint | mint[0-9]* | *MiNT | MiNT[0-9]*)
vendor=atari
;;
- -vos*)
+ vos*)
vendor=stratus
;;
esac
- basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
;;
esac
-echo $basic_machine$os
+echo "$cpu-$vendor-$os"
exit
# Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
# time-stamp-start: "timestamp='"
# time-stamp-format: "%:y-%02m-%02d"
# time-stamp-end: "'"
diff --git a/configure b/configure
deleted file mode 100755
index dfeb84c..0000000
--- a/configure
+++ /dev/null
@@ -1,5531 +0,0 @@
-#! /bin/sh
-# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for ocaml-libvirt 0.6.1.4.
-#
-#
-# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
-#
-#
-# This configure script is free software; the Free Software Foundation
-# gives unlimited permission to copy, distribute and modify it.
-## -------------------- ##
-## M4sh Initialization. ##
-## -------------------- ##
-
-# Be more Bourne compatible
-DUALCASE=1; export DUALCASE # for MKS sh
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
- emulate sh
- NULLCMD=:
- # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
- # is contrary to our usage. Disable this feature.
- alias -g '${1+"$@"}'='"$@"'
- setopt NO_GLOB_SUBST
-else
- case `(set -o) 2>/dev/null` in #(
- *posix*) :
- set -o posix ;; #(
- *) :
- ;;
-esac
-fi
-
-
-as_nl='
-'
-export as_nl
-# Printing a long string crashes Solaris 7 /usr/bin/printf.
-as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
-as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
-as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
-# Prefer a ksh shell builtin over an external printf program on Solaris,
-# but without wasting forks for bash or zsh.
-if test -z "$BASH_VERSION$ZSH_VERSION" \
- && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
- as_echo='print -r --'
- as_echo_n='print -rn --'
-elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
- as_echo='printf %s\n'
- as_echo_n='printf %s'
-else
- if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
- as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
- as_echo_n='/usr/ucb/echo -n'
- else
- as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
- as_echo_n_body='eval
- arg=$1;
- case $arg in #(
- *"$as_nl"*)
- expr "X$arg" : "X\\(.*\\)$as_nl";
- arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
- esac;
- expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
- '
- export as_echo_n_body
- as_echo_n='sh -c $as_echo_n_body as_echo'
- fi
- export as_echo_body
- as_echo='sh -c $as_echo_body as_echo'
-fi
-
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
- PATH_SEPARATOR=:
- (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
- (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
- PATH_SEPARATOR=';'
- }
-fi
-
-
-# IFS
-# We need space, tab and new line, in precisely that order. Quoting is
-# there to prevent editors from complaining about space-tab.
-# (If _AS_PATH_WALK were called with IFS unset, it would disable word
-# splitting by setting IFS to empty value.)
-IFS=" "" $as_nl"
-
-# Find who we are. Look in the path if we contain no directory separator.
-as_myself=
-case $0 in #((
- *[\\/]* ) as_myself=$0 ;;
- *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
- done
-IFS=$as_save_IFS
-
- ;;
-esac
-# We did not find ourselves, most probably we were run as `sh COMMAND'
-# in which case we are not to be found in the path.
-if test "x$as_myself" = x; then
- as_myself=$0
-fi
-if test ! -f "$as_myself"; then
- $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
- exit 1
-fi
-
-# Unset variables that we do not need and which cause bugs (e.g. in
-# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
-# suppresses any "Segmentation fault" message there. '((' could
-# trigger a bug in pdksh 5.2.14.
-for as_var in BASH_ENV ENV MAIL MAILPATH
-do eval test x\${$as_var+set} = xset \
- && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
-done
-PS1='$ '
-PS2='> '
-PS4='+ '
-
-# NLS nuisances.
-LC_ALL=C
-export LC_ALL
-LANGUAGE=C
-export LANGUAGE
-
-# CDPATH.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-
-# Use a proper internal environment variable to ensure we don't fall
- # into an infinite loop, continuously re-executing ourselves.
- if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then
- _as_can_reexec=no; export _as_can_reexec;
- # We cannot yet assume a decent shell, so we have to provide a
-# neutralization value for shells without unset; and this also
-# works around shells that cannot unset nonexistent variables.
-# Preserve -v and -x to the replacement shell.
-BASH_ENV=/dev/null
-ENV=/dev/null
-(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
-case $- in # ((((
- *v*x* | *x*v* ) as_opts=-vx ;;
- *v* ) as_opts=-v ;;
- *x* ) as_opts=-x ;;
- * ) as_opts= ;;
-esac
-exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
-# Admittedly, this is quite paranoid, since all the known shells bail
-# out after a failed `exec'.
-$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
-as_fn_exit 255
- fi
- # We don't want this to propagate to other subprocesses.
- { _as_can_reexec=; unset _as_can_reexec;}
-if test "x$CONFIG_SHELL" = x; then
- as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
- emulate sh
- NULLCMD=:
- # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which
- # is contrary to our usage. Disable this feature.
- alias -g '\${1+\"\$@\"}'='\"\$@\"'
- setopt NO_GLOB_SUBST
-else
- case \`(set -o) 2>/dev/null\` in #(
- *posix*) :
- set -o posix ;; #(
- *) :
- ;;
-esac
-fi
-"
- as_required="as_fn_return () { (exit \$1); }
-as_fn_success () { as_fn_return 0; }
-as_fn_failure () { as_fn_return 1; }
-as_fn_ret_success () { return 0; }
-as_fn_ret_failure () { return 1; }
-
-exitcode=0
-as_fn_success || { exitcode=1; echo as_fn_success failed.; }
-as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
-as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
-as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
-if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
-
-else
- exitcode=1; echo positional parameters were not saved.
-fi
-test x\$exitcode = x0 || exit 1
-test -x / || exit 1"
- as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
- as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
- eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
- test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1
-test \$(( 1 + 1 )) = 2 || exit 1"
- if (eval "$as_required") 2>/dev/null; then :
- as_have_required=yes
-else
- as_have_required=no
-fi
- if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then :
-
-else
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-as_found=false
-for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- as_found=:
- case $as_dir in #(
- /*)
- for as_base in sh bash ksh sh5; do
- # Try only shells that exist, to save several forks.
- as_shell=$as_dir/$as_base
- if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
- { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then :
- CONFIG_SHELL=$as_shell as_have_required=yes
- if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then :
- break 2
-fi
-fi
- done;;
- esac
- as_found=false
-done
-$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
- { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then :
- CONFIG_SHELL=$SHELL as_have_required=yes
-fi; }
-IFS=$as_save_IFS
-
-
- if test "x$CONFIG_SHELL" != x; then :
- export CONFIG_SHELL
- # We cannot yet assume a decent shell, so we have to provide a
-# neutralization value for shells without unset; and this also
-# works around shells that cannot unset nonexistent variables.
-# Preserve -v and -x to the replacement shell.
-BASH_ENV=/dev/null
-ENV=/dev/null
-(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
-case $- in # ((((
- *v*x* | *x*v* ) as_opts=-vx ;;
- *v* ) as_opts=-v ;;
- *x* ) as_opts=-x ;;
- * ) as_opts= ;;
-esac
-exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
-# Admittedly, this is quite paranoid, since all the known shells bail
-# out after a failed `exec'.
-$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
-exit 255
-fi
-
- if test x$as_have_required = xno; then :
- $as_echo "$0: This script requires a shell more modern than all"
- $as_echo "$0: the shells that I found on your system."
- if test x${ZSH_VERSION+set} = xset ; then
- $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"
- $as_echo "$0: be upgraded to zsh 4.3.4 or later."
- else
- $as_echo "$0: Please tell bug-autoconf@gnu.org about your system,
-$0: including any error possibly output before this
-$0: message. Then install a modern shell, or manually run
-$0: the script under such a shell if you do have one."
- fi
- exit 1
-fi
-fi
-fi
-SHELL=${CONFIG_SHELL-/bin/sh}
-export SHELL
-# Unset more variables known to interfere with behavior of common tools.
-CLICOLOR_FORCE= GREP_OPTIONS=
-unset CLICOLOR_FORCE GREP_OPTIONS
-
-## --------------------- ##
-## M4sh Shell Functions. ##
-## --------------------- ##
-# as_fn_unset VAR
-# ---------------
-# Portably unset VAR.
-as_fn_unset ()
-{
- { eval $1=; unset $1;}
-}
-as_unset=as_fn_unset
-
-# as_fn_set_status STATUS
-# -----------------------
-# Set $? to STATUS, without forking.
-as_fn_set_status ()
-{
- return $1
-} # as_fn_set_status
-
-# as_fn_exit STATUS
-# -----------------
-# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
-as_fn_exit ()
-{
- set +e
- as_fn_set_status $1
- exit $1
-} # as_fn_exit
-
-# as_fn_mkdir_p
-# -------------
-# Create "$as_dir" as a directory, including parents if necessary.
-as_fn_mkdir_p ()
-{
-
- case $as_dir in #(
- -*) as_dir=./$as_dir;;
- esac
- test -d "$as_dir" || eval $as_mkdir_p || {
- as_dirs=
- while :; do
- case $as_dir in #(
- *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
- *) as_qdir=$as_dir;;
- esac
- as_dirs="'$as_qdir' $as_dirs"
- as_dir=`$as_dirname -- "$as_dir" ||
-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$as_dir" : 'X\(//\)[^/]' \| \
- X"$as_dir" : 'X\(//\)$' \| \
- X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$as_dir" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
- test -d "$as_dir" && break
- done
- test -z "$as_dirs" || eval "mkdir $as_dirs"
- } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
-
-
-} # as_fn_mkdir_p
-
-# as_fn_executable_p FILE
-# -----------------------
-# Test if FILE is an executable regular file.
-as_fn_executable_p ()
-{
- test -f "$1" && test -x "$1"
-} # as_fn_executable_p
-# as_fn_append VAR VALUE
-# ----------------------
-# Append the text in VALUE to the end of the definition contained in VAR. Take
-# advantage of any shell optimizations that allow amortized linear growth over
-# repeated appends, instead of the typical quadratic growth present in naive
-# implementations.
-if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
- eval 'as_fn_append ()
- {
- eval $1+=\$2
- }'
-else
- as_fn_append ()
- {
- eval $1=\$$1\$2
- }
-fi # as_fn_append
-
-# as_fn_arith ARG...
-# ------------------
-# Perform arithmetic evaluation on the ARGs, and store the result in the
-# global $as_val. Take advantage of shells that can avoid forks. The arguments
-# must be portable across $(()) and expr.
-if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
- eval 'as_fn_arith ()
- {
- as_val=$(( $* ))
- }'
-else
- as_fn_arith ()
- {
- as_val=`expr "$@" || test $? -eq 1`
- }
-fi # as_fn_arith
-
-
-# as_fn_error STATUS ERROR [LINENO LOG_FD]
-# ----------------------------------------
-# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
-# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
-# script with STATUS, using 1 if that was 0.
-as_fn_error ()
-{
- as_status=$1; test $as_status -eq 0 && as_status=1
- if test "$4"; then
- as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
- fi
- $as_echo "$as_me: error: $2" >&2
- as_fn_exit $as_status
-} # as_fn_error
-
-if expr a : '\(a\)' >/dev/null 2>&1 &&
- test "X`expr 00001 : '.*\(...\)'`" = X001; then
- as_expr=expr
-else
- as_expr=false
-fi
-
-if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
- as_basename=basename
-else
- as_basename=false
-fi
-
-if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
- as_dirname=dirname
-else
- as_dirname=false
-fi
-
-as_me=`$as_basename -- "$0" ||
-$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
- X"$0" : 'X\(//\)$' \| \
- X"$0" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X/"$0" |
- sed '/^.*\/\([^/][^/]*\)\/*$/{
- s//\1/
- q
- }
- /^X\/\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\/\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
-
-# Avoid depending upon Character Ranges.
-as_cr_letters='abcdefghijklmnopqrstuvwxyz'
-as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
-as_cr_Letters=$as_cr_letters$as_cr_LETTERS
-as_cr_digits='0123456789'
-as_cr_alnum=$as_cr_Letters$as_cr_digits
-
-
- as_lineno_1=$LINENO as_lineno_1a=$LINENO
- as_lineno_2=$LINENO as_lineno_2a=$LINENO
- eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
- test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
- # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-)
- sed -n '
- p
- /[$]LINENO/=
- ' <$as_myself |
- sed '
- s/[$]LINENO.*/&-/
- t lineno
- b
- :lineno
- N
- :loop
- s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
- t loop
- s/-\n.*//
- ' >$as_me.lineno &&
- chmod +x "$as_me.lineno" ||
- { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
-
- # If we had to re-execute with $CONFIG_SHELL, we're ensured to have
- # already done that, so ensure we don't try to do so again and fall
- # in an infinite loop. This has already happened in practice.
- _as_can_reexec=no; export _as_can_reexec
- # Don't try to exec as it changes $[0], causing all sort of problems
- # (the dirname of $[0] is not the place where we might find the
- # original and so on. Autoconf is especially sensitive to this).
- . "./$as_me.lineno"
- # Exit status is that of the last command.
- exit
-}
-
-ECHO_C= ECHO_N= ECHO_T=
-case `echo -n x` in #(((((
--n*)
- case `echo 'xy\c'` in
- *c*) ECHO_T=' ';; # ECHO_T is single tab character.
- xy) ECHO_C='\c';;
- *) echo `echo ksh88 bug on AIX 6.1` > /dev/null
- ECHO_T=' ';;
- esac;;
-*)
- ECHO_N='-n';;
-esac
-
-rm -f conf$$ conf$$.exe conf$$.file
-if test -d conf$$.dir; then
- rm -f conf$$.dir/conf$$.file
-else
- rm -f conf$$.dir
- mkdir conf$$.dir 2>/dev/null
-fi
-if (echo >conf$$.file) 2>/dev/null; then
- if ln -s conf$$.file conf$$ 2>/dev/null; then
- as_ln_s='ln -s'
- # ... but there are two gotchas:
- # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
- # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
- # In both cases, we have to default to `cp -pR'.
- ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
- as_ln_s='cp -pR'
- elif ln conf$$.file conf$$ 2>/dev/null; then
- as_ln_s=ln
- else
- as_ln_s='cp -pR'
- fi
-else
- as_ln_s='cp -pR'
-fi
-rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
-rmdir conf$$.dir 2>/dev/null
-
-if mkdir -p . 2>/dev/null; then
- as_mkdir_p='mkdir -p "$as_dir"'
-else
- test -d ./-p && rmdir ./-p
- as_mkdir_p=false
-fi
-
-as_test_x='test -x'
-as_executable_p=as_fn_executable_p
-
-# Sed expression to map a string onto a valid CPP name.
-as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
-
-# Sed expression to map a string onto a valid variable name.
-as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
-
-
-test -n "$DJDIR" || exec 7<&0 </dev/null
-exec 6>&1
-
-# Name of the host.
-# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status,
-# so uname gets run too.
-ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
-
-#
-# Initializations.
-#
-ac_default_prefix=/usr/local
-ac_clean_files=
-ac_config_libobj_dir=.
-LIBOBJS=
-cross_compiling=no
-subdirs=
-MFLAGS=
-MAKEFLAGS=
-
-# Identity of this package.
-PACKAGE_NAME='ocaml-libvirt'
-PACKAGE_TARNAME='ocaml-libvirt'
-PACKAGE_VERSION='0.6.1.4'
-PACKAGE_STRING='ocaml-libvirt 0.6.1.4'
-PACKAGE_BUGREPORT=''
-PACKAGE_URL=''
-
-# Factoring default headers for most tests.
-ac_includes_default="\
-#include <stdio.h>
-#ifdef HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
-#ifdef HAVE_SYS_STAT_H
-# include <sys/stat.h>
-#endif
-#ifdef STDC_HEADERS
-# include <stdlib.h>
-# include <stddef.h>
-#else
-# ifdef HAVE_STDLIB_H
-# include <stdlib.h>
-# endif
-#endif
-#ifdef HAVE_STRING_H
-# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
-# include <memory.h>
-# endif
-# include <string.h>
-#endif
-#ifdef HAVE_STRINGS_H
-# include <strings.h>
-#endif
-#ifdef HAVE_INTTYPES_H
-# include <inttypes.h>
-#endif
-#ifdef HAVE_STDINT_H
-# include <stdint.h>
-#endif
-#ifdef HAVE_UNISTD_H
-# include <unistd.h>
-#endif"
-
-ac_subst_vars='LTLIBOBJS
-LIBOBJS
-GTK_PATH
-GTK_DLL_PATH
-GNUTLS_DLL_PATH
-LIBXML2_DLL_PATH
-LIBXDR_DLL_PATH
-LIBVIRT_DLL_PATH
-MAKENSIS
-OCAMLFIND
-OCAMLLIB
-OCAMLVERSION
-OCAMLBEST
-OCAMLDOC
-OCAMLMKLIB
-OCAMLMKTOP
-OCAMLDEP
-OCAMLOPTDOTOPT
-OCAMLCDOTOPT
-OCAMLOPT
-OCAMLC
-EGREP
-GREP
-WIN32
-CFLAGS_FPIC
-WARNINGS
-DEBUG
-host_os
-host_vendor
-host_cpu
-host
-build_os
-build_vendor
-build_cpu
-build
-CPP
-INSTALL_DATA
-INSTALL_SCRIPT
-INSTALL_PROGRAM
-OBJEXT
-EXEEXT
-ac_ct_CC
-CPPFLAGS
-LDFLAGS
-CFLAGS
-CC
-target_alias
-host_alias
-build_alias
-LIBS
-ECHO_T
-ECHO_N
-ECHO_C
-DEFS
-mandir
-localedir
-libdir
-psdir
-pdfdir
-dvidir
-htmldir
-infodir
-docdir
-oldincludedir
-includedir
-localstatedir
-sharedstatedir
-sysconfdir
-datadir
-datarootdir
-libexecdir
-sbindir
-bindir
-program_transform_name
-prefix
-exec_prefix
-PACKAGE_URL
-PACKAGE_BUGREPORT
-PACKAGE_STRING
-PACKAGE_VERSION
-PACKAGE_TARNAME
-PACKAGE_NAME
-PATH_SEPARATOR
-SHELL'
-ac_subst_files=''
-ac_user_opts='
-enable_option_checking
-with_libvirt
-with_nsis
-'
- ac_precious_vars='build_alias
-host_alias
-target_alias
-CC
-CFLAGS
-LDFLAGS
-LIBS
-CPPFLAGS
-CPP'
-
-
-# Initialize some variables set by options.
-ac_init_help=
-ac_init_version=false
-ac_unrecognized_opts=
-ac_unrecognized_sep=
-# The variables have the same names as the options, with
-# dashes changed to underlines.
-cache_file=/dev/null
-exec_prefix=NONE
-no_create=
-no_recursion=
-prefix=NONE
-program_prefix=NONE
-program_suffix=NONE
-program_transform_name=s,x,x,
-silent=
-site=
-srcdir=
-verbose=
-x_includes=NONE
-x_libraries=NONE
-
-# Installation directory options.
-# These are left unexpanded so users can "make install exec_prefix=/foo"
-# and all the variables that are supposed to be based on exec_prefix
-# by default will actually change.
-# Use braces instead of parens because sh, perl, etc. also accept them.
-# (The list follows the same order as the GNU Coding Standards.)
-bindir='${exec_prefix}/bin'
-sbindir='${exec_prefix}/sbin'
-libexecdir='${exec_prefix}/libexec'
-datarootdir='${prefix}/share'
-datadir='${datarootdir}'
-sysconfdir='${prefix}/etc'
-sharedstatedir='${prefix}/com'
-localstatedir='${prefix}/var'
-includedir='${prefix}/include'
-oldincludedir='/usr/include'
-docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
-infodir='${datarootdir}/info'
-htmldir='${docdir}'
-dvidir='${docdir}'
-pdfdir='${docdir}'
-psdir='${docdir}'
-libdir='${exec_prefix}/lib'
-localedir='${datarootdir}/locale'
-mandir='${datarootdir}/man'
-
-ac_prev=
-ac_dashdash=
-for ac_option
-do
- # If the previous option needs an argument, assign it.
- if test -n "$ac_prev"; then
- eval $ac_prev=\$ac_option
- ac_prev=
- continue
- fi
-
- case $ac_option in
- *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
- *=) ac_optarg= ;;
- *) ac_optarg=yes ;;
- esac
-
- # Accept the important Cygnus configure options, so we can diagnose typos.
-
- case $ac_dashdash$ac_option in
- --)
- ac_dashdash=yes ;;
-
- -bindir | --bindir | --bindi | --bind | --bin | --bi)
- ac_prev=bindir ;;
- -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
- bindir=$ac_optarg ;;
-
- -build | --build | --buil | --bui | --bu)
- ac_prev=build_alias ;;
- -build=* | --build=* | --buil=* | --bui=* | --bu=*)
- build_alias=$ac_optarg ;;
-
- -cache-file | --cache-file | --cache-fil | --cache-fi \
- | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
- ac_prev=cache_file ;;
- -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
- | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
- cache_file=$ac_optarg ;;
-
- --config-cache | -C)
- cache_file=config.cache ;;
-
- -datadir | --datadir | --datadi | --datad)
- ac_prev=datadir ;;
- -datadir=* | --datadir=* | --datadi=* | --datad=*)
- datadir=$ac_optarg ;;
-
- -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
- | --dataroo | --dataro | --datar)
- ac_prev=datarootdir ;;
- -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
- | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
- datarootdir=$ac_optarg ;;
-
- -disable-* | --disable-*)
- ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
- # Reject names that are not valid shell variable names.
- expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
- as_fn_error $? "invalid feature name: $ac_useropt"
- ac_useropt_orig=$ac_useropt
- ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
- case $ac_user_opts in
- *"
-"enable_$ac_useropt"
-"*) ;;
- *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
- ac_unrecognized_sep=', ';;
- esac
- eval enable_$ac_useropt=no ;;
-
- -docdir | --docdir | --docdi | --doc | --do)
- ac_prev=docdir ;;
- -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
- docdir=$ac_optarg ;;
-
- -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
- ac_prev=dvidir ;;
- -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
- dvidir=$ac_optarg ;;
-
- -enable-* | --enable-*)
- ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
- # Reject names that are not valid shell variable names.
- expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
- as_fn_error $? "invalid feature name: $ac_useropt"
- ac_useropt_orig=$ac_useropt
- ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
- case $ac_user_opts in
- *"
-"enable_$ac_useropt"
-"*) ;;
- *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
- ac_unrecognized_sep=', ';;
- esac
- eval enable_$ac_useropt=\$ac_optarg ;;
-
- -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
- | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
- | --exec | --exe | --ex)
- ac_prev=exec_prefix ;;
- -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
- | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
- | --exec=* | --exe=* | --ex=*)
- exec_prefix=$ac_optarg ;;
-
- -gas | --gas | --ga | --g)
- # Obsolete; use --with-gas.
- with_gas=yes ;;
-
- -help | --help | --hel | --he | -h)
- ac_init_help=long ;;
- -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
- ac_init_help=recursive ;;
- -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
- ac_init_help=short ;;
-
- -host | --host | --hos | --ho)
- ac_prev=host_alias ;;
- -host=* | --host=* | --hos=* | --ho=*)
- host_alias=$ac_optarg ;;
-
- -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
- ac_prev=htmldir ;;
- -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
- | --ht=*)
- htmldir=$ac_optarg ;;
-
- -includedir | --includedir | --includedi | --included | --include \
- | --includ | --inclu | --incl | --inc)
- ac_prev=includedir ;;
- -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
- | --includ=* | --inclu=* | --incl=* | --inc=*)
- includedir=$ac_optarg ;;
-
- -infodir | --infodir | --infodi | --infod | --info | --inf)
- ac_prev=infodir ;;
- -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
- infodir=$ac_optarg ;;
-
- -libdir | --libdir | --libdi | --libd)
- ac_prev=libdir ;;
- -libdir=* | --libdir=* | --libdi=* | --libd=*)
- libdir=$ac_optarg ;;
-
- -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
- | --libexe | --libex | --libe)
- ac_prev=libexecdir ;;
- -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
- | --libexe=* | --libex=* | --libe=*)
- libexecdir=$ac_optarg ;;
-
- -localedir | --localedir | --localedi | --localed | --locale)
- ac_prev=localedir ;;
- -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
- localedir=$ac_optarg ;;
-
- -localstatedir | --localstatedir | --localstatedi | --localstated \
- | --localstate | --localstat | --localsta | --localst | --locals)
- ac_prev=localstatedir ;;
- -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
- | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
- localstatedir=$ac_optarg ;;
-
- -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
- ac_prev=mandir ;;
- -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
- mandir=$ac_optarg ;;
-
- -nfp | --nfp | --nf)
- # Obsolete; use --without-fp.
- with_fp=no ;;
-
- -no-create | --no-create | --no-creat | --no-crea | --no-cre \
- | --no-cr | --no-c | -n)
- no_create=yes ;;
-
- -no-recursion | --no-recursion | --no-recursio | --no-recursi \
- | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
- no_recursion=yes ;;
-
- -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
- | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
- | --oldin | --oldi | --old | --ol | --o)
- ac_prev=oldincludedir ;;
- -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
- | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
- | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
- oldincludedir=$ac_optarg ;;
-
- -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
- ac_prev=prefix ;;
- -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
- prefix=$ac_optarg ;;
-
- -program-prefix | --program-prefix | --program-prefi | --program-pref \
- | --program-pre | --program-pr | --program-p)
- ac_prev=program_prefix ;;
- -program-prefix=* | --program-prefix=* | --program-prefi=* \
- | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
- program_prefix=$ac_optarg ;;
-
- -program-suffix | --program-suffix | --program-suffi | --program-suff \
- | --program-suf | --program-su | --program-s)
- ac_prev=program_suffix ;;
- -program-suffix=* | --program-suffix=* | --program-suffi=* \
- | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
- program_suffix=$ac_optarg ;;
-
- -program-transform-name | --program-transform-name \
- | --program-transform-nam | --program-transform-na \
- | --program-transform-n | --program-transform- \
- | --program-transform | --program-transfor \
- | --program-transfo | --program-transf \
- | --program-trans | --program-tran \
- | --progr-tra | --program-tr | --program-t)
- ac_prev=program_transform_name ;;
- -program-transform-name=* | --program-transform-name=* \
- | --program-transform-nam=* | --program-transform-na=* \
- | --program-transform-n=* | --program-transform-=* \
- | --program-transform=* | --program-transfor=* \
- | --program-transfo=* | --program-transf=* \
- | --program-trans=* | --program-tran=* \
- | --progr-tra=* | --program-tr=* | --program-t=*)
- program_transform_name=$ac_optarg ;;
-
- -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
- ac_prev=pdfdir ;;
- -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
- pdfdir=$ac_optarg ;;
-
- -psdir | --psdir | --psdi | --psd | --ps)
- ac_prev=psdir ;;
- -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
- psdir=$ac_optarg ;;
-
- -q | -quiet | --quiet | --quie | --qui | --qu | --q \
- | -silent | --silent | --silen | --sile | --sil)
- silent=yes ;;
-
- -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
- ac_prev=sbindir ;;
- -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
- | --sbi=* | --sb=*)
- sbindir=$ac_optarg ;;
-
- -sharedstatedir | --sharedstatedir | --sharedstatedi \
- | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
- | --sharedst | --shareds | --shared | --share | --shar \
- | --sha | --sh)
- ac_prev=sharedstatedir ;;
- -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
- | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
- | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
- | --sha=* | --sh=*)
- sharedstatedir=$ac_optarg ;;
-
- -site | --site | --sit)
- ac_prev=site ;;
- -site=* | --site=* | --sit=*)
- site=$ac_optarg ;;
-
- -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
- ac_prev=srcdir ;;
- -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
- srcdir=$ac_optarg ;;
-
- -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
- | --syscon | --sysco | --sysc | --sys | --sy)
- ac_prev=sysconfdir ;;
- -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
- | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
- sysconfdir=$ac_optarg ;;
-
- -target | --target | --targe | --targ | --tar | --ta | --t)
- ac_prev=target_alias ;;
- -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
- target_alias=$ac_optarg ;;
-
- -v | -verbose | --verbose | --verbos | --verbo | --verb)
- verbose=yes ;;
-
- -version | --version | --versio | --versi | --vers | -V)
- ac_init_version=: ;;
-
- -with-* | --with-*)
- ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
- # Reject names that are not valid shell variable names.
- expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
- as_fn_error $? "invalid package name: $ac_useropt"
- ac_useropt_orig=$ac_useropt
- ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
- case $ac_user_opts in
- *"
-"with_$ac_useropt"
-"*) ;;
- *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
- ac_unrecognized_sep=', ';;
- esac
- eval with_$ac_useropt=\$ac_optarg ;;
-
- -without-* | --without-*)
- ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
- # Reject names that are not valid shell variable names.
- expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
- as_fn_error $? "invalid package name: $ac_useropt"
- ac_useropt_orig=$ac_useropt
- ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
- case $ac_user_opts in
- *"
-"with_$ac_useropt"
-"*) ;;
- *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
- ac_unrecognized_sep=', ';;
- esac
- eval with_$ac_useropt=no ;;
-
- --x)
- # Obsolete; use --with-x.
- with_x=yes ;;
-
- -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
- | --x-incl | --x-inc | --x-in | --x-i)
- ac_prev=x_includes ;;
- -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
- | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
- x_includes=$ac_optarg ;;
-
- -x-libraries | --x-libraries | --x-librarie | --x-librari \
- | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
- ac_prev=x_libraries ;;
- -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
- | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
- x_libraries=$ac_optarg ;;
-
- -*) as_fn_error $? "unrecognized option: \`$ac_option'
-Try \`$0 --help' for more information"
- ;;
-
- *=*)
- ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
- # Reject names that are not valid shell variable names.
- case $ac_envvar in #(
- '' | [0-9]* | *[!_$as_cr_alnum]* )
- as_fn_error $? "invalid variable name: \`$ac_envvar'" ;;
- esac
- eval $ac_envvar=\$ac_optarg
- export $ac_envvar ;;
-
- *)
- # FIXME: should be removed in autoconf 3.0.
- $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
- expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
- $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
- : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}"
- ;;
-
- esac
-done
-
-if test -n "$ac_prev"; then
- ac_option=--`echo $ac_prev | sed 's/_/-/g'`
- as_fn_error $? "missing argument to $ac_option"
-fi
-
-if test -n "$ac_unrecognized_opts"; then
- case $enable_option_checking in
- no) ;;
- fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;;
- *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
- esac
-fi
-
-# Check all directory arguments for consistency.
-for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
- datadir sysconfdir sharedstatedir localstatedir includedir \
- oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
- libdir localedir mandir
-do
- eval ac_val=\$$ac_var
- # Remove trailing slashes.
- case $ac_val in
- */ )
- ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
- eval $ac_var=\$ac_val;;
- esac
- # Be sure to have absolute directory names.
- case $ac_val in
- [\\/$]* | ?:[\\/]* ) continue;;
- NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
- esac
- as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val"
-done
-
-# There might be people who depend on the old broken behavior: `$host'
-# used to hold the argument of --host etc.
-# FIXME: To remove some day.
-build=$build_alias
-host=$host_alias
-target=$target_alias
-
-# FIXME: To remove some day.
-if test "x$host_alias" != x; then
- if test "x$build_alias" = x; then
- cross_compiling=maybe
- elif test "x$build_alias" != "x$host_alias"; then
- cross_compiling=yes
- fi
-fi
-
-ac_tool_prefix=
-test -n "$host_alias" && ac_tool_prefix=$host_alias-
-
-test "$silent" = yes && exec 6>/dev/null
-
-
-ac_pwd=`pwd` && test -n "$ac_pwd" &&
-ac_ls_di=`ls -di .` &&
-ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
- as_fn_error $? "working directory cannot be determined"
-test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
- as_fn_error $? "pwd does not report name of working directory"
-
-
-# Find the source files, if location was not specified.
-if test -z "$srcdir"; then
- ac_srcdir_defaulted=yes
- # Try the directory containing this script, then the parent directory.
- ac_confdir=`$as_dirname -- "$as_myself" ||
-$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$as_myself" : 'X\(//\)[^/]' \| \
- X"$as_myself" : 'X\(//\)$' \| \
- X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$as_myself" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
- srcdir=$ac_confdir
- if test ! -r "$srcdir/$ac_unique_file"; then
- srcdir=..
- fi
-else
- ac_srcdir_defaulted=no
-fi
-if test ! -r "$srcdir/$ac_unique_file"; then
- test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
- as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir"
-fi
-ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
-ac_abs_confdir=`(
- cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg"
- pwd)`
-# When building in place, set srcdir=.
-if test "$ac_abs_confdir" = "$ac_pwd"; then
- srcdir=.
-fi
-# Remove unnecessary trailing slashes from srcdir.
-# Double slashes in file names in object file debugging info
-# mess up M-x gdb in Emacs.
-case $srcdir in
-*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
-esac
-for ac_var in $ac_precious_vars; do
- eval ac_env_${ac_var}_set=\${${ac_var}+set}
- eval ac_env_${ac_var}_value=\$${ac_var}
- eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
- eval ac_cv_env_${ac_var}_value=\$${ac_var}
-done
-
-#
-# Report the --help message.
-#
-if test "$ac_init_help" = "long"; then
- # Omit some internal or obsolete options to make the list less imposing.
- # This message is too long to be a string in the A/UX 3.1 sh.
- cat <<_ACEOF
-\`configure' configures ocaml-libvirt 0.6.1.4 to adapt to many kinds of systems.
-
-Usage: $0 [OPTION]... [VAR=VALUE]...
-
-To assign environment variables (e.g., CC, CFLAGS...), specify them as
-VAR=VALUE. See below for descriptions of some of the useful variables.
-
-Defaults for the options are specified in brackets.
-
-Configuration:
- -h, --help display this help and exit
- --help=short display options specific to this package
- --help=recursive display the short help of all the included packages
- -V, --version display version information and exit
- -q, --quiet, --silent do not print \`checking ...' messages
- --cache-file=FILE cache test results in FILE [disabled]
- -C, --config-cache alias for \`--cache-file=config.cache'
- -n, --no-create do not create output files
- --srcdir=DIR find the sources in DIR [configure dir or \`..']
-
-Installation directories:
- --prefix=PREFIX install architecture-independent files in PREFIX
- [$ac_default_prefix]
- --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
- [PREFIX]
-
-By default, \`make install' will install all the files in
-\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify
-an installation prefix other than \`$ac_default_prefix' using \`--prefix',
-for instance \`--prefix=\$HOME'.
-
-For better control, use the options below.
-
-Fine tuning of the installation directories:
- --bindir=DIR user executables [EPREFIX/bin]
- --sbindir=DIR system admin executables [EPREFIX/sbin]
- --libexecdir=DIR program executables [EPREFIX/libexec]
- --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
- --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
- --localstatedir=DIR modifiable single-machine data [PREFIX/var]
- --libdir=DIR object code libraries [EPREFIX/lib]
- --includedir=DIR C header files [PREFIX/include]
- --oldincludedir=DIR C header files for non-gcc [/usr/include]
- --datarootdir=DIR read-only arch.-independent data root [PREFIX/share]
- --datadir=DIR read-only architecture-independent data [DATAROOTDIR]
- --infodir=DIR info documentation [DATAROOTDIR/info]
- --localedir=DIR locale-dependent data [DATAROOTDIR/locale]
- --mandir=DIR man documentation [DATAROOTDIR/man]
- --docdir=DIR documentation root [DATAROOTDIR/doc/ocaml-libvirt]
- --htmldir=DIR html documentation [DOCDIR]
- --dvidir=DIR dvi documentation [DOCDIR]
- --pdfdir=DIR pdf documentation [DOCDIR]
- --psdir=DIR ps documentation [DOCDIR]
-_ACEOF
-
- cat <<\_ACEOF
-
-System types:
- --build=BUILD configure for building on BUILD [guessed]
- --host=HOST cross-compile to build programs to run on HOST [BUILD]
-_ACEOF
-fi
-
-if test -n "$ac_init_help"; then
- case $ac_init_help in
- short | recursive ) echo "Configuration of ocaml-libvirt 0.6.1.4:";;
- esac
- cat <<\_ACEOF
-
-Optional Packages:
- --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
- --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
- --with-libvirt=PATH Set path to installed libvirt
- --with-nsis use NSIS to build a Windows installer
-
-Some influential environment variables:
- CC C compiler command
- CFLAGS C compiler flags
- LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
- nonstandard directory <lib dir>
- LIBS libraries to pass to the linker, e.g. -l<library>
- CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
- you have headers in a nonstandard directory <include dir>
- CPP C preprocessor
-
-Use these variables to override the choices made by `configure' or to help
-it to find libraries and programs with nonstandard names/locations.
-
-Report bugs to the package provider.
-_ACEOF
-ac_status=$?
-fi
-
-if test "$ac_init_help" = "recursive"; then
- # If there are subdirs, report their specific --help.
- for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
- test -d "$ac_dir" ||
- { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
- continue
- ac_builddir=.
-
-case "$ac_dir" in
-.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
-*)
- ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
- # A ".." for each directory in $ac_dir_suffix.
- ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
- case $ac_top_builddir_sub in
- "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
- *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
- esac ;;
-esac
-ac_abs_top_builddir=$ac_pwd
-ac_abs_builddir=$ac_pwd$ac_dir_suffix
-# for backward compatibility:
-ac_top_builddir=$ac_top_build_prefix
-
-case $srcdir in
- .) # We are building in place.
- ac_srcdir=.
- ac_top_srcdir=$ac_top_builddir_sub
- ac_abs_top_srcdir=$ac_pwd ;;
- [\\/]* | ?:[\\/]* ) # Absolute name.
- ac_srcdir=$srcdir$ac_dir_suffix;
- ac_top_srcdir=$srcdir
- ac_abs_top_srcdir=$srcdir ;;
- *) # Relative name.
- ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
- ac_top_srcdir=$ac_top_build_prefix$srcdir
- ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
-esac
-ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
-
- cd "$ac_dir" || { ac_status=$?; continue; }
- # Check for guested configure.
- if test -f "$ac_srcdir/configure.gnu"; then
- echo &&
- $SHELL "$ac_srcdir/configure.gnu" --help=recursive
- elif test -f "$ac_srcdir/configure"; then
- echo &&
- $SHELL "$ac_srcdir/configure" --help=recursive
- else
- $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
- fi || ac_status=$?
- cd "$ac_pwd" || { ac_status=$?; break; }
- done
-fi
-
-test -n "$ac_init_help" && exit $ac_status
-if $ac_init_version; then
- cat <<\_ACEOF
-ocaml-libvirt configure 0.6.1.4
-generated by GNU Autoconf 2.69
-
-Copyright (C) 2012 Free Software Foundation, Inc.
-This configure script is free software; the Free Software Foundation
-gives unlimited permission to copy, distribute and modify it.
-_ACEOF
- exit
-fi
-
-## ------------------------ ##
-## Autoconf initialization. ##
-## ------------------------ ##
-
-# ac_fn_c_try_compile LINENO
-# --------------------------
-# Try to compile conftest.$ac_ext, and return whether this succeeded.
-ac_fn_c_try_compile ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- rm -f conftest.$ac_objext
- if { { ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_compile") 2>conftest.err
- ac_status=$?
- if test -s conftest.err; then
- grep -v '^ *+' conftest.err >conftest.er1
- cat conftest.er1 >&5
- mv -f conftest.er1 conftest.err
- fi
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then :
- ac_retval=0
-else
- $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_retval=1
-fi
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
- as_fn_set_status $ac_retval
-
-} # ac_fn_c_try_compile
-
-# ac_fn_c_try_cpp LINENO
-# ----------------------
-# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
-ac_fn_c_try_cpp ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- if { { ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
- ac_status=$?
- if test -s conftest.err; then
- grep -v '^ *+' conftest.err >conftest.er1
- cat conftest.er1 >&5
- mv -f conftest.er1 conftest.err
- fi
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } > conftest.i && {
- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
- test ! -s conftest.err
- }; then :
- ac_retval=0
-else
- $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_retval=1
-fi
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
- as_fn_set_status $ac_retval
-
-} # ac_fn_c_try_cpp
-
-# ac_fn_c_try_link LINENO
-# -----------------------
-# Try to link conftest.$ac_ext, and return whether this succeeded.
-ac_fn_c_try_link ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- rm -f conftest.$ac_objext conftest$ac_exeext
- if { { ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_link") 2>conftest.err
- ac_status=$?
- if test -s conftest.err; then
- grep -v '^ *+' conftest.err >conftest.er1
- cat conftest.er1 >&5
- mv -f conftest.er1 conftest.err
- fi
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext && {
- test "$cross_compiling" = yes ||
- test -x conftest$ac_exeext
- }; then :
- ac_retval=0
-else
- $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_retval=1
-fi
- # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
- # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
- # interfere with the next link command; also delete a directory that is
- # left behind by Apple's compiler. We do this before executing the actions.
- rm -rf conftest.dSYM conftest_ipa8_conftest.oo
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
- as_fn_set_status $ac_retval
-
-} # ac_fn_c_try_link
-
-# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES
-# -------------------------------------------------------
-# Tests whether HEADER exists, giving a warning if it cannot be compiled using
-# the include files in INCLUDES and setting the cache variable VAR
-# accordingly.
-ac_fn_c_check_header_mongrel ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- if eval \${$3+:} false; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
-$as_echo_n "checking for $2... " >&6; }
-if eval \${$3+:} false; then :
- $as_echo_n "(cached) " >&6
-fi
-eval ac_res=\$$3
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-else
- # Is the header compilable?
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5
-$as_echo_n "checking $2 usability... " >&6; }
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-$4
-#include <$2>
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_header_compiler=yes
-else
- ac_header_compiler=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5
-$as_echo "$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5
-$as_echo_n "checking $2 presence... " >&6; }
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <$2>
-_ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
- ac_header_preproc=yes
-else
- ac_header_preproc=no
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5
-$as_echo "$ac_header_preproc" >&6; }
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #((
- yes:no: )
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5
-$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
-$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
- ;;
- no:yes:* )
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5
-$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5
-$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5
-$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5
-$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
-$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
- ;;
-esac
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
-$as_echo_n "checking for $2... " >&6; }
-if eval \${$3+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- eval "$3=\$ac_header_compiler"
-fi
-eval ac_res=\$$3
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-fi
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-
-} # ac_fn_c_check_header_mongrel
-
-# ac_fn_c_try_run LINENO
-# ----------------------
-# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
-# that executables *can* be run.
-ac_fn_c_try_run ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- if { { ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_link") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
- { { case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; }; then :
- ac_retval=0
-else
- $as_echo "$as_me: program exited with status $ac_status" >&5
- $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_retval=$ac_status
-fi
- rm -rf conftest.dSYM conftest_ipa8_conftest.oo
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
- as_fn_set_status $ac_retval
-
-} # ac_fn_c_try_run
-
-# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
-# -------------------------------------------------------
-# Tests whether HEADER exists and can be compiled using the include files in
-# INCLUDES, setting the cache variable VAR accordingly.
-ac_fn_c_check_header_compile ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
-$as_echo_n "checking for $2... " >&6; }
-if eval \${$3+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-$4
-#include <$2>
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- eval "$3=yes"
-else
- eval "$3=no"
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-eval ac_res=\$$3
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-
-} # ac_fn_c_check_header_compile
-cat >config.log <<_ACEOF
-This file contains any messages produced by compilers while
-running configure, to aid debugging if configure makes a mistake.
-
-It was created by ocaml-libvirt $as_me 0.6.1.4, which was
-generated by GNU Autoconf 2.69. Invocation command line was
-
- $ $0 $@
-
-_ACEOF
-exec 5>>config.log
-{
-cat <<_ASUNAME
-## --------- ##
-## Platform. ##
-## --------- ##
-
-hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
-uname -m = `(uname -m) 2>/dev/null || echo unknown`
-uname -r = `(uname -r) 2>/dev/null || echo unknown`
-uname -s = `(uname -s) 2>/dev/null || echo unknown`
-uname -v = `(uname -v) 2>/dev/null || echo unknown`
-
-/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
-/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown`
-
-/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown`
-/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown`
-/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
-/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown`
-/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown`
-/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown`
-/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown`
-
-_ASUNAME
-
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- $as_echo "PATH: $as_dir"
- done
-IFS=$as_save_IFS
-
-} >&5
-
-cat >&5 <<_ACEOF
-
-
-## ----------- ##
-## Core tests. ##
-## ----------- ##
-
-_ACEOF
-
-
-# Keep a trace of the command line.
-# Strip out --no-create and --no-recursion so they do not pile up.
-# Strip out --silent because we don't want to record it for future runs.
-# Also quote any args containing shell meta-characters.
-# Make two passes to allow for proper duplicate-argument suppression.
-ac_configure_args=
-ac_configure_args0=
-ac_configure_args1=
-ac_must_keep_next=false
-for ac_pass in 1 2
-do
- for ac_arg
- do
- case $ac_arg in
- -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
- -q | -quiet | --quiet | --quie | --qui | --qu | --q \
- | -silent | --silent | --silen | --sile | --sil)
- continue ;;
- *\'*)
- ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
- esac
- case $ac_pass in
- 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;;
- 2)
- as_fn_append ac_configure_args1 " '$ac_arg'"
- if test $ac_must_keep_next = true; then
- ac_must_keep_next=false # Got value, back to normal.
- else
- case $ac_arg in
- *=* | --config-cache | -C | -disable-* | --disable-* \
- | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
- | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
- | -with-* | --with-* | -without-* | --without-* | --x)
- case "$ac_configure_args0 " in
- "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
- esac
- ;;
- -* ) ac_must_keep_next=true ;;
- esac
- fi
- as_fn_append ac_configure_args " '$ac_arg'"
- ;;
- esac
- done
-done
-{ ac_configure_args0=; unset ac_configure_args0;}
-{ ac_configure_args1=; unset ac_configure_args1;}
-
-# When interrupted or exit'd, cleanup temporary files, and complete
-# config.log. We remove comments because anyway the quotes in there
-# would cause problems or look ugly.
-# WARNING: Use '\'' to represent an apostrophe within the trap.
-# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
-trap 'exit_status=$?
- # Save into config.log some information that might help in debugging.
- {
- echo
-
- $as_echo "## ---------------- ##
-## Cache variables. ##
-## ---------------- ##"
- echo
- # The following way of writing the cache mishandles newlines in values,
-(
- for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
- eval ac_val=\$$ac_var
- case $ac_val in #(
- *${as_nl}*)
- case $ac_var in #(
- *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
-$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
- esac
- case $ac_var in #(
- _ | IFS | as_nl) ;; #(
- BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
- *) { eval $ac_var=; unset $ac_var;} ;;
- esac ;;
- esac
- done
- (set) 2>&1 |
- case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
- *${as_nl}ac_space=\ *)
- sed -n \
- "s/'\''/'\''\\\\'\'''\''/g;
- s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
- ;; #(
- *)
- sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
- ;;
- esac |
- sort
-)
- echo
-
- $as_echo "## ----------------- ##
-## Output variables. ##
-## ----------------- ##"
- echo
- for ac_var in $ac_subst_vars
- do
- eval ac_val=\$$ac_var
- case $ac_val in
- *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
- esac
- $as_echo "$ac_var='\''$ac_val'\''"
- done | sort
- echo
-
- if test -n "$ac_subst_files"; then
- $as_echo "## ------------------- ##
-## File substitutions. ##
-## ------------------- ##"
- echo
- for ac_var in $ac_subst_files
- do
- eval ac_val=\$$ac_var
- case $ac_val in
- *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
- esac
- $as_echo "$ac_var='\''$ac_val'\''"
- done | sort
- echo
- fi
-
- if test -s confdefs.h; then
- $as_echo "## ----------- ##
-## confdefs.h. ##
-## ----------- ##"
- echo
- cat confdefs.h
- echo
- fi
- test "$ac_signal" != 0 &&
- $as_echo "$as_me: caught signal $ac_signal"
- $as_echo "$as_me: exit $exit_status"
- } >&5
- rm -f core *.core core.conftest.* &&
- rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
- exit $exit_status
-' 0
-for ac_signal in 1 2 13 15; do
- trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal
-done
-ac_signal=0
-
-# confdefs.h avoids OS command line length limits that DEFS can exceed.
-rm -f -r conftest* confdefs.h
-
-$as_echo "/* confdefs.h */" > confdefs.h
-
-# Predefined preprocessor variables.
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_NAME "$PACKAGE_NAME"
-_ACEOF
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
-_ACEOF
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_VERSION "$PACKAGE_VERSION"
-_ACEOF
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_STRING "$PACKAGE_STRING"
-_ACEOF
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
-_ACEOF
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_URL "$PACKAGE_URL"
-_ACEOF
-
-
-# Let the site file select an alternate cache file if it wants to.
-# Prefer an explicitly selected file to automatically selected ones.
-ac_site_file1=NONE
-ac_site_file2=NONE
-if test -n "$CONFIG_SITE"; then
- # We do not want a PATH search for config.site.
- case $CONFIG_SITE in #((
- -*) ac_site_file1=./$CONFIG_SITE;;
- */*) ac_site_file1=$CONFIG_SITE;;
- *) ac_site_file1=./$CONFIG_SITE;;
- esac
-elif test "x$prefix" != xNONE; then
- ac_site_file1=$prefix/share/config.site
- ac_site_file2=$prefix/etc/config.site
-else
- ac_site_file1=$ac_default_prefix/share/config.site
- ac_site_file2=$ac_default_prefix/etc/config.site
-fi
-for ac_site_file in "$ac_site_file1" "$ac_site_file2"
-do
- test "x$ac_site_file" = xNONE && continue
- if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
-$as_echo "$as_me: loading site script $ac_site_file" >&6;}
- sed 's/^/| /' "$ac_site_file" >&5
- . "$ac_site_file" \
- || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "failed to load site script $ac_site_file
-See \`config.log' for more details" "$LINENO" 5; }
- fi
-done
-
-if test -r "$cache_file"; then
- # Some versions of bash will fail to source /dev/null (special files
- # actually), so we avoid doing that. DJGPP emulates it as a regular file.
- if test /dev/null != "$cache_file" && test -f "$cache_file"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
-$as_echo "$as_me: loading cache $cache_file" >&6;}
- case $cache_file in
- [\\/]* | ?:[\\/]* ) . "$cache_file";;
- *) . "./$cache_file";;
- esac
- fi
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5
-$as_echo "$as_me: creating cache $cache_file" >&6;}
- >$cache_file
-fi
-
-# Check that the precious variables saved in the cache have kept the same
-# value.
-ac_cache_corrupted=false
-for ac_var in $ac_precious_vars; do
- eval ac_old_set=\$ac_cv_env_${ac_var}_set
- eval ac_new_set=\$ac_env_${ac_var}_set
- eval ac_old_val=\$ac_cv_env_${ac_var}_value
- eval ac_new_val=\$ac_env_${ac_var}_value
- case $ac_old_set,$ac_new_set in
- set,)
- { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
-$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
- ac_cache_corrupted=: ;;
- ,set)
- { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5
-$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
- ac_cache_corrupted=: ;;
- ,);;
- *)
- if test "x$ac_old_val" != "x$ac_new_val"; then
- # differences in whitespace do not lead to failure.
- ac_old_val_w=`echo x $ac_old_val`
- ac_new_val_w=`echo x $ac_new_val`
- if test "$ac_old_val_w" != "$ac_new_val_w"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5
-$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
- ac_cache_corrupted=:
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
-$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
- eval $ac_var=\$ac_old_val
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5
-$as_echo "$as_me: former value: \`$ac_old_val'" >&2;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5
-$as_echo "$as_me: current value: \`$ac_new_val'" >&2;}
- fi;;
- esac
- # Pass precious variables to config.status.
- if test "$ac_new_set" = set; then
- case $ac_new_val in
- *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
- *) ac_arg=$ac_var=$ac_new_val ;;
- esac
- case " $ac_configure_args " in
- *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy.
- *) as_fn_append ac_configure_args " '$ac_arg'" ;;
- esac
- fi
-done
-if $ac_cache_corrupted; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
-$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
- as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
-fi
-## -------------------- ##
-## Main body of script. ##
-## -------------------- ##
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
-set dummy ${ac_tool_prefix}gcc; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_CC="${ac_tool_prefix}gcc"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
-$as_echo "$CC" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_CC"; then
- ac_ct_CC=$CC
- # Extract the first word of "gcc", so it can be a program name with args.
-set dummy gcc; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_CC+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_CC"; then
- ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_CC="gcc"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_CC=$ac_cv_prog_ac_ct_CC
-if test -n "$ac_ct_CC"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
-$as_echo "$ac_ct_CC" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
- if test "x$ac_ct_CC" = x; then
- CC=""
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- CC=$ac_ct_CC
- fi
-else
- CC="$ac_cv_prog_CC"
-fi
-
-if test -z "$CC"; then
- if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
-set dummy ${ac_tool_prefix}cc; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_CC="${ac_tool_prefix}cc"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
-$as_echo "$CC" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- fi
-fi
-if test -z "$CC"; then
- # Extract the first word of "cc", so it can be a program name with args.
-set dummy cc; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
- ac_prog_rejected=no
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
- ac_prog_rejected=yes
- continue
- fi
- ac_cv_prog_CC="cc"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-if test $ac_prog_rejected = yes; then
- # We found a bogon in the path, so make sure we never use it.
- set dummy $ac_cv_prog_CC
- shift
- if test $# != 0; then
- # We chose a different compiler from the bogus one.
- # However, it has the same basename, so the bogon will be chosen
- # first if we set CC to just the basename; use the full file name.
- shift
- ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
- fi
-fi
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
-$as_echo "$CC" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$CC"; then
- if test -n "$ac_tool_prefix"; then
- for ac_prog in cl.exe
- do
- # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
-set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
-$as_echo "$CC" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- test -n "$CC" && break
- done
-fi
-if test -z "$CC"; then
- ac_ct_CC=$CC
- for ac_prog in cl.exe
-do
- # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_CC+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_CC"; then
- ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_CC="$ac_prog"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_CC=$ac_cv_prog_ac_ct_CC
-if test -n "$ac_ct_CC"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
-$as_echo "$ac_ct_CC" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- test -n "$ac_ct_CC" && break
-done
-
- if test "x$ac_ct_CC" = x; then
- CC=""
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- CC=$ac_ct_CC
- fi
-fi
-
-fi
-
-
-test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "no acceptable C compiler found in \$PATH
-See \`config.log' for more details" "$LINENO" 5; }
-
-# Provide some information about the compiler.
-$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
-set X $ac_compile
-ac_compiler=$2
-for ac_option in --version -v -V -qversion; do
- { { ac_try="$ac_compiler $ac_option >&5"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_compiler $ac_option >&5") 2>conftest.err
- ac_status=$?
- if test -s conftest.err; then
- sed '10a\
-... rest of stderr output deleted ...
- 10q' conftest.err >conftest.er1
- cat conftest.er1 >&5
- fi
- rm -f conftest.er1 conftest.err
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }
-done
-
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-ac_clean_files_save=$ac_clean_files
-ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
-# Try to create an executable without -o first, disregard a.out.
-# It will help us diagnose broken compilers, and finding out an intuition
-# of exeext.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
-$as_echo_n "checking whether the C compiler works... " >&6; }
-ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
-
-# The possible output files:
-ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
-
-ac_rmfiles=
-for ac_file in $ac_files
-do
- case $ac_file in
- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
- * ) ac_rmfiles="$ac_rmfiles $ac_file";;
- esac
-done
-rm -f $ac_rmfiles
-
-if { { ac_try="$ac_link_default"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_link_default") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; then :
- # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
-# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
-# in a Makefile. We should not override ac_cv_exeext if it was cached,
-# so that the user can short-circuit this test for compilers unknown to
-# Autoconf.
-for ac_file in $ac_files ''
-do
- test -f "$ac_file" || continue
- case $ac_file in
- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
- ;;
- [ab].out )
- # We found the default executable, but exeext='' is most
- # certainly right.
- break;;
- *.* )
- if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
- then :; else
- ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
- fi
- # We set ac_cv_exeext here because the later test for it is not
- # safe: cross compilers may not add the suffix if given an `-o'
- # argument, so we may need to know it at that point already.
- # Even if this section looks crufty: it has the advantage of
- # actually working.
- break;;
- * )
- break;;
- esac
-done
-test "$ac_cv_exeext" = no && ac_cv_exeext=
-
-else
- ac_file=''
-fi
-if test -z "$ac_file"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-$as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error 77 "C compiler cannot create executables
-See \`config.log' for more details" "$LINENO" 5; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
-$as_echo_n "checking for C compiler default output file name... " >&6; }
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
-$as_echo "$ac_file" >&6; }
-ac_exeext=$ac_cv_exeext
-
-rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
-ac_clean_files=$ac_clean_files_save
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
-$as_echo_n "checking for suffix of executables... " >&6; }
-if { { ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_link") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; then :
- # If both `conftest.exe' and `conftest' are `present' (well, observable)
-# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will
-# work properly (i.e., refer to `conftest.exe'), while it won't with
-# `rm'.
-for ac_file in conftest.exe conftest conftest.*; do
- test -f "$ac_file" || continue
- case $ac_file in
- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
- *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
- break;;
- * ) break;;
- esac
-done
-else
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "cannot compute suffix of executables: cannot compile and link
-See \`config.log' for more details" "$LINENO" 5; }
-fi
-rm -f conftest conftest$ac_cv_exeext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
-$as_echo "$ac_cv_exeext" >&6; }
-
-rm -f conftest.$ac_ext
-EXEEXT=$ac_cv_exeext
-ac_exeext=$EXEEXT
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <stdio.h>
-int
-main ()
-{
-FILE *f = fopen ("conftest.out", "w");
- return ferror (f) || fclose (f) != 0;
-
- ;
- return 0;
-}
-_ACEOF
-ac_clean_files="$ac_clean_files conftest.out"
-# Check that the compiler produces executables we can run. If not, either
-# the compiler is broken, or we cross compile.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
-$as_echo_n "checking whether we are cross compiling... " >&6; }
-if test "$cross_compiling" != yes; then
- { { ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_link") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }
- if { ac_try='./conftest$ac_cv_exeext'
- { { case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; }; then
- cross_compiling=no
- else
- if test "$cross_compiling" = maybe; then
- cross_compiling=yes
- else
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "cannot run C compiled programs.
-If you meant to cross compile, use \`--host'.
-See \`config.log' for more details" "$LINENO" 5; }
- fi
- fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
-$as_echo "$cross_compiling" >&6; }
-
-rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
-ac_clean_files=$ac_clean_files_save
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
-$as_echo_n "checking for suffix of object files... " >&6; }
-if ${ac_cv_objext+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.o conftest.obj
-if { { ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_compile") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; then :
- for ac_file in conftest.o conftest.obj conftest.*; do
- test -f "$ac_file" || continue;
- case $ac_file in
- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
- *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
- break;;
- esac
-done
-else
- $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "cannot compute suffix of object files: cannot compile
-See \`config.log' for more details" "$LINENO" 5; }
-fi
-rm -f conftest.$ac_cv_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
-$as_echo "$ac_cv_objext" >&6; }
-OBJEXT=$ac_cv_objext
-ac_objext=$OBJEXT
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
-$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
-if ${ac_cv_c_compiler_gnu+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-#ifndef __GNUC__
- choke me
-#endif
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_compiler_gnu=yes
-else
- ac_compiler_gnu=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-ac_cv_c_compiler_gnu=$ac_compiler_gnu
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
-$as_echo "$ac_cv_c_compiler_gnu" >&6; }
-if test $ac_compiler_gnu = yes; then
- GCC=yes
-else
- GCC=
-fi
-ac_test_CFLAGS=${CFLAGS+set}
-ac_save_CFLAGS=$CFLAGS
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
-$as_echo_n "checking whether $CC accepts -g... " >&6; }
-if ${ac_cv_prog_cc_g+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_save_c_werror_flag=$ac_c_werror_flag
- ac_c_werror_flag=yes
- ac_cv_prog_cc_g=no
- CFLAGS="-g"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_prog_cc_g=yes
-else
- CFLAGS=""
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
-else
- ac_c_werror_flag=$ac_save_c_werror_flag
- CFLAGS="-g"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_prog_cc_g=yes
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- ac_c_werror_flag=$ac_save_c_werror_flag
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
-$as_echo "$ac_cv_prog_cc_g" >&6; }
-if test "$ac_test_CFLAGS" = set; then
- CFLAGS=$ac_save_CFLAGS
-elif test $ac_cv_prog_cc_g = yes; then
- if test "$GCC" = yes; then
- CFLAGS="-g -O2"
- else
- CFLAGS="-g"
- fi
-else
- if test "$GCC" = yes; then
- CFLAGS="-O2"
- else
- CFLAGS=
- fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
-$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
-if ${ac_cv_prog_cc_c89+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_cv_prog_cc_c89=no
-ac_save_CC=$CC
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <stdarg.h>
-#include <stdio.h>
-struct stat;
-/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
-struct buf { int x; };
-FILE * (*rcsopen) (struct buf *, struct stat *, int);
-static char *e (p, i)
- char **p;
- int i;
-{
- return p[i];
-}
-static char *f (char * (*g) (char **, int), char **p, ...)
-{
- char *s;
- va_list v;
- va_start (v,p);
- s = g (p, va_arg (v,int));
- va_end (v);
- return s;
-}
-
-/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
- function prototypes and stuff, but not '\xHH' hex character constants.
- These don't provoke an error unfortunately, instead are silently treated
- as 'x'. The following induces an error, until -std is added to get
- proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
- array size at least. It's necessary to write '\x00'==0 to get something
- that's true only with -std. */
-int osf4_cc_array ['\x00' == 0 ? 1 : -1];
-
-/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
- inside strings and character constants. */
-#define FOO(x) 'x'
-int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
-
-int test (int i, double x);
-struct s1 {int (*f) (int a);};
-struct s2 {int (*f) (double a);};
-int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
-int argc;
-char **argv;
-int
-main ()
-{
-return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
- ;
- return 0;
-}
-_ACEOF
-for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
- -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
-do
- CC="$ac_save_CC $ac_arg"
- if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_prog_cc_c89=$ac_arg
-fi
-rm -f core conftest.err conftest.$ac_objext
- test "x$ac_cv_prog_cc_c89" != "xno" && break
-done
-rm -f conftest.$ac_ext
-CC=$ac_save_CC
-
-fi
-# AC_CACHE_VAL
-case "x$ac_cv_prog_cc_c89" in
- x)
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
-$as_echo "none needed" >&6; } ;;
- xno)
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
-$as_echo "unsupported" >&6; } ;;
- *)
- CC="$CC $ac_cv_prog_cc_c89"
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
-$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
-esac
-if test "x$ac_cv_prog_cc_c89" != xno; then :
-
-fi
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-ac_aux_dir=
-for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
- if test -f "$ac_dir/install-sh"; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/install-sh -c"
- break
- elif test -f "$ac_dir/install.sh"; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/install.sh -c"
- break
- elif test -f "$ac_dir/shtool"; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/shtool install -c"
- break
- fi
-done
-if test -z "$ac_aux_dir"; then
- as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5
-fi
-
-# These three variables are undocumented and unsupported,
-# and are intended to be withdrawn in a future Autoconf release.
-# They can cause serious problems if a builder's source tree is in a directory
-# whose full name contains unusual characters.
-ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var.
-ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var.
-ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
-
-
-# Find a good install program. We prefer a C program (faster),
-# so one script is as good as another. But avoid the broken or
-# incompatible versions:
-# SysV /etc/install, /usr/sbin/install
-# SunOS /usr/etc/install
-# IRIX /sbin/install
-# AIX /bin/install
-# AmigaOS /C/install, which installs bootblocks on floppy discs
-# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
-# AFS /usr/afsws/bin/install, which mishandles nonexistent args
-# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
-# OS/2's system install, which has a completely different semantic
-# ./install, which can be erroneously created by make from ./install.sh.
-# Reject install programs that cannot install multiple files.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
-$as_echo_n "checking for a BSD-compatible install... " >&6; }
-if test -z "$INSTALL"; then
-if ${ac_cv_path_install+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- # Account for people who put trailing slashes in PATH elements.
-case $as_dir/ in #((
- ./ | .// | /[cC]/* | \
- /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
- ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \
- /usr/ucb/* ) ;;
- *)
- # OSF1 and SCO ODT 3.0 have their own names for install.
- # Don't use installbsd from OSF since it installs stuff as root
- # by default.
- for ac_prog in ginstall scoinst install; do
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
- if test $ac_prog = install &&
- grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
- # AIX install. It has an incompatible calling convention.
- :
- elif test $ac_prog = install &&
- grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
- # program-specific install script used by HP pwplus--don't use.
- :
- else
- rm -rf conftest.one conftest.two conftest.dir
- echo one > conftest.one
- echo two > conftest.two
- mkdir conftest.dir
- if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
- test -s conftest.one && test -s conftest.two &&
- test -s conftest.dir/conftest.one &&
- test -s conftest.dir/conftest.two
- then
- ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
- break 3
- fi
- fi
- fi
- done
- done
- ;;
-esac
-
- done
-IFS=$as_save_IFS
-
-rm -rf conftest.one conftest.two conftest.dir
-
-fi
- if test "${ac_cv_path_install+set}" = set; then
- INSTALL=$ac_cv_path_install
- else
- # As a last resort, use the slow shell script. Don't cache a
- # value for INSTALL within a source directory, because that will
- # break other packages using the cache if that directory is
- # removed, or if the value is a relative name.
- INSTALL=$ac_install_sh
- fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5
-$as_echo "$INSTALL" >&6; }
-
-# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
-# It thinks the first close brace ends the variable substitution.
-test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
-
-test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
-
-test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
-$as_echo_n "checking how to run the C preprocessor... " >&6; }
-# On Suns, sometimes $CPP names a directory.
-if test -n "$CPP" && test -d "$CPP"; then
- CPP=
-fi
-if test -z "$CPP"; then
- if ${ac_cv_prog_CPP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- # Double quotes because CPP needs to be expanded
- for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
- do
- ac_preproc_ok=false
-for ac_c_preproc_warn_flag in '' yes
-do
- # Use a header file that comes with gcc, so configuring glibc
- # with a fresh cross-compiler works.
- # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- # <limits.h> exists even on freestanding compilers.
- # On the NeXT, cc -E runs the code through the compiler's parser,
- # not just through cpp. "Syntax error" is here to catch this case.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
- Syntax error
-_ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
-
-else
- # Broken: fails on valid input.
-continue
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-
- # OK, works on sane cases. Now check whether nonexistent headers
- # can be detected and how.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <ac_nonexistent.h>
-_ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
- # Broken: success on invalid input.
-continue
-else
- # Passes both tests.
-ac_preproc_ok=:
-break
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-
-done
-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.i conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then :
- break
-fi
-
- done
- ac_cv_prog_CPP=$CPP
-
-fi
- CPP=$ac_cv_prog_CPP
-else
- ac_cv_prog_CPP=$CPP
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
-$as_echo "$CPP" >&6; }
-ac_preproc_ok=false
-for ac_c_preproc_warn_flag in '' yes
-do
- # Use a header file that comes with gcc, so configuring glibc
- # with a fresh cross-compiler works.
- # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- # <limits.h> exists even on freestanding compilers.
- # On the NeXT, cc -E runs the code through the compiler's parser,
- # not just through cpp. "Syntax error" is here to catch this case.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
- Syntax error
-_ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
-
-else
- # Broken: fails on valid input.
-continue
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-
- # OK, works on sane cases. Now check whether nonexistent headers
- # can be detected and how.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <ac_nonexistent.h>
-_ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
- # Broken: success on invalid input.
-continue
-else
- # Passes both tests.
-ac_preproc_ok=:
-break
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-
-done
-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.i conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then :
-
-else
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
-See \`config.log' for more details" "$LINENO" 5; }
-fi
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for function prototypes" >&5
-$as_echo_n "checking for function prototypes... " >&6; }
-if test "$ac_cv_prog_cc_c89" != no; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-
-$as_echo "#define PROTOTYPES 1" >>confdefs.h
-
-
-$as_echo "#define __PROTOTYPES 1" >>confdefs.h
-
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-test "x$U" != "x" && as_fn_error $? "Compiler not ANSI compliant" "$LINENO" 5
-
-if test "x$CC" != xcc; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC and cc understand -c and -o together" >&5
-$as_echo_n "checking whether $CC and cc understand -c and -o together... " >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether cc understands -c and -o together" >&5
-$as_echo_n "checking whether cc understands -c and -o together... " >&6; }
-fi
-set dummy $CC; ac_cc=`$as_echo "$2" |
- sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'`
-if eval \${ac_cv_prog_cc_${ac_cc}_c_o+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-# Make sure it works both with $CC and with simple cc.
-# We do the test twice because some compilers refuse to overwrite an
-# existing .o file with -o, though they will create one.
-ac_try='$CC -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
-rm -f conftest2.*
-if { { case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } &&
- test -f conftest2.$ac_objext && { { case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; };
-then
- eval ac_cv_prog_cc_${ac_cc}_c_o=yes
- if test "x$CC" != xcc; then
- # Test first that cc exists at all.
- if { ac_try='cc -c conftest.$ac_ext >&5'
- { { case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; }; then
- ac_try='cc -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
- rm -f conftest2.*
- if { { case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } &&
- test -f conftest2.$ac_objext && { { case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; };
- then
- # cc works too.
- :
- else
- # cc exists but doesn't like -o.
- eval ac_cv_prog_cc_${ac_cc}_c_o=no
- fi
- fi
- fi
-else
- eval ac_cv_prog_cc_${ac_cc}_c_o=no
-fi
-rm -f core conftest*
-
-fi
-if eval test \$ac_cv_prog_cc_${ac_cc}_c_o = yes; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-
-$as_echo "#define NO_MINUS_C_MINUS_O 1" >>confdefs.h
-
-fi
-
-
-# Make sure we can run config.sub.
-$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
- as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
-$as_echo_n "checking build system type... " >&6; }
-if ${ac_cv_build+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_build_alias=$build_alias
-test "x$ac_build_alias" = x &&
- ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
-test "x$ac_build_alias" = x &&
- as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5
-ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
- as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
-$as_echo "$ac_cv_build" >&6; }
-case $ac_cv_build in
-*-*-*) ;;
-*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;;
-esac
-build=$ac_cv_build
-ac_save_IFS=$IFS; IFS='-'
-set x $ac_cv_build
-shift
-build_cpu=$1
-build_vendor=$2
-shift; shift
-# Remember, the first character of IFS is used to create $*,
-# except with old shells:
-build_os=$*
-IFS=$ac_save_IFS
-case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
-$as_echo_n "checking host system type... " >&6; }
-if ${ac_cv_host+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test "x$host_alias" = x; then
- ac_cv_host=$ac_cv_build
-else
- ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
- as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
-$as_echo "$ac_cv_host" >&6; }
-case $ac_cv_host in
-*-*-*) ;;
-*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;;
-esac
-host=$ac_cv_host
-ac_save_IFS=$IFS; IFS='-'
-set x $ac_cv_host
-shift
-host_cpu=$1
-host_vendor=$2
-shift; shift
-# Remember, the first character of IFS is used to create $*,
-# except with old shells:
-host_os=$*
-IFS=$ac_save_IFS
-case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
-
-
-
-DEBUG="-g"
-WARNINGS="-Wall -Werror"
-CFLAGS_FPIC="-fPIC"
-WIN32=no
-case "$host" in
- *-*-mingw*)
- WARNINGS="$WARNINGS -Wno-unused"
- CFLAGS_FPIC=""
- WIN32=yes
-esac
-
-
-
-
-
-
-# Check whether --with-libvirt was given.
-if test "${with_libvirt+set}" = set; then :
- withval=$with_libvirt; if test "x$withval" != "x"; then
- CFLAGS="$CFLAGS -I$withval/include"
- LDFLAGS="$LDFLAGS -L$withval/lib"
- fi
-
-fi
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for virConnectOpen in -lvirt" >&5
-$as_echo_n "checking for virConnectOpen in -lvirt... " >&6; }
-if ${ac_cv_lib_virt_virConnectOpen+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lvirt $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char virConnectOpen ();
-int
-main ()
-{
-return virConnectOpen ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_virt_virConnectOpen=yes
-else
- ac_cv_lib_virt_virConnectOpen=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_virt_virConnectOpen" >&5
-$as_echo "$ac_cv_lib_virt_virConnectOpen" >&6; }
-if test "x$ac_cv_lib_virt_virConnectOpen" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBVIRT 1
-_ACEOF
-
- LIBS="-lvirt $LIBS"
-
-else
- as_fn_error $? "You must install libvirt library" "$LINENO" 5
-fi
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
-$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
-if ${ac_cv_path_GREP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -z "$GREP"; then
- ac_path_GREP_found=false
- # Loop through the user's path and test for each of PROGNAME-LIST
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_prog in grep ggrep; do
- for ac_exec_ext in '' $ac_executable_extensions; do
- ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
- as_fn_executable_p "$ac_path_GREP" || continue
-# Check for GNU ac_path_GREP and select it if it is found.
- # Check for GNU $ac_path_GREP
-case `"$ac_path_GREP" --version 2>&1` in
-*GNU*)
- ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
-*)
- ac_count=0
- $as_echo_n 0123456789 >"conftest.in"
- while :
- do
- cat "conftest.in" "conftest.in" >"conftest.tmp"
- mv "conftest.tmp" "conftest.in"
- cp "conftest.in" "conftest.nl"
- $as_echo 'GREP' >> "conftest.nl"
- "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
- diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
- as_fn_arith $ac_count + 1 && ac_count=$as_val
- if test $ac_count -gt ${ac_path_GREP_max-0}; then
- # Best one so far, save it but keep looking for a better one
- ac_cv_path_GREP="$ac_path_GREP"
- ac_path_GREP_max=$ac_count
- fi
- # 10*(2^10) chars as input seems more than enough
- test $ac_count -gt 10 && break
- done
- rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
-esac
-
- $ac_path_GREP_found && break 3
- done
- done
- done
-IFS=$as_save_IFS
- if test -z "$ac_cv_path_GREP"; then
- as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
- fi
-else
- ac_cv_path_GREP=$GREP
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
-$as_echo "$ac_cv_path_GREP" >&6; }
- GREP="$ac_cv_path_GREP"
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
-$as_echo_n "checking for egrep... " >&6; }
-if ${ac_cv_path_EGREP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
- then ac_cv_path_EGREP="$GREP -E"
- else
- if test -z "$EGREP"; then
- ac_path_EGREP_found=false
- # Loop through the user's path and test for each of PROGNAME-LIST
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_prog in egrep; do
- for ac_exec_ext in '' $ac_executable_extensions; do
- ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
- as_fn_executable_p "$ac_path_EGREP" || continue
-# Check for GNU ac_path_EGREP and select it if it is found.
- # Check for GNU $ac_path_EGREP
-case `"$ac_path_EGREP" --version 2>&1` in
-*GNU*)
- ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
-*)
- ac_count=0
- $as_echo_n 0123456789 >"conftest.in"
- while :
- do
- cat "conftest.in" "conftest.in" >"conftest.tmp"
- mv "conftest.tmp" "conftest.in"
- cp "conftest.in" "conftest.nl"
- $as_echo 'EGREP' >> "conftest.nl"
- "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
- diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
- as_fn_arith $ac_count + 1 && ac_count=$as_val
- if test $ac_count -gt ${ac_path_EGREP_max-0}; then
- # Best one so far, save it but keep looking for a better one
- ac_cv_path_EGREP="$ac_path_EGREP"
- ac_path_EGREP_max=$ac_count
- fi
- # 10*(2^10) chars as input seems more than enough
- test $ac_count -gt 10 && break
- done
- rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
-esac
-
- $ac_path_EGREP_found && break 3
- done
- done
- done
-IFS=$as_save_IFS
- if test -z "$ac_cv_path_EGREP"; then
- as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
- fi
-else
- ac_cv_path_EGREP=$EGREP
-fi
-
- fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
-$as_echo "$ac_cv_path_EGREP" >&6; }
- EGREP="$ac_cv_path_EGREP"
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
-$as_echo_n "checking for ANSI C header files... " >&6; }
-if ${ac_cv_header_stdc+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <stdlib.h>
-#include <stdarg.h>
-#include <string.h>
-#include <float.h>
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_header_stdc=yes
-else
- ac_cv_header_stdc=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-if test $ac_cv_header_stdc = yes; then
- # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <string.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "memchr" >/dev/null 2>&1; then :
-
-else
- ac_cv_header_stdc=no
-fi
-rm -f conftest*
-
-fi
-
-if test $ac_cv_header_stdc = yes; then
- # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <stdlib.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "free" >/dev/null 2>&1; then :
-
-else
- ac_cv_header_stdc=no
-fi
-rm -f conftest*
-
-fi
-
-if test $ac_cv_header_stdc = yes; then
- # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
- if test "$cross_compiling" = yes; then :
- :
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <ctype.h>
-#include <stdlib.h>
-#if ((' ' & 0x0FF) == 0x020)
-# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
-# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
-#else
-# define ISLOWER(c) \
- (('a' <= (c) && (c) <= 'i') \
- || ('j' <= (c) && (c) <= 'r') \
- || ('s' <= (c) && (c) <= 'z'))
-# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
-#endif
-
-#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
-int
-main ()
-{
- int i;
- for (i = 0; i < 256; i++)
- if (XOR (islower (i), ISLOWER (i))
- || toupper (i) != TOUPPER (i))
- return 2;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-
-else
- ac_cv_header_stdc=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
-$as_echo "$ac_cv_header_stdc" >&6; }
-if test $ac_cv_header_stdc = yes; then
-
-$as_echo "#define STDC_HEADERS 1" >>confdefs.h
-
-fi
-
-# On IRIX 5.3, sys/types and inttypes.h are conflicting.
-for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
- inttypes.h stdint.h unistd.h
-do :
- as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
-"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
- cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-
-ac_fn_c_check_header_mongrel "$LINENO" "libvirt/libvirt.h" "ac_cv_header_libvirt_libvirt_h" "$ac_includes_default"
-if test "x$ac_cv_header_libvirt_libvirt_h" = xyes; then :
-
-else
- as_fn_error $? "You must install libvirt development package" "$LINENO" 5
-fi
-
-
-
-ac_fn_c_check_header_mongrel "$LINENO" "libvirt/virterror.h" "ac_cv_header_libvirt_virterror_h" "$ac_includes_default"
-if test "x$ac_cv_header_libvirt_virterror_h" = xyes; then :
-
-else
- as_fn_error $? "You must install libvirt development package" "$LINENO" 5
-fi
-
-
-
-# checking for ocamlc
-# Extract the first word of "ocamlc", so it can be a program name with args.
-set dummy ocamlc; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_OCAMLC+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$OCAMLC"; then
- ac_cv_prog_OCAMLC="$OCAMLC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_OCAMLC="ocamlc"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
- test -z "$ac_cv_prog_OCAMLC" && ac_cv_prog_OCAMLC="as_fn_error $? "Cannot find ocamlc." "$LINENO" 5"
-fi
-fi
-OCAMLC=$ac_cv_prog_OCAMLC
-if test -n "$OCAMLC"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLC" >&5
-$as_echo "$OCAMLC" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-OCAMLVERSION=`$OCAMLC -v | sed -n -e 's|.*version* *\(.*\)$|\1|p' `
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: OCaml version is $OCAMLVERSION" >&5
-$as_echo "OCaml version is $OCAMLVERSION" >&6; }
-OCAMLLIB=`$OCAMLC -where 2>/dev/null || $OCAMLC -v|tail -1|cut -d ' ' -f 4`
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: OCaml library path is $OCAMLLIB" >&5
-$as_echo "OCaml library path is $OCAMLLIB" >&6; }
-# checking for ocamlopt
-# Extract the first word of "ocamlopt", so it can be a program name with args.
-set dummy ocamlopt; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_OCAMLOPT+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$OCAMLOPT"; then
- ac_cv_prog_OCAMLOPT="$OCAMLOPT" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_OCAMLOPT="ocamlopt"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-OCAMLOPT=$ac_cv_prog_OCAMLOPT
-if test -n "$OCAMLOPT"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLOPT" >&5
-$as_echo "$OCAMLOPT" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-OCAMLBEST=byte
-if test -z "$OCAMLOPT"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Cannot find ocamlopt; bytecode compilation only." >&5
-$as_echo "$as_me: WARNING: Cannot find ocamlopt; bytecode compilation only." >&2;}
-else
- TMPVERSION=`$OCAMLOPT -v | sed -n -e 's|.*version* *\(.*\)$|\1|p' `
- if test "$TMPVERSION" != "$OCAMLVERSION" ; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: versions differs from ocamlc; ocamlopt discarded." >&5
-$as_echo "versions differs from ocamlc; ocamlopt discarded." >&6; }
- unset OCAMLOPT
- else
- OCAMLBEST=opt
- fi
-fi
-# checking for ocamlc.opt
-# Extract the first word of "ocamlc.opt", so it can be a program name with args.
-set dummy ocamlc.opt; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_OCAMLCDOTOPT+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$OCAMLCDOTOPT"; then
- ac_cv_prog_OCAMLCDOTOPT="$OCAMLCDOTOPT" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_OCAMLCDOTOPT="ocamlc.opt"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-OCAMLCDOTOPT=$ac_cv_prog_OCAMLCDOTOPT
-if test -n "$OCAMLCDOTOPT"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLCDOTOPT" >&5
-$as_echo "$OCAMLCDOTOPT" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-if test -z "$OCAMLCDOTOPT"; then
- TMPVERSION=`$OCAMLCDOTOPT -v | sed -n -e 's|.*version* *\(.*\)$|\1|p' `
- if test "$TMPVERSION" != "$OCAMLVERSION" ; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: versions differs from ocamlc; ocamlc.opt discarded." >&5
-$as_echo "versions differs from ocamlc; ocamlc.opt discarded." >&6; }
- else
- OCAMLC=$OCAMLCDOTOPT
- fi
-fi
-# checking for ocamlopt.opt
-if test "$OCAMLOPT" ; then
- # Extract the first word of "ocamlopt.opt", so it can be a program name with args.
-set dummy ocamlopt.opt; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_OCAMLOPTDOTOPT+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$OCAMLOPTDOTOPT"; then
- ac_cv_prog_OCAMLOPTDOTOPT="$OCAMLOPTDOTOPT" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_OCAMLOPTDOTOPT="ocamlopt.opt"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-OCAMLOPTDOTOPT=$ac_cv_prog_OCAMLOPTDOTOPT
-if test -n "$OCAMLOPTDOTOPT"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLOPTDOTOPT" >&5
-$as_echo "$OCAMLOPTDOTOPT" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- if test "$OCAMLOPTDOTOPT"; then
- TMPVER=`$OCAMLOPTDOTOPT -v | sed -n -e 's|.*version* *\(.*\)$|\1|p' `
- if test "$TMPVER" != "$OCAMLVERSION" ; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: version differs from ocamlc; ocamlopt.opt discarded." >&5
-$as_echo "version differs from ocamlc; ocamlopt.opt discarded." >&6; }
- else
- OCAMLOPT=$OCAMLOPTDOTOPT
- fi
- fi
-fi
-# checking for ocamldep
-# Extract the first word of "ocamldep", so it can be a program name with args.
-set dummy ocamldep; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_OCAMLDEP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$OCAMLDEP"; then
- ac_cv_prog_OCAMLDEP="$OCAMLDEP" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_OCAMLDEP="ocamldep"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
- test -z "$ac_cv_prog_OCAMLDEP" && ac_cv_prog_OCAMLDEP="as_fn_error $? "Cannot find ocamldep." "$LINENO" 5"
-fi
-fi
-OCAMLDEP=$ac_cv_prog_OCAMLDEP
-if test -n "$OCAMLDEP"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLDEP" >&5
-$as_echo "$OCAMLDEP" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-
-#checking for ocamlmktop
-# Extract the first word of "ocamlmktop", so it can be a program name with args.
-set dummy ocamlmktop; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_OCAMLMKTOP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$OCAMLMKTOP"; then
- ac_cv_prog_OCAMLMKTOP="$OCAMLMKTOP" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_OCAMLMKTOP="ocamlmktop"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
- test -z "$ac_cv_prog_OCAMLMKTOP" && ac_cv_prog_OCAMLMKTOP="{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Cannot find ocamlmktop." >&5
-$as_echo "$as_me: WARNING: Cannot find ocamlmktop." >&2;}"
-fi
-fi
-OCAMLMKTOP=$ac_cv_prog_OCAMLMKTOP
-if test -n "$OCAMLMKTOP"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLMKTOP" >&5
-$as_echo "$OCAMLMKTOP" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-#checking for ocamlmklib
-# Extract the first word of "ocamlmklib", so it can be a program name with args.
-set dummy ocamlmklib; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_OCAMLMKLIB+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$OCAMLMKLIB"; then
- ac_cv_prog_OCAMLMKLIB="$OCAMLMKLIB" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_OCAMLMKLIB="ocamlmklib"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
- test -z "$ac_cv_prog_OCAMLMKLIB" && ac_cv_prog_OCAMLMKLIB="{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Cannot find ocamlmklib." >&5
-$as_echo "$as_me: WARNING: Cannot find ocamlmklib." >&2;}"
-fi
-fi
-OCAMLMKLIB=$ac_cv_prog_OCAMLMKLIB
-if test -n "$OCAMLMKLIB"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLMKLIB" >&5
-$as_echo "$OCAMLMKLIB" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-# checking for ocamldoc
-# Extract the first word of "ocamldoc", so it can be a program name with args.
-set dummy ocamldoc; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_OCAMLDOC+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$OCAMLDOC"; then
- ac_cv_prog_OCAMLDOC="$OCAMLDOC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_OCAMLDOC="ocamldoc"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
- test -z "$ac_cv_prog_OCAMLDOC" && ac_cv_prog_OCAMLDOC="{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Cannot find ocamldoc." >&5
-$as_echo "$as_me: WARNING: Cannot find ocamldoc." >&2;}"
-fi
-fi
-OCAMLDOC=$ac_cv_prog_OCAMLDOC
-if test -n "$OCAMLDOC"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLDOC" >&5
-$as_echo "$OCAMLDOC" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-
-
-
-
-
-
-
-
-
-
-
-# checking for ocamlfind
-# Extract the first word of "ocamlfind", so it can be a program name with args.
-set dummy ocamlfind; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_OCAMLFIND+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$OCAMLFIND"; then
- ac_cv_prog_OCAMLFIND="$OCAMLFIND" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_OCAMLFIND="ocamlfind"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
- test -z "$ac_cv_prog_OCAMLFIND" && ac_cv_prog_OCAMLFIND="{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ocamlfind not found" >&5
-$as_echo "$as_me: WARNING: ocamlfind not found" >&2;}"
-fi
-fi
-OCAMLFIND=$ac_cv_prog_OCAMLFIND
-if test -n "$OCAMLFIND"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLFIND" >&5
-$as_echo "$OCAMLFIND" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-
-
-
-if test "x$OCAMLFIND" = "x"; then
- as_fn_error $? "OCaml findlib is required" "$LINENO" 5
-fi
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking findlib package unix" >&5
-$as_echo_n "checking findlib package unix... " >&6; }
-if $OCAMLFIND query unix >/dev/null 2>/dev/null; then
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5
-$as_echo "found" >&6; }
-eval "pkg_`echo unix | tr - _`=yes"
-else
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5
-$as_echo "not found" >&6; }
-eval "pkg_`echo unix | tr - _`=no"
-fi
-
-if test "x$pkg_unix" != "xyes"; then
- as_fn_error $? "Cannot find required OCaml package 'unix'" "$LINENO" 5
-fi
-
-
-# Check whether --with-nsis was given.
-if test "${with_nsis+set}" = set; then :
- withval=$with_nsis;
-else
- with_nsis=no
-fi
-
-
-MAKENSIS=
-LIBVIRT_DLL_PATH=
-LIBXDR_DLL_PATH=
-LIBXML2_DLL_PATH=
-GNUTLS_DLL_PATH=
-GTK_PATH=
-GTK_DLL_PATH=
-
-
-msys_to_win_dir () {
- eval pushd "\$$1" > /dev/null
- eval $1=`pwd -W`
- popd > /dev/null
-}
-
-
-if test "x$with_nsis" != "xno"; then
- # Extract the first word of "makensis", so it can be a program name with args.
-set dummy makensis; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_MAKENSIS+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- case $MAKENSIS in
- [\\/]* | ?:[\\/]*)
- ac_cv_path_MAKENSIS="$MAKENSIS" # Let the user override the test with a path.
- ;;
- *)
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-as_dummy="$with_nsis:$PATH"
-for as_dir in $as_dummy
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_path_MAKENSIS="$as_dir/$ac_word$ac_exec_ext"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
- ;;
-esac
-fi
-MAKENSIS=$ac_cv_path_MAKENSIS
-if test -n "$MAKENSIS"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAKENSIS" >&5
-$as_echo "$MAKENSIS" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- if test "x$MAKENSIS" = "x"; then
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "--with-nsis was given, but could not find MAKENSIS.EXE
-See \`config.log' for more details" "$LINENO" 5; }
- fi
-
- # MAKENSIS is set so we will build a rule for making a Windows
- # installer. To support this, generate wininstaller.nsis.
- saved_IFS=$IFS
- IFS=$PATH_SEPARATOR
- for d in $PATH; do
- IFS=$saved_IFS
- echo Checking $d for DLLs ... >&5
- if test -f "$d/libvirt-0.dll"; then
- LIBVIRT_DLL_PATH="$d"
- fi
- if test -f "$d/libxdr.dll"; then
- LIBXDR_DLL_PATH="$d"
- fi
- if test -f "$d/libxml2-2.dll"; then
- LIBXML2_DLL_PATH="$d"
- fi
- if test -f "$d/libgpg-error-0.dll"; then
- GNUTLS_DLL_PATH="$d"
- fi
- if test -f "$d/libgtk-win32-2.0-0.dll"; then
- GTK_DLL_PATH="$d"
- GTK_PATH="$d/.."
- fi
- done
- IFS=$saved_IFS
-
- if test "x$LIBVIRT_DLL_PATH" = "x"; then
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "cannot find libvirt-0.dll in PATH
-See \`config.log' for more details" "$LINENO" 5; }
- fi
- if test "x$LIBXDR_DLL_PATH" = "x"; then
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "cannot find libxdr.dll in PATH
-See \`config.log' for more details" "$LINENO" 5; }
- fi
- if test "x$LIBXML2_DLL_PATH" = "x"; then
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "cannot find libxml2-2.dll in PATH
-See \`config.log' for more details" "$LINENO" 5; }
- fi
- if test "x$GNUTLS_DLL_PATH" = "x"; then
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "cannot find GnuTLS DLLs in PATH
-See \`config.log' for more details" "$LINENO" 5; }
- fi
- if test "x$GTK_DLL_PATH" = "x"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cannot find GTK DLLs in PATH" >&5
-$as_echo "$as_me: WARNING: cannot find GTK DLLs in PATH" >&2;}
- fi
-
- # Change the paths to Windows paths.
- msys_to_win_dir LIBVIRT_DLL_PATH
- msys_to_win_dir LIBXDR_DLL_PATH
- msys_to_win_dir LIBXML2_DLL_PATH
- msys_to_win_dir GNUTLS_DLL_PATH
- if test "x$GTK_DLL_PATH" != "x"; then
- msys_to_win_dir GTK_DLL_PATH
- msys_to_win_dir GTK_PATH
- fi
-fi
-
-
-
-
-
-
-
-
-echo "------------------------------------------------------------"
-echo "Thanks for downloading" $PACKAGE_STRING
-echo "------------------------------------------------------------"
-
-ac_config_headers="$ac_config_headers config.h"
-
-ac_config_files="$ac_config_files META libvirt/libvirt_version.ml Makefile Make.rules libvirt/Makefile examples/Makefile"
-
-if test "x$MAKENSIS" != "x"; then
- ac_config_files="$ac_config_files wininstaller.nsis"
-
-fi
-cat >confcache <<\_ACEOF
-# This file is a shell script that caches the results of configure
-# tests run on this system so they can be shared between configure
-# scripts and configure runs, see configure's option --config-cache.
-# It is not useful on other systems. If it contains results you don't
-# want to keep, you may remove or edit it.
-#
-# config.status only pays attention to the cache file if you give it
-# the --recheck option to rerun configure.
-#
-# `ac_cv_env_foo' variables (set or unset) will be overridden when
-# loading this file, other *unset* `ac_cv_foo' will be assigned the
-# following values.
-
-_ACEOF
-
-# The following way of writing the cache mishandles newlines in values,
-# but we know of no workaround that is simple, portable, and efficient.
-# So, we kill variables containing newlines.
-# Ultrix sh set writes to stderr and can't be redirected directly,
-# and sets the high bit in the cache file unless we assign to the vars.
-(
- for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
- eval ac_val=\$$ac_var
- case $ac_val in #(
- *${as_nl}*)
- case $ac_var in #(
- *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
-$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
- esac
- case $ac_var in #(
- _ | IFS | as_nl) ;; #(
- BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
- *) { eval $ac_var=; unset $ac_var;} ;;
- esac ;;
- esac
- done
-
- (set) 2>&1 |
- case $as_nl`(ac_space=' '; set) 2>&1` in #(
- *${as_nl}ac_space=\ *)
- # `set' does not quote correctly, so add quotes: double-quote
- # substitution turns \\\\ into \\, and sed turns \\ into \.
- sed -n \
- "s/'/'\\\\''/g;
- s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
- ;; #(
- *)
- # `set' quotes correctly as required by POSIX, so do not add quotes.
- sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
- ;;
- esac |
- sort
-) |
- sed '
- /^ac_cv_env_/b end
- t clear
- :clear
- s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
- t end
- s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
- :end' >>confcache
-if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
- if test -w "$cache_file"; then
- if test "x$cache_file" != "x/dev/null"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
-$as_echo "$as_me: updating cache $cache_file" >&6;}
- if test ! -f "$cache_file" || test -h "$cache_file"; then
- cat confcache >"$cache_file"
- else
- case $cache_file in #(
- */* | ?:*)
- mv -f confcache "$cache_file"$$ &&
- mv -f "$cache_file"$$ "$cache_file" ;; #(
- *)
- mv -f confcache "$cache_file" ;;
- esac
- fi
- fi
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
-$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
- fi
-fi
-rm -f confcache
-
-test "x$prefix" = xNONE && prefix=$ac_default_prefix
-# Let make expand exec_prefix.
-test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
-
-DEFS=-DHAVE_CONFIG_H
-
-ac_libobjs=
-ac_ltlibobjs=
-U=
-for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
- # 1. Remove the extension, and $U if already installed.
- ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
- ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
- # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR
- # will be set to the directory where LIBOBJS objects are built.
- as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"
- as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo'
-done
-LIBOBJS=$ac_libobjs
-
-LTLIBOBJS=$ac_ltlibobjs
-
-
-
-: "${CONFIG_STATUS=./config.status}"
-ac_write_fail=0
-ac_clean_files_save=$ac_clean_files
-ac_clean_files="$ac_clean_files $CONFIG_STATUS"
-{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
-$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
-as_write_fail=0
-cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
-#! $SHELL
-# Generated by $as_me.
-# Run this file to recreate the current configuration.
-# Compiler output produced by configure, useful for debugging
-# configure, is in config.log if it exists.
-
-debug=false
-ac_cs_recheck=false
-ac_cs_silent=false
-
-SHELL=\${CONFIG_SHELL-$SHELL}
-export SHELL
-_ASEOF
-cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1
-## -------------------- ##
-## M4sh Initialization. ##
-## -------------------- ##
-
-# Be more Bourne compatible
-DUALCASE=1; export DUALCASE # for MKS sh
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
- emulate sh
- NULLCMD=:
- # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
- # is contrary to our usage. Disable this feature.
- alias -g '${1+"$@"}'='"$@"'
- setopt NO_GLOB_SUBST
-else
- case `(set -o) 2>/dev/null` in #(
- *posix*) :
- set -o posix ;; #(
- *) :
- ;;
-esac
-fi
-
-
-as_nl='
-'
-export as_nl
-# Printing a long string crashes Solaris 7 /usr/bin/printf.
-as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
-as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
-as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
-# Prefer a ksh shell builtin over an external printf program on Solaris,
-# but without wasting forks for bash or zsh.
-if test -z "$BASH_VERSION$ZSH_VERSION" \
- && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
- as_echo='print -r --'
- as_echo_n='print -rn --'
-elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
- as_echo='printf %s\n'
- as_echo_n='printf %s'
-else
- if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
- as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
- as_echo_n='/usr/ucb/echo -n'
- else
- as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
- as_echo_n_body='eval
- arg=$1;
- case $arg in #(
- *"$as_nl"*)
- expr "X$arg" : "X\\(.*\\)$as_nl";
- arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
- esac;
- expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
- '
- export as_echo_n_body
- as_echo_n='sh -c $as_echo_n_body as_echo'
- fi
- export as_echo_body
- as_echo='sh -c $as_echo_body as_echo'
-fi
-
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
- PATH_SEPARATOR=:
- (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
- (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
- PATH_SEPARATOR=';'
- }
-fi
-
-
-# IFS
-# We need space, tab and new line, in precisely that order. Quoting is
-# there to prevent editors from complaining about space-tab.
-# (If _AS_PATH_WALK were called with IFS unset, it would disable word
-# splitting by setting IFS to empty value.)
-IFS=" "" $as_nl"
-
-# Find who we are. Look in the path if we contain no directory separator.
-as_myself=
-case $0 in #((
- *[\\/]* ) as_myself=$0 ;;
- *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
- done
-IFS=$as_save_IFS
-
- ;;
-esac
-# We did not find ourselves, most probably we were run as `sh COMMAND'
-# in which case we are not to be found in the path.
-if test "x$as_myself" = x; then
- as_myself=$0
-fi
-if test ! -f "$as_myself"; then
- $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
- exit 1
-fi
-
-# Unset variables that we do not need and which cause bugs (e.g. in
-# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
-# suppresses any "Segmentation fault" message there. '((' could
-# trigger a bug in pdksh 5.2.14.
-for as_var in BASH_ENV ENV MAIL MAILPATH
-do eval test x\${$as_var+set} = xset \
- && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
-done
-PS1='$ '
-PS2='> '
-PS4='+ '
-
-# NLS nuisances.
-LC_ALL=C
-export LC_ALL
-LANGUAGE=C
-export LANGUAGE
-
-# CDPATH.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-
-
-# as_fn_error STATUS ERROR [LINENO LOG_FD]
-# ----------------------------------------
-# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
-# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
-# script with STATUS, using 1 if that was 0.
-as_fn_error ()
-{
- as_status=$1; test $as_status -eq 0 && as_status=1
- if test "$4"; then
- as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
- fi
- $as_echo "$as_me: error: $2" >&2
- as_fn_exit $as_status
-} # as_fn_error
-
-
-# as_fn_set_status STATUS
-# -----------------------
-# Set $? to STATUS, without forking.
-as_fn_set_status ()
-{
- return $1
-} # as_fn_set_status
-
-# as_fn_exit STATUS
-# -----------------
-# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
-as_fn_exit ()
-{
- set +e
- as_fn_set_status $1
- exit $1
-} # as_fn_exit
-
-# as_fn_unset VAR
-# ---------------
-# Portably unset VAR.
-as_fn_unset ()
-{
- { eval $1=; unset $1;}
-}
-as_unset=as_fn_unset
-# as_fn_append VAR VALUE
-# ----------------------
-# Append the text in VALUE to the end of the definition contained in VAR. Take
-# advantage of any shell optimizations that allow amortized linear growth over
-# repeated appends, instead of the typical quadratic growth present in naive
-# implementations.
-if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
- eval 'as_fn_append ()
- {
- eval $1+=\$2
- }'
-else
- as_fn_append ()
- {
- eval $1=\$$1\$2
- }
-fi # as_fn_append
-
-# as_fn_arith ARG...
-# ------------------
-# Perform arithmetic evaluation on the ARGs, and store the result in the
-# global $as_val. Take advantage of shells that can avoid forks. The arguments
-# must be portable across $(()) and expr.
-if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
- eval 'as_fn_arith ()
- {
- as_val=$(( $* ))
- }'
-else
- as_fn_arith ()
- {
- as_val=`expr "$@" || test $? -eq 1`
- }
-fi # as_fn_arith
-
-
-if expr a : '\(a\)' >/dev/null 2>&1 &&
- test "X`expr 00001 : '.*\(...\)'`" = X001; then
- as_expr=expr
-else
- as_expr=false
-fi
-
-if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
- as_basename=basename
-else
- as_basename=false
-fi
-
-if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
- as_dirname=dirname
-else
- as_dirname=false
-fi
-
-as_me=`$as_basename -- "$0" ||
-$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
- X"$0" : 'X\(//\)$' \| \
- X"$0" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X/"$0" |
- sed '/^.*\/\([^/][^/]*\)\/*$/{
- s//\1/
- q
- }
- /^X\/\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\/\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
-
-# Avoid depending upon Character Ranges.
-as_cr_letters='abcdefghijklmnopqrstuvwxyz'
-as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
-as_cr_Letters=$as_cr_letters$as_cr_LETTERS
-as_cr_digits='0123456789'
-as_cr_alnum=$as_cr_Letters$as_cr_digits
-
-ECHO_C= ECHO_N= ECHO_T=
-case `echo -n x` in #(((((
--n*)
- case `echo 'xy\c'` in
- *c*) ECHO_T=' ';; # ECHO_T is single tab character.
- xy) ECHO_C='\c';;
- *) echo `echo ksh88 bug on AIX 6.1` > /dev/null
- ECHO_T=' ';;
- esac;;
-*)
- ECHO_N='-n';;
-esac
-
-rm -f conf$$ conf$$.exe conf$$.file
-if test -d conf$$.dir; then
- rm -f conf$$.dir/conf$$.file
-else
- rm -f conf$$.dir
- mkdir conf$$.dir 2>/dev/null
-fi
-if (echo >conf$$.file) 2>/dev/null; then
- if ln -s conf$$.file conf$$ 2>/dev/null; then
- as_ln_s='ln -s'
- # ... but there are two gotchas:
- # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
- # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
- # In both cases, we have to default to `cp -pR'.
- ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
- as_ln_s='cp -pR'
- elif ln conf$$.file conf$$ 2>/dev/null; then
- as_ln_s=ln
- else
- as_ln_s='cp -pR'
- fi
-else
- as_ln_s='cp -pR'
-fi
-rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
-rmdir conf$$.dir 2>/dev/null
-
-
-# as_fn_mkdir_p
-# -------------
-# Create "$as_dir" as a directory, including parents if necessary.
-as_fn_mkdir_p ()
-{
-
- case $as_dir in #(
- -*) as_dir=./$as_dir;;
- esac
- test -d "$as_dir" || eval $as_mkdir_p || {
- as_dirs=
- while :; do
- case $as_dir in #(
- *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
- *) as_qdir=$as_dir;;
- esac
- as_dirs="'$as_qdir' $as_dirs"
- as_dir=`$as_dirname -- "$as_dir" ||
-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$as_dir" : 'X\(//\)[^/]' \| \
- X"$as_dir" : 'X\(//\)$' \| \
- X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$as_dir" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
- test -d "$as_dir" && break
- done
- test -z "$as_dirs" || eval "mkdir $as_dirs"
- } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
-
-
-} # as_fn_mkdir_p
-if mkdir -p . 2>/dev/null; then
- as_mkdir_p='mkdir -p "$as_dir"'
-else
- test -d ./-p && rmdir ./-p
- as_mkdir_p=false
-fi
-
-
-# as_fn_executable_p FILE
-# -----------------------
-# Test if FILE is an executable regular file.
-as_fn_executable_p ()
-{
- test -f "$1" && test -x "$1"
-} # as_fn_executable_p
-as_test_x='test -x'
-as_executable_p=as_fn_executable_p
-
-# Sed expression to map a string onto a valid CPP name.
-as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
-
-# Sed expression to map a string onto a valid variable name.
-as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
-
-
-exec 6>&1
-## ----------------------------------- ##
-## Main body of $CONFIG_STATUS script. ##
-## ----------------------------------- ##
-_ASEOF
-test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1
-
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-# Save the log message, to keep $0 and so on meaningful, and to
-# report actual input values of CONFIG_FILES etc. instead of their
-# values after options handling.
-ac_log="
-This file was extended by ocaml-libvirt $as_me 0.6.1.4, which was
-generated by GNU Autoconf 2.69. Invocation command line was
-
- CONFIG_FILES = $CONFIG_FILES
- CONFIG_HEADERS = $CONFIG_HEADERS
- CONFIG_LINKS = $CONFIG_LINKS
- CONFIG_COMMANDS = $CONFIG_COMMANDS
- $ $0 $@
-
-on `(hostname || uname -n) 2>/dev/null | sed 1q`
-"
-
-_ACEOF
-
-case $ac_config_files in *"
-"*) set x $ac_config_files; shift; ac_config_files=$*;;
-esac
-
-case $ac_config_headers in *"
-"*) set x $ac_config_headers; shift; ac_config_headers=$*;;
-esac
-
-
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-# Files that config.status was made for.
-config_files="$ac_config_files"
-config_headers="$ac_config_headers"
-
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-ac_cs_usage="\
-\`$as_me' instantiates files and other configuration actions
-from templates according to the current configuration. Unless the files
-and actions are specified as TAGs, all are instantiated by default.
-
-Usage: $0 [OPTION]... [TAG]...
-
- -h, --help print this help, then exit
- -V, --version print version number and configuration settings, then exit
- --config print configuration, then exit
- -q, --quiet, --silent
- do not print progress messages
- -d, --debug don't remove temporary files
- --recheck update $as_me by reconfiguring in the same conditions
- --file=FILE[:TEMPLATE]
- instantiate the configuration file FILE
- --header=FILE[:TEMPLATE]
- instantiate the configuration header FILE
-
-Configuration files:
-$config_files
-
-Configuration headers:
-$config_headers
-
-Report bugs to the package provider."
-
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
-ac_cs_version="\\
-ocaml-libvirt config.status 0.6.1.4
-configured by $0, generated by GNU Autoconf 2.69,
- with options \\"\$ac_cs_config\\"
-
-Copyright (C) 2012 Free Software Foundation, Inc.
-This config.status script is free software; the Free Software Foundation
-gives unlimited permission to copy, distribute and modify it."
-
-ac_pwd='$ac_pwd'
-srcdir='$srcdir'
-INSTALL='$INSTALL'
-test -n "\$AWK" || AWK=awk
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-# The default lists apply if the user does not specify any file.
-ac_need_defaults=:
-while test $# != 0
-do
- case $1 in
- --*=?*)
- ac_option=`expr "X$1" : 'X\([^=]*\)='`
- ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
- ac_shift=:
- ;;
- --*=)
- ac_option=`expr "X$1" : 'X\([^=]*\)='`
- ac_optarg=
- ac_shift=:
- ;;
- *)
- ac_option=$1
- ac_optarg=$2
- ac_shift=shift
- ;;
- esac
-
- case $ac_option in
- # Handling of the options.
- -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
- ac_cs_recheck=: ;;
- --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
- $as_echo "$ac_cs_version"; exit ;;
- --config | --confi | --conf | --con | --co | --c )
- $as_echo "$ac_cs_config"; exit ;;
- --debug | --debu | --deb | --de | --d | -d )
- debug=: ;;
- --file | --fil | --fi | --f )
- $ac_shift
- case $ac_optarg in
- *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
- '') as_fn_error $? "missing file argument" ;;
- esac
- as_fn_append CONFIG_FILES " '$ac_optarg'"
- ac_need_defaults=false;;
- --header | --heade | --head | --hea )
- $ac_shift
- case $ac_optarg in
- *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
- esac
- as_fn_append CONFIG_HEADERS " '$ac_optarg'"
- ac_need_defaults=false;;
- --he | --h)
- # Conflict between --help and --header
- as_fn_error $? "ambiguous option: \`$1'
-Try \`$0 --help' for more information.";;
- --help | --hel | -h )
- $as_echo "$ac_cs_usage"; exit ;;
- -q | -quiet | --quiet | --quie | --qui | --qu | --q \
- | -silent | --silent | --silen | --sile | --sil | --si | --s)
- ac_cs_silent=: ;;
-
- # This is an error.
- -*) as_fn_error $? "unrecognized option: \`$1'
-Try \`$0 --help' for more information." ;;
-
- *) as_fn_append ac_config_targets " $1"
- ac_need_defaults=false ;;
-
- esac
- shift
-done
-
-ac_configure_extra_args=
-
-if $ac_cs_silent; then
- exec 6>/dev/null
- ac_configure_extra_args="$ac_configure_extra_args --silent"
-fi
-
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-if \$ac_cs_recheck; then
- set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
- shift
- \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
- CONFIG_SHELL='$SHELL'
- export CONFIG_SHELL
- exec "\$@"
-fi
-
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-exec 5>>config.log
-{
- echo
- sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
-## Running $as_me. ##
-_ASBOX
- $as_echo "$ac_log"
-} >&5
-
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-
-# Handling of arguments.
-for ac_config_target in $ac_config_targets
-do
- case $ac_config_target in
- "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
- "META") CONFIG_FILES="$CONFIG_FILES META" ;;
- "libvirt/libvirt_version.ml") CONFIG_FILES="$CONFIG_FILES libvirt/libvirt_version.ml" ;;
- "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
- "Make.rules") CONFIG_FILES="$CONFIG_FILES Make.rules" ;;
- "libvirt/Makefile") CONFIG_FILES="$CONFIG_FILES libvirt/Makefile" ;;
- "examples/Makefile") CONFIG_FILES="$CONFIG_FILES examples/Makefile" ;;
- "wininstaller.nsis") CONFIG_FILES="$CONFIG_FILES wininstaller.nsis" ;;
-
- *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
- esac
-done
-
-
-# If the user did not use the arguments to specify the items to instantiate,
-# then the envvar interface is used. Set only those that are not.
-# We use the long form for the default assignment because of an extremely
-# bizarre bug on SunOS 4.1.3.
-if $ac_need_defaults; then
- test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
- test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
-fi
-
-# Have a temporary directory for convenience. Make it in the build tree
-# simply because there is no reason against having it here, and in addition,
-# creating and moving files from /tmp can sometimes cause problems.
-# Hook for its removal unless debugging.
-# Note that there is a small window in which the directory will not be cleaned:
-# after its creation but before its name has been assigned to `$tmp'.
-$debug ||
-{
- tmp= ac_tmp=
- trap 'exit_status=$?
- : "${ac_tmp:=$tmp}"
- { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
-' 0
- trap 'as_fn_exit 1' 1 2 13 15
-}
-# Create a (secure) tmp directory for tmp files.
-
-{
- tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
- test -d "$tmp"
-} ||
-{
- tmp=./conf$$-$RANDOM
- (umask 077 && mkdir "$tmp")
-} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
-ac_tmp=$tmp
-
-# Set up the scripts for CONFIG_FILES section.
-# No need to generate them if there are no CONFIG_FILES.
-# This happens for instance with `./config.status config.h'.
-if test -n "$CONFIG_FILES"; then
-
-
-ac_cr=`echo X | tr X '\015'`
-# On cygwin, bash can eat \r inside `` if the user requested igncr.
-# But we know of no other shell where ac_cr would be empty at this
-# point, so we can use a bashism as a fallback.
-if test "x$ac_cr" = x; then
- eval ac_cr=\$\'\\r\'
-fi
-ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
-if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
- ac_cs_awk_cr='\\r'
-else
- ac_cs_awk_cr=$ac_cr
-fi
-
-echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
-_ACEOF
-
-
-{
- echo "cat >conf$$subs.awk <<_ACEOF" &&
- echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
- echo "_ACEOF"
-} >conf$$subs.sh ||
- as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
-ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'`
-ac_delim='%!_!# '
-for ac_last_try in false false false false false :; do
- . ./conf$$subs.sh ||
- as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
-
- ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
- if test $ac_delim_n = $ac_delim_num; then
- break
- elif $ac_last_try; then
- as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
- else
- ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
- fi
-done
-rm -f conf$$subs.sh
-
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&
-_ACEOF
-sed -n '
-h
-s/^/S["/; s/!.*/"]=/
-p
-g
-s/^[^!]*!//
-:repl
-t repl
-s/'"$ac_delim"'$//
-t delim
-:nl
-h
-s/\(.\{148\}\)..*/\1/
-t more1
-s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
-p
-n
-b repl
-:more1
-s/["\\]/\\&/g; s/^/"/; s/$/"\\/
-p
-g
-s/.\{148\}//
-t nl
-:delim
-h
-s/\(.\{148\}\)..*/\1/
-t more2
-s/["\\]/\\&/g; s/^/"/; s/$/"/
-p
-b
-:more2
-s/["\\]/\\&/g; s/^/"/; s/$/"\\/
-p
-g
-s/.\{148\}//
-t delim
-' <conf$$subs.awk | sed '
-/^[^""]/{
- N
- s/\n//
-}
-' >>$CONFIG_STATUS || ac_write_fail=1
-rm -f conf$$subs.awk
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-_ACAWK
-cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
- for (key in S) S_is_set[key] = 1
- FS = ""
-
-}
-{
- line = $ 0
- nfields = split(line, field, "@")
- substed = 0
- len = length(field[1])
- for (i = 2; i < nfields; i++) {
- key = field[i]
- keylen = length(key)
- if (S_is_set[key]) {
- value = S[key]
- line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
- len += length(value) + length(field[++i])
- substed = 1
- } else
- len += 1 + keylen
- }
-
- print line
-}
-
-_ACAWK
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
- sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
-else
- cat
-fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
- || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
-_ACEOF
-
-# VPATH may cause trouble with some makes, so we remove sole $(srcdir),
-# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and
-# trailing colons and then remove the whole line if VPATH becomes empty
-# (actually we leave an empty line to preserve line numbers).
-if test "x$srcdir" = x.; then
- ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{
-h
-s///
-s/^/:/
-s/[ ]*$/:/
-s/:\$(srcdir):/:/g
-s/:\${srcdir}:/:/g
-s/:@srcdir@:/:/g
-s/^:*//
-s/:*$//
-x
-s/\(=[ ]*\).*/\1/
-G
-s/\n//
-s/^[^=]*=[ ]*$//
-}'
-fi
-
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-fi # test -n "$CONFIG_FILES"
-
-# Set up the scripts for CONFIG_HEADERS section.
-# No need to generate them if there are no CONFIG_HEADERS.
-# This happens for instance with `./config.status Makefile'.
-if test -n "$CONFIG_HEADERS"; then
-cat >"$ac_tmp/defines.awk" <<\_ACAWK ||
-BEGIN {
-_ACEOF
-
-# Transform confdefs.h into an awk script `defines.awk', embedded as
-# here-document in config.status, that substitutes the proper values into
-# config.h.in to produce config.h.
-
-# Create a delimiter string that does not exist in confdefs.h, to ease
-# handling of long lines.
-ac_delim='%!_!# '
-for ac_last_try in false false :; do
- ac_tt=`sed -n "/$ac_delim/p" confdefs.h`
- if test -z "$ac_tt"; then
- break
- elif $ac_last_try; then
- as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5
- else
- ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
- fi
-done
-
-# For the awk script, D is an array of macro values keyed by name,
-# likewise P contains macro parameters if any. Preserve backslash
-# newline sequences.
-
-ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
-sed -n '
-s/.\{148\}/&'"$ac_delim"'/g
-t rset
-:rset
-s/^[ ]*#[ ]*define[ ][ ]*/ /
-t def
-d
-:def
-s/\\$//
-t bsnl
-s/["\\]/\\&/g
-s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\
-D["\1"]=" \3"/p
-s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p
-d
-:bsnl
-s/["\\]/\\&/g
-s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\
-D["\1"]=" \3\\\\\\n"\\/p
-t cont
-s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p
-t cont
-d
-:cont
-n
-s/.\{148\}/&'"$ac_delim"'/g
-t clear
-:clear
-s/\\$//
-t bsnlc
-s/["\\]/\\&/g; s/^/"/; s/$/"/p
-d
-:bsnlc
-s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p
-b cont
-' <confdefs.h | sed '
-s/'"$ac_delim"'/"\\\
-"/g' >>$CONFIG_STATUS || ac_write_fail=1
-
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
- for (key in D) D_is_set[key] = 1
- FS = ""
-}
-/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ {
- line = \$ 0
- split(line, arg, " ")
- if (arg[1] == "#") {
- defundef = arg[2]
- mac1 = arg[3]
- } else {
- defundef = substr(arg[1], 2)
- mac1 = arg[2]
- }
- split(mac1, mac2, "(") #)
- macro = mac2[1]
- prefix = substr(line, 1, index(line, defundef) - 1)
- if (D_is_set[macro]) {
- # Preserve the white space surrounding the "#".
- print prefix "define", macro P[macro] D[macro]
- next
- } else {
- # Replace #undef with comments. This is necessary, for example,
- # in the case of _POSIX_SOURCE, which is predefined and required
- # on some systems where configure will not decide to define it.
- if (defundef == "undef") {
- print "/*", prefix defundef, macro, "*/"
- next
- }
- }
-}
-{ print }
-_ACAWK
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
- as_fn_error $? "could not setup config headers machinery" "$LINENO" 5
-fi # test -n "$CONFIG_HEADERS"
-
-
-eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS "
-shift
-for ac_tag
-do
- case $ac_tag in
- :[FHLC]) ac_mode=$ac_tag; continue;;
- esac
- case $ac_mode$ac_tag in
- :[FHL]*:*);;
- :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
- :[FH]-) ac_tag=-:-;;
- :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
- esac
- ac_save_IFS=$IFS
- IFS=:
- set x $ac_tag
- IFS=$ac_save_IFS
- shift
- ac_file=$1
- shift
-
- case $ac_mode in
- :L) ac_source=$1;;
- :[FH])
- ac_file_inputs=
- for ac_f
- do
- case $ac_f in
- -) ac_f="$ac_tmp/stdin";;
- *) # Look for the file first in the build tree, then in the source tree
- # (if the path is not absolute). The absolute path cannot be DOS-style,
- # because $ac_f cannot contain `:'.
- test -f "$ac_f" ||
- case $ac_f in
- [\\/$]*) false;;
- *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
- esac ||
- as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
- esac
- case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
- as_fn_append ac_file_inputs " '$ac_f'"
- done
-
- # Let's still pretend it is `configure' which instantiates (i.e., don't
- # use $as_me), people would be surprised to read:
- # /* config.h. Generated by config.status. */
- configure_input='Generated from '`
- $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
- `' by configure.'
- if test x"$ac_file" != x-; then
- configure_input="$ac_file. $configure_input"
- { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
-$as_echo "$as_me: creating $ac_file" >&6;}
- fi
- # Neutralize special characters interpreted by sed in replacement strings.
- case $configure_input in #(
- *\&* | *\|* | *\\* )
- ac_sed_conf_input=`$as_echo "$configure_input" |
- sed 's/[\\\\&|]/\\\\&/g'`;; #(
- *) ac_sed_conf_input=$configure_input;;
- esac
-
- case $ac_tag in
- *:-:* | *:-) cat >"$ac_tmp/stdin" \
- || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
- esac
- ;;
- esac
-
- ac_dir=`$as_dirname -- "$ac_file" ||
-$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$ac_file" : 'X\(//\)[^/]' \| \
- X"$ac_file" : 'X\(//\)$' \| \
- X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$ac_file" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
- as_dir="$ac_dir"; as_fn_mkdir_p
- ac_builddir=.
-
-case "$ac_dir" in
-.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
-*)
- ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
- # A ".." for each directory in $ac_dir_suffix.
- ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
- case $ac_top_builddir_sub in
- "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
- *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
- esac ;;
-esac
-ac_abs_top_builddir=$ac_pwd
-ac_abs_builddir=$ac_pwd$ac_dir_suffix
-# for backward compatibility:
-ac_top_builddir=$ac_top_build_prefix
-
-case $srcdir in
- .) # We are building in place.
- ac_srcdir=.
- ac_top_srcdir=$ac_top_builddir_sub
- ac_abs_top_srcdir=$ac_pwd ;;
- [\\/]* | ?:[\\/]* ) # Absolute name.
- ac_srcdir=$srcdir$ac_dir_suffix;
- ac_top_srcdir=$srcdir
- ac_abs_top_srcdir=$srcdir ;;
- *) # Relative name.
- ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
- ac_top_srcdir=$ac_top_build_prefix$srcdir
- ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
-esac
-ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
-
-
- case $ac_mode in
- :F)
- #
- # CONFIG_FILE
- #
-
- case $INSTALL in
- [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
- *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
- esac
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-# If the template does not know about datarootdir, expand it.
-# FIXME: This hack should be removed a few years after 2.60.
-ac_datarootdir_hack=; ac_datarootdir_seen=
-ac_sed_dataroot='
-/datarootdir/ {
- p
- q
-}
-/@datadir@/p
-/@docdir@/p
-/@infodir@/p
-/@localedir@/p
-/@mandir@/p'
-case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
-*datarootdir*) ac_datarootdir_seen=yes;;
-*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
-$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
- ac_datarootdir_hack='
- s&@datadir@&$datadir&g
- s&@docdir@&$docdir&g
- s&@infodir@&$infodir&g
- s&@localedir@&$localedir&g
- s&@mandir@&$mandir&g
- s&\\\${datarootdir}&$datarootdir&g' ;;
-esac
-_ACEOF
-
-# Neutralize VPATH when `$srcdir' = `.'.
-# Shell code in configure.ac might set extrasub.
-# FIXME: do we really want to maintain this feature?
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-ac_sed_extra="$ac_vpsub
-$extrasub
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-:t
-/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
-s|@configure_input@|$ac_sed_conf_input|;t t
-s&@top_builddir@&$ac_top_builddir_sub&;t t
-s&@top_build_prefix@&$ac_top_build_prefix&;t t
-s&@srcdir@&$ac_srcdir&;t t
-s&@abs_srcdir@&$ac_abs_srcdir&;t t
-s&@top_srcdir@&$ac_top_srcdir&;t t
-s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
-s&@builddir@&$ac_builddir&;t t
-s&@abs_builddir@&$ac_abs_builddir&;t t
-s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
-s&@INSTALL@&$ac_INSTALL&;t t
-$ac_datarootdir_hack
-"
-eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \
- >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5
-
-test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
- { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
- { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \
- "$ac_tmp/out"`; test -z "$ac_out"; } &&
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
-which seems to be undefined. Please make sure it is defined" >&5
-$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
-which seems to be undefined. Please make sure it is defined" >&2;}
-
- rm -f "$ac_tmp/stdin"
- case $ac_file in
- -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
- *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
- esac \
- || as_fn_error $? "could not create $ac_file" "$LINENO" 5
- ;;
- :H)
- #
- # CONFIG_HEADER
- #
- if test x"$ac_file" != x-; then
- {
- $as_echo "/* $configure_input */" \
- && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs"
- } >"$ac_tmp/config.h" \
- || as_fn_error $? "could not create $ac_file" "$LINENO" 5
- if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
-$as_echo "$as_me: $ac_file is unchanged" >&6;}
- else
- rm -f "$ac_file"
- mv "$ac_tmp/config.h" "$ac_file" \
- || as_fn_error $? "could not create $ac_file" "$LINENO" 5
- fi
- else
- $as_echo "/* $configure_input */" \
- && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \
- || as_fn_error $? "could not create -" "$LINENO" 5
- fi
- ;;
-
-
- esac
-
-done # for ac_tag
-
-
-as_fn_exit 0
-_ACEOF
-ac_clean_files=$ac_clean_files_save
-
-test $ac_write_fail = 0 ||
- as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5
-
-
-# configure is writing to config.log, and then calls config.status.
-# config.status does its own redirection, appending to config.log.
-# Unfortunately, on DOS this fails, as config.log is still kept open
-# by configure, so config.status won't be able to write to it; its
-# output is simply discarded. So we exec the FD to /dev/null,
-# effectively closing config.log, so it can be properly (re)opened and
-# appended to by config.status. When coming back to configure, we
-# need to make the FD available again.
-if test "$no_create" != yes; then
- ac_cs_success=:
- ac_config_status_args=
- test "$silent" = yes &&
- ac_config_status_args="$ac_config_status_args --quiet"
- exec 5>/dev/null
- $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
- exec 5>>config.log
- # Use ||, not &&, to avoid exiting from the if with $? = 1, which
- # would make configure fail if this is the last instruction.
- $ac_cs_success || as_fn_exit 1
-fi
-if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
-$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
-fi
-
diff --git a/configure.ac b/configure.ac
index 758fcc5..a463dba 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,5 +1,5 @@
# ocaml-libvirt
-# Copyright (C) 2007-2008 Red Hat Inc., Richard W.M. Jones
+# Copyright (C) 2007-2015 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
@@ -18,6 +18,7 @@
dnl Process this file with autoconf to produce a configure script.
AC_INIT(ocaml-libvirt,0.6.1.4)
+AC_CONFIG_MACRO_DIRS([m4])
dnl Check for basic C environment.
AC_PROG_CC
@@ -47,25 +48,15 @@ AC_SUBST(WARNINGS)
AC_SUBST(CFLAGS_FPIC)
AC_SUBST(WIN32)
-dnl Check for libvirt development environment.
-AC_ARG_WITH(libvirt,
- AC_HELP_STRING([--with-libvirt=PATH],[Set path to installed libvirt]),
- [if test "x$withval" != "x"; then
- CFLAGS="$CFLAGS -I$withval/include"
- LDFLAGS="$LDFLAGS -L$withval/lib"
- fi
- ])
-AC_CHECK_LIB(virt,virConnectOpen,
- [],
- AC_MSG_ERROR([You must install libvirt library]))
-AC_CHECK_HEADER([libvirt/libvirt.h],
- [],
- AC_MSG_ERROR([You must install libvirt development package]))
+dnl Check for perl (required).
+AC_CHECK_PROG([PERL],[perl],[perl],[no])
+if test "x$PERL" = "xno"; then
+ AC_MSG_ERROR([Perl must be installed to build])
+fi
-dnl We also use <libvirt/virterror.h>
-AC_CHECK_HEADER([libvirt/virterror.h],
- [],
- AC_MSG_ERROR([You must install libvirt development package]))
+dnl Check for libvirt development environment.
+PKG_PROG_PKG_CONFIG
+PKG_CHECK_MODULES([LIBVIRT], [libvirt >= 1.2.8])
dnl Check for basic OCaml environment & findlib.
AC_PROG_OCAML
@@ -75,104 +66,13 @@ if test "x$OCAMLFIND" = "x"; then
AC_MSG_ERROR([OCaml findlib is required])
fi
-dnl Use ocamlfind to find the required packages ...
-
dnl Check for required OCaml packages.
+OCAML_PKG_unix=no
AC_CHECK_OCAML_PKG(unix)
-if test "x$pkg_unix" != "xyes"; then
+if test "x$OCAML_PKG_unix" = "xno"; then
AC_MSG_ERROR([Cannot find required OCaml package 'unix'])
fi
-dnl Check for optional NSIS (for building a Windows installer).
-dnl XXX This probably doesn't work at the moment XXX
-AC_ARG_WITH([nsis],
- [AS_HELP_STRING([--with-nsis],
- [use NSIS to build a Windows installer])],
- [],
- [with_nsis=no])
-
-MAKENSIS=
-LIBVIRT_DLL_PATH=
-LIBXDR_DLL_PATH=
-LIBXML2_DLL_PATH=
-GNUTLS_DLL_PATH=
-GTK_PATH=
-GTK_DLL_PATH=
-
-[
-msys_to_win_dir () {
- eval pushd "\$$1" > /dev/null
- eval $1=`pwd -W`
- popd > /dev/null
-}
-]
-
-if test "x$with_nsis" != "xno"; then
- AC_PATH_PROG(MAKENSIS,makensis,[],[$with_nsis:$PATH])
- if test "x$MAKENSIS" = "x"; then
- AC_MSG_FAILURE([--with-nsis was given, but could not find MAKENSIS.EXE])
- fi
-
- # MAKENSIS is set so we will build a rule for making a Windows
- # installer. To support this, generate wininstaller.nsis.
- saved_IFS=$IFS
- IFS=$PATH_SEPARATOR
- for d in $PATH; do
- IFS=$saved_IFS
- echo Checking $d for DLLs ... >&5
- if test -f "$d/libvirt-0.dll"; then
- LIBVIRT_DLL_PATH="$d"
- fi
- if test -f "$d/libxdr.dll"; then
- LIBXDR_DLL_PATH="$d"
- fi
- if test -f "$d/libxml2-2.dll"; then
- LIBXML2_DLL_PATH="$d"
- fi
- if test -f "$d/libgpg-error-0.dll"; then
- GNUTLS_DLL_PATH="$d"
- fi
- if test -f "$d/libgtk-win32-2.0-0.dll"; then
- GTK_DLL_PATH="$d"
- GTK_PATH="$d/.."
- fi
- done
- IFS=$saved_IFS
-
- if test "x$LIBVIRT_DLL_PATH" = "x"; then
- AC_MSG_FAILURE([cannot find libvirt-0.dll in PATH])
- fi
- if test "x$LIBXDR_DLL_PATH" = "x"; then
- AC_MSG_FAILURE([cannot find libxdr.dll in PATH])
- fi
- if test "x$LIBXML2_DLL_PATH" = "x"; then
- AC_MSG_FAILURE([cannot find libxml2-2.dll in PATH])
- fi
- if test "x$GNUTLS_DLL_PATH" = "x"; then
- AC_MSG_FAILURE([cannot find GnuTLS DLLs in PATH])
- fi
- if test "x$GTK_DLL_PATH" = "x"; then
- AC_MSG_WARN([cannot find GTK DLLs in PATH])
- fi
-
- # Change the paths to Windows paths.
- msys_to_win_dir LIBVIRT_DLL_PATH
- msys_to_win_dir LIBXDR_DLL_PATH
- msys_to_win_dir LIBXML2_DLL_PATH
- msys_to_win_dir GNUTLS_DLL_PATH
- if test "x$GTK_DLL_PATH" != "x"; then
- msys_to_win_dir GTK_DLL_PATH
- msys_to_win_dir GTK_PATH
- fi
-fi
-AC_SUBST(MAKENSIS)
-AC_SUBST(LIBVIRT_DLL_PATH)
-AC_SUBST(LIBXDR_DLL_PATH)
-AC_SUBST(LIBXML2_DLL_PATH)
-AC_SUBST(GNUTLS_DLL_PATH)
-AC_SUBST(GTK_DLL_PATH)
-AC_SUBST(GTK_PATH)
-
dnl Summary.
echo "------------------------------------------------------------"
echo "Thanks for downloading" $PACKAGE_STRING
@@ -187,7 +87,4 @@ AC_CONFIG_FILES([META
libvirt/Makefile
examples/Makefile
])
-if test "x$MAKENSIS" != "x"; then
- AC_CONFIG_FILES([wininstaller.nsis])
-fi
AC_OUTPUT
diff --git a/examples/.depend b/examples/.depend
index b305b76..72191b0 100644
--- a/examples/.depend
+++ b/examples/.depend
@@ -1,8 +1,12 @@
-node_info.cmo : ../libvirt/libvirt.cmi
-node_info.cmx : ../libvirt/libvirt.cmx
-get_cpu_stats.cmo : ../libvirt/libvirt.cmi
-get_cpu_stats.cmx : ../libvirt/libvirt.cmx
domain_events.cmo : ../libvirt/libvirt.cmi
domain_events.cmx : ../libvirt/libvirt.cmx
+get_all_domain_stats.cmo : ../libvirt/libvirt.cmi
+get_all_domain_stats.cmx : ../libvirt/libvirt.cmx
+get_cpu_stats.cmo : ../libvirt/libvirt.cmi
+get_cpu_stats.cmx : ../libvirt/libvirt.cmx
list_domains.cmo : ../libvirt/libvirt.cmi
list_domains.cmx : ../libvirt/libvirt.cmx
+list_secrets.cmo : ../libvirt/libvirt.cmi
+list_secrets.cmx : ../libvirt/libvirt.cmx
+node_info.cmo : ../libvirt/libvirt.cmi
+node_info.cmx : ../libvirt/libvirt.cmx
diff --git a/examples/Makefile.in b/examples/Makefile.in
index 041e382..4315556 100644
--- a/examples/Makefile.in
+++ b/examples/Makefile.in
@@ -18,16 +18,14 @@
OCAMLFIND = @OCAMLFIND@
OCAMLCPACKAGES := -package unix -I ../libvirt
-OCAMLCFLAGS := -g
+OCAMLCFLAGS := -g -warn-error CDEFLMPSUVYZX-3
OCAMLCLIBS := -linkpkg
OCAMLOPTPACKAGES := $(OCAMLCPACKAGES)
-OCAMLOPTFLAGS :=
+OCAMLOPTFLAGS := -g -warn-error CDEFLMPSUVYZX-3
OCAMLOPTLIBS := $(OCAMLCLIBS)
-export LIBRARY_PATH=../libvirt
-export LD_LIBRARY_PATH=../libvirt
-
-BYTE_TARGETS := list_domains node_info get_cpu_stats domain_events
+BYTE_TARGETS := list_domains list_secrets node_info get_cpu_stats \
+ get_all_domain_stats domain_events
OPT_TARGETS := $(BYTE_TARGETS:%=%.opt)
all: $(BYTE_TARGETS)
@@ -44,6 +42,16 @@ list_domains.opt: list_domains.cmx
$(OCAMLOPTPACKAGES) $(OCAMLOPTFLAGS) $(OCAMLOPTLIBS) \
../libvirt/mllibvirt.cmxa -o $@ $<
+list_secrets: list_secrets.cmo
+ $(OCAMLFIND) ocamlc \
+ $(OCAMLCPACKAGES) $(OCAMLCFLAGS) $(OCAMLCLIBS) \
+ ../libvirt/mllibvirt.cma -o $@ $<
+
+list_secrets.opt: list_secrets.cmx
+ $(OCAMLFIND) ocamlopt \
+ $(OCAMLOPTPACKAGES) $(OCAMLOPTFLAGS) $(OCAMLOPTLIBS) \
+ ../libvirt/mllibvirt.cmxa -o $@ $<
+
node_info: node_info.cmo
$(OCAMLFIND) ocamlc \
$(OCAMLCPACKAGES) $(OCAMLCFLAGS) $(OCAMLCLIBS) \
@@ -64,6 +72,16 @@ get_cpu_stats.opt: get_cpu_stats.cmx
$(OCAMLOPTPACKAGES) $(OCAMLOPTFLAGS) $(OCAMLOPTLIBS) \
../libvirt/mllibvirt.cmxa -o $@ $<
+get_all_domain_stats: get_all_domain_stats.cmo
+ $(OCAMLFIND) ocamlc \
+ $(OCAMLCPACKAGES) $(OCAMLCFLAGS) $(OCAMLCLIBS) \
+ ../libvirt/mllibvirt.cma -o $@ $<
+
+get_all_domain_stats.opt: get_all_domain_stats.cmx
+ $(OCAMLFIND) ocamlopt \
+ $(OCAMLOPTPACKAGES) $(OCAMLOPTFLAGS) $(OCAMLOPTLIBS) \
+ ../libvirt/mllibvirt.cmxa -o $@ $<
+
domain_events: domain_events.cmo
$(OCAMLFIND) ocamlc \
$(OCAMLCPACKAGES) $(OCAMLCFLAGS) $(OCAMLCLIBS) \
diff --git a/examples/domain_events.ml b/examples/domain_events.ml
index 03cecd9..12ddbc1 100644
--- a/examples/domain_events.ml
+++ b/examples/domain_events.ml
@@ -2,7 +2,7 @@
Usage: domain_events [URI]
(C) Copyright 2007 Richard W.M. Jones, Red Hat Inc.
(C) Copyright 2013 Citrix Inc
- http://libvirt.org/
+ https://libvirt.org/
*)
open Printf
@@ -20,6 +20,7 @@ let string_of_state = function
| D.InfoShutdown -> "shutdown"
| D.InfoShutoff -> "shutoff"
| D.InfoCrashed -> "crashed"
+ | D.InfoPMSuspended -> "pm suspended"
let printd dom fmt =
let prefix dom =
@@ -62,7 +63,7 @@ let () =
Some (Sys.argv.(1))
else
None in
- let conn = C.connect_readonly ?name () in
+ let conn = C.connect_auth_readonly ?name (C.get_auth_default ()) in
let spinner = [| '|'; '/'; '-'; '\\' |] in
diff --git a/examples/get_all_domain_stats.ml b/examples/get_all_domain_stats.ml
new file mode 100644
index 0000000..9a4f4c2
--- /dev/null
+++ b/examples/get_all_domain_stats.ml
@@ -0,0 +1,73 @@
+(* Example of using Domain.get_all_domain_stats (virConnectGetAllDomainStats).
+ * Usage: get_all_domain_stats
+ * https://libvirt.org/
+ *)
+
+open Printf
+
+module C = Libvirt.Connect
+module D = Libvirt.Domain
+
+let print_stats conn stats =
+ try
+ Array.iter (
+ fun { D.dom_uuid = uuid; D.params = params } ->
+ let dom = D.lookup_by_uuid conn uuid in
+ printf "domain %s:\n" (D.get_name dom);
+ Array.iteri (
+ fun i (field, value) ->
+ printf "\t%-20s = " field;
+ (match value with
+ | D.TypedFieldInt32 i -> printf "%ld" i
+ | D.TypedFieldUInt32 i -> printf "%ld" i
+ | D.TypedFieldInt64 i -> printf "%Ld" i
+ | D.TypedFieldUInt64 i -> printf "%Ld" i
+ | D.TypedFieldFloat f -> printf "%g" f
+ | D.TypedFieldBool b -> printf "%b" b
+ | D.TypedFieldString s -> printf "%S" s);
+ printf "\n";
+ ) params;
+ printf "\n"
+ ) stats
+ with
+ Libvirt.Virterror err ->
+ eprintf "error: %s\n" (Libvirt.Virterror.to_string err)
+
+let () =
+ if Array.length Sys.argv <> 1 then (
+ eprintf "error: get_all_domain_stats\n";
+ exit 1
+ );
+
+ let conn = C.connect_auth_readonly (C.get_auth_default ()) in
+
+ let what = [
+ D.StatsState;
+ D.StatsCpuTotal;
+ D.StatsBalloon;
+ D.StatsVcpu;
+ D.StatsInterface;
+ D.StatsBlock;
+ ] in
+ let who = [] in (* empty list means returns all domains *)
+
+ let quit = ref false in
+
+ while not !quit do
+ let stats = D.get_all_domain_stats conn what who in
+
+ if stats <> [||] then print_stats conn stats
+ else (
+ printf "no guests found\n";
+ quit := true
+ );
+ flush stdout;
+
+ (* Run the garbage collector which is a good way to check for
+ * memory corruption errors and reference counting issues in
+ * libvirt. You shouldn't do this in ordinary programs.
+ *)
+ Gc.compact ();
+
+ if not !quit then Unix.sleep 3
+ done
diff --git a/examples/get_cpu_stats.ml b/examples/get_cpu_stats.ml
index d7a8d0c..082cf72 100644
--- a/examples/get_cpu_stats.ml
+++ b/examples/get_cpu_stats.ml
@@ -1,6 +1,6 @@
(* List CPU stats for a domain.
* Usage: get_cpu_stats domain
- * http://libvirt.org/
+ * https://libvirt.org/
*)
open Printf
@@ -17,11 +17,13 @@ let () =
);
let domname = Sys.argv.(1) in
- let conn = C.connect_readonly () in
+ let conn = C.connect_auth_readonly (C.get_auth_default ()) in
+ (*
let nr_pcpus =
let info = C.get_node_info conn in
C.maxcpus_of_node_info info in
+ *)
let stats =
let dom = D.lookup_by_name conn domname in
diff --git a/examples/list_domains.ml b/examples/list_domains.ml
index 5cd93c7..1d73b69 100644
--- a/examples/list_domains.ml
+++ b/examples/list_domains.ml
@@ -1,7 +1,7 @@
(* Simple demo program showing how to list out domains.
Usage: list_domains [URI]
(C) Copyright 2007 Richard W.M. Jones, Red Hat Inc.
- http://libvirt.org/
+ https://libvirt.org/
*)
open Printf
@@ -18,6 +18,7 @@ let string_of_state = function
| D.InfoShutdown -> "shutdown"
| D.InfoShutoff -> "shutoff"
| D.InfoCrashed -> "crashed"
+ | D.InfoPMSuspended -> "pm suspended"
let () =
try
@@ -26,7 +27,7 @@ let () =
Some (Sys.argv.(1))
else
None in
- let conn = C.connect_readonly ?name () in
+ let conn = C.connect_auth_readonly ?name (C.get_auth_default ()) in
(* List all domains (running and inactive). *)
let domains = D.get_domains_and_infos conn [D.ListAll] in
diff --git a/examples/list_secrets.ml b/examples/list_secrets.ml
new file mode 100644
index 0000000..0094748
--- /dev/null
+++ b/examples/list_secrets.ml
@@ -0,0 +1,48 @@
+(* Simple demo program showing how to list out secrets.
+ Usage: list_secrets [URI]
+ (C) Copyright 2018 Pino Toscano, Red Hat Inc.
+ https://libvirt.org/
+ *)
+
+open Printf
+
+module C = Libvirt.Connect
+module S = Libvirt.Secret
+
+let string_of_secret_usage_type = function
+ | S.NoType -> "none"
+ | S.Volume -> "volume"
+ | S.Ceph -> "ceph"
+ | S.ISCSI -> "iscsi"
+ | S.TLS -> "tls"
+
+let () =
+ try
+ let name =
+ if Array.length Sys.argv >= 2 then
+ Some (Sys.argv.(1))
+ else
+ None in
+ let conn = C.connect_auth_readonly ?name (C.get_auth_default ()) in
+
+ (* List all the secrets. *)
+ let secrets = C.list_secrets conn (C.num_of_secrets conn) in
+ let secrets = Array.to_list secrets in
+ let secrets = List.map (S.lookup_by_uuid_string conn) secrets in
+ List.iter (
+ fun secret ->
+ let uuid = S.get_uuid_string secret in
+ let usageType = string_of_secret_usage_type (S.get_usage_type secret) in
+ let usageId = S.get_usage_id secret in
+ printf "%*s %-7s %s\n%!"
+ (Libvirt.uuid_string_length) uuid usageType usageId
+ ) secrets
+ with
+ Libvirt.Virterror err ->
+ eprintf "error: %s\n" (Libvirt.Virterror.to_string err)
+
+let () =
+ (* Run the garbage collector which is a good way to check for
+ * memory corruption errors and reference counting issues in libvirt.
+ *)
+ Gc.compact ()
diff --git a/examples/node_info.ml b/examples/node_info.ml
index c52615e..e733525 100644
--- a/examples/node_info.ml
+++ b/examples/node_info.ml
@@ -1,7 +1,7 @@
(* Simple demo program showing node info.
Usage: node_info [URI]
(C) Copyright 2007 Richard W.M. Jones, Red Hat Inc.
- http://libvirt.org/
+ https://libvirt.org/
*)
open Printf
@@ -15,7 +15,7 @@ let () =
Some (Sys.argv.(1))
else
None in
- let conn = C.connect_readonly ?name () in
+ let conn = C.connect_auth_readonly ?name (C.get_auth_default ()) in
(* Get node_info, hostname, etc. *)
let node_info = C.get_node_info conn in
diff --git a/libvirt/.depend b/libvirt/.depend
index 7d32e13..ee1180c 100644
--- a/libvirt/.depend
+++ b/libvirt/.depend
@@ -1,6 +1,6 @@
-libvirt_version.cmi :
+libvirt.cmo : libvirt.cmi
+libvirt.cmx : libvirt.cmi
libvirt.cmi :
libvirt_version.cmo : libvirt_version.cmi
libvirt_version.cmx : libvirt_version.cmi
-libvirt.cmo : libvirt.cmi
-libvirt.cmx : libvirt.cmi
+libvirt_version.cmi :
diff --git a/libvirt/Makefile.in b/libvirt/Makefile.in
index f7c04bb..77462c7 100644
--- a/libvirt/Makefile.in
+++ b/libvirt/Makefile.in
@@ -18,28 +18,32 @@
WIN32 = @WIN32@
CFLAGS = @CFLAGS@ \
+ @LIBVIRT_CFLAGS@ \
+ -DCAML_NAME_SPACE \
-I.. \
-I"$(shell ocamlc -where)" \
@DEBUG@ @WARNINGS@ @CFLAGS_FPIC@
-LDFLAGS = @LDFLAGS@
+LDFLAGS = @LDFLAGS@ \
+ @LIBVIRT_LIBS@
# -L"$(shell ocamlc -where)"
OCAMLC = @OCAMLC@
OCAMLOPT = @OCAMLOPT@
OCAMLFIND = @OCAMLFIND@
OCAMLMKLIB = @OCAMLMKLIB@
+PERL = @PERL@
ifneq ($(OCAMLFIND),)
OCAMLCPACKAGES := -package unix
-OCAMLCFLAGS := -g
+OCAMLCFLAGS := -g -warn-error CDEFLMPSUVYZX-3 -safe-string
OCAMLCLIBS := -linkpkg
else
OCAMLCINCS :=
-OCAMLCFLAGS := -g
+OCAMLCFLAGS := -g -warn-error CDEFLMPSUVYZX-3 -safe-string
OCAMLCLIBS := unix.cma
endif
-OCAMLOPTFLAGS :=
+OCAMLOPTFLAGS := $(OCAMLCFLAGS)
ifneq ($(OCAMLFIND),)
OCAMLOPTPACKAGES := $(OCAMLCPACKAGES)
OCAMLOPTLIBS := $(OCAMLCLIBS)
@@ -48,9 +52,6 @@ OCAMLOPTINCS := $(OCAMLCINCS)
OCAMLOPTLIBS := unix.cmxa
endif
-export LIBRARY_PATH=.
-export LD_LIBRARY_PATH=.
-
BYTE_TARGETS := mllibvirt.cma
OPT_TARGETS := mllibvirt.cmxa
@@ -64,10 +65,10 @@ OPTOBJS := libvirt.cmx libvirt_version.cmx
ifneq ($(OCAMLMKLIB),)
# Good, we can just use ocamlmklib
mllibvirt.cma: libvirt_c.o $(COBJS)
- $(OCAMLMKLIB) -o mllibvirt $^ $(LDFLAGS) -lvirt
+ $(OCAMLMKLIB) -o mllibvirt $^ $(LDFLAGS)
mllibvirt.cmxa: libvirt_c.o $(OPTOBJS)
- $(OCAMLMKLIB) -o mllibvirt $^ $(LDFLAGS) -lvirt
+ $(OCAMLMKLIB) -o mllibvirt $^ $(LDFLAGS)
else
ifeq ($(WIN32),yes)
@@ -76,15 +77,15 @@ ifeq ($(WIN32),yes)
mllibvirt.cma: dllmllibvirt.dll libmllibvirt.a $(COBJS)
$(OCAMLC) -a -linkall -o $@ $(COBJS) \
- -dllib -lmllibvirt -cclib -lmllibvirt -cclib "$(LDFLAGS) -lvirt"
+ -dllib -lmllibvirt -cclib -lmllibvirt -cclib "$(LDFLAGS)"
mllibvirt.cmxa: libmllibvirt.a $(OPTOBJS)
$(OCAMLOPT) -a -linkall -o $@ $(OPTOBJS) \
- -cclib -lmllibvirt -cclib "$(LDFLAGS) -lvirt"
+ -cclib -lmllibvirt -cclib "$(LDFLAGS)"
dllmllibvirt.dll: libvirt_c.o
$(CC) -shared -o $@ $^ \
- $(LDFLAGS) "$(shell ocamlc -where)"/ocamlrun.a -lvirt
+ $(LDFLAGS) "$(shell ocamlc -where)"/ocamlrun.a
libmllibvirt.a: libvirt_c.o
ar rc $@ $^
@@ -100,7 +101,7 @@ endif
# Automatically generate the C code from a Perl script 'generator.pl'.
libvirt_c.c: generator.pl
- perl -w $<
+ $(PERL) -w $<
# Extra dependencies.
libvirt_c.c: libvirt_c_prologue.c
diff --git a/libvirt/generator.pl b/libvirt/generator.pl
index 8229ad1..e850500 100755
--- a/libvirt/generator.pl
+++ b/libvirt/generator.pl
@@ -1,8 +1,8 @@
-#!/usr/bin/perl -w
+#!/usr/bin/env perl
#
# OCaml bindings for libvirt.
-# (C) Copyright 2007-2008 Richard W.M. Jones, Red Hat Inc.
-# http://libvirt.org/
+# (C) Copyright 2007-2015 Richard W.M. Jones, Red Hat Inc.
+# https://libvirt.org/
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
@@ -26,6 +26,7 @@
# Please read libvirt/README.
use strict;
+use warnings;
#----------------------------------------------------------------------
@@ -58,11 +59,14 @@ my @functions = (
sig => "conn : int" },
{ name => "virConnectListDefinedStoragePools",
sig => "conn, int : string array" },
+ { name => "virConnectNumOfSecrets", sig => "conn : int" },
+ { name => "virConnectListSecrets", sig => "conn, int : string array" },
{ name => "virConnectGetCapabilities", sig => "conn : string" },
{ name => "virConnectDomainEventDeregisterAny",
sig => "conn, int : unit" },
{ name => "virDomainCreateLinux", sig => "conn, string, 0U : dom" },
+ { name => "virDomainCreateXML", sig => "conn, string, unsigned : dom" },
{ name => "virDomainFree", sig => "dom : free" },
{ name => "virDomainDestroy", sig => "dom : free" },
{ name => "virDomainLookupByName", sig => "conn, string : dom" },
@@ -168,6 +172,17 @@ my @functions = (
{ name => "virStoragePoolLookupByVolume",
sig => "vol : pool from vol" },
+ { name => "virSecretFree", sig => "sec : free" },
+ { name => "virSecretUndefine", sig => "sec : unit" },
+ { name => "virSecretLookupByUUID", sig => "conn, uuid : sec" },
+ { name => "virSecretLookupByUUIDString", sig => "conn, string : sec" },
+ { name => "virSecretDefineXML", sig => "conn, string, 0 : sec" },
+ { name => "virSecretGetUUID", sig => "sec : uuid" },
+ { name => "virSecretGetUUIDString", sig => "sec : uuid string" },
+ { name => "virSecretGetUsageType", sig => "sec : int" },
+ { name => "virSecretGetUsageID", sig => "sec : static string" },
+ { name => "virSecretGetXMLDesc", sig => "sec, 0 : string" },
+
);
# Functions we haven't implemented anywhere yet but which are mentioned
@@ -198,8 +213,8 @@ print F <<'END';
*/
/* OCaml bindings for libvirt.
- * (C) Copyright 2007-2008 Richard W.M. Jones, Red Hat Inc.
- * http://libvirt.org/
+ * (C) Copyright 2007-2015 Richard W.M. Jones, Red Hat Inc.
+ * https://libvirt.org/
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -265,6 +280,7 @@ sub short_name_to_c_type
elsif ($_ eq "net") { "virNetworkPtr" }
elsif ($_ eq "pool") { "virStoragePoolPtr" }
elsif ($_ eq "vol") { "virStorageVolPtr" }
+ elsif ($_ eq "sec") { "virSecretPtr" }
else {
die "unknown short name $_"
}
@@ -310,6 +326,8 @@ sub gen_arg_names
( "$1v", "strv" )
} elsif ($sig =~ /^(\w+), string, 0U? : (\w+)$/) {
( "$1v", "strv" )
+ } elsif ($sig =~ /^(\w+), string, unsigned : (\w+)$/) {
+ ( "$1v", "strv", "uv" )
} elsif ($sig =~ /^(\w+), u?int : (\w+)$/) {
( "$1v", "iv" )
} elsif ($sig =~ /^(\w+), uuid : (\w+)$/) {
@@ -340,17 +358,15 @@ sub gen_unpack_args
if ($_ eq "conn") {
"virConnectPtr conn = Connect_val (connv);"
} elsif ($_ eq "dom") {
- "virDomainPtr dom = Domain_val (domv);\n".
- " virConnectPtr conn = Connect_domv (domv);"
+ "virDomainPtr dom = Domain_val (domv);"
} elsif ($_ eq "net") {
- "virNetworkPtr net = Network_val (netv);\n".
- " virConnectPtr conn = Connect_netv (netv);"
+ "virNetworkPtr net = Network_val (netv);"
} elsif ($_ eq "pool") {
- "virStoragePoolPtr pool = Pool_val (poolv);\n".
- " virConnectPtr conn = Connect_polv (poolv);"
+ "virStoragePoolPtr pool = Pool_val (poolv);"
} elsif ($_ eq "vol") {
- "virStorageVolPtr vol = Volume_val (volv);\n".
- " virConnectPtr conn = Connect_volv (volv);"
+ "virStorageVolPtr vol = Volume_val (volv);"
+ } elsif ($_ eq "sec") {
+ "virSecretPtr sec = Secret_val (secv);"
} else {
die "unknown short name $_"
}
@@ -366,6 +382,7 @@ sub gen_pack_result
elsif ($_ eq "net") { "rv = Val_network (r, connv);" }
elsif ($_ eq "pool") { "rv = Val_pool (r, connv);" }
elsif ($_ eq "vol") { "rv = Val_volume (r, connv);" }
+ elsif ($_ eq "sec") { "rv = Val_secret (r, connv);" }
else {
die "unknown short name $_"
}
@@ -380,6 +397,7 @@ sub gen_free_arg
elsif ($_ eq "net") { "Network_val (netv) = NULL;" }
elsif ($_ eq "pool") { "Pool_val (poolv) = NULL;" }
elsif ($_ eq "vol") { "Volume_val (volv) = NULL;" }
+ elsif ($_ eq "sec") { "Secret_val (secv) = NULL;" }
else {
die "unknown short name $_"
}
@@ -399,7 +417,7 @@ sub gen_c_code
char *r;
NONBLOCKING (r = $c_name ($1));
- CHECK_ERROR (!r, conn, \"$c_name\");
+ CHECK_ERROR (!r, \"$c_name\");
rv = caml_copy_string (r);
free (r);
@@ -412,7 +430,7 @@ sub gen_c_code
const char *r;
NONBLOCKING (r = $c_name ($1));
- CHECK_ERROR (!r, conn, \"$c_name\");
+ CHECK_ERROR (!r, \"$c_name\");
rv = caml_copy_string (r);
CAMLreturn (rv);
@@ -423,7 +441,7 @@ sub gen_c_code
int r;
NONBLOCKING (r = $c_name ($1));
- CHECK_ERROR (r == -1, conn, \"$c_name\");
+ CHECK_ERROR (r == -1, \"$c_name\");
CAMLreturn (Val_int (r));
"
@@ -435,7 +453,7 @@ sub gen_c_code
int r;
NONBLOCKING (r = $c_name ($1, uuid));
- CHECK_ERROR (r == -1, conn, \"$c_name\");
+ CHECK_ERROR (r == -1, \"$c_name\");
/* UUIDs are byte arrays with a fixed length. */
rv = caml_alloc_string (VIR_UUID_BUFLEN);
@@ -450,7 +468,7 @@ sub gen_c_code
int r;
NONBLOCKING (r = $c_name ($1, uuid));
- CHECK_ERROR (r == -1, conn, \"$c_name\");
+ CHECK_ERROR (r == -1, \"$c_name\");
rv = caml_copy_string (uuid);
CAMLreturn (rv);
@@ -461,7 +479,7 @@ sub gen_c_code
int r, b;
NONBLOCKING (r = $c_name ($1, &b));
- CHECK_ERROR (r == -1, conn, \"$c_name\");
+ CHECK_ERROR (r == -1, \"$c_name\");
CAMLreturn (b ? Val_true : Val_false);
"
@@ -473,7 +491,7 @@ sub gen_c_code
b = bv == Val_true ? 1 : 0;
NONBLOCKING (r = $c_name ($1, b));
- CHECK_ERROR (r == -1, conn, \"$c_name\");
+ CHECK_ERROR (r == -1, \"$c_name\");
CAMLreturn (Val_unit);
"
@@ -482,7 +500,7 @@ sub gen_c_code
CAMLlocal1 (rv);
virConnectPtr conn = Connect_val (connv);
int i = Int_val (iv);
- int ids[i], r;
+ int *ids, r;
/* Some libvirt List* functions still throw exceptions if i == 0,
* so catch that and return an empty array directly. This changes
@@ -494,12 +512,17 @@ sub gen_c_code
CAMLreturn (rv);
}
+ ids = malloc (sizeof (*ids) * i);
+ if (ids == NULL)
+ caml_raise_out_of_memory ();
+
NONBLOCKING (r = $c_name (conn, ids, i));
- CHECK_ERROR (r == -1, conn, \"$c_name\");
+ CHECK_ERROR_CLEANUP (r == -1, free (ids), \"$c_name\");
rv = caml_alloc (r, 0);
for (i = 0; i < r; ++i)
Store_field (rv, i, Val_int (ids[i]));
+ free (ids);
CAMLreturn (rv);
"
@@ -508,7 +531,7 @@ sub gen_c_code
CAMLlocal2 (rv, strv);
" . gen_unpack_args ($1) . "
int i = Int_val (iv);
- char *names[i];
+ char **names;
int r;
/* Some libvirt List* functions still throw exceptions if i == 0,
@@ -521,8 +544,12 @@ sub gen_c_code
CAMLreturn (rv);
}
+ names = malloc (sizeof (*names) * i);
+ if (names == NULL)
+ caml_raise_out_of_memory ();
+
NONBLOCKING (r = $c_name ($1, names, i));
- CHECK_ERROR (r == -1, conn, \"$c_name\");
+ CHECK_ERROR_CLEANUP (r == -1, free (names), \"$c_name\");
rv = caml_alloc (r, 0);
for (i = 0; i < r; ++i) {
@@ -530,6 +557,7 @@ sub gen_c_code
Store_field (rv, i, strv);
free (names[i]);
}
+ free (names);
CAMLreturn (rv);
"
@@ -540,7 +568,7 @@ sub gen_c_code
char *r;
NONBLOCKING (r = $c_name ($1, 0));
- CHECK_ERROR (!r, conn, \"$c_name\");
+ CHECK_ERROR (!r, \"$c_name\");
rv = caml_copy_string (r);
free (r);
@@ -552,7 +580,7 @@ sub gen_c_code
int r;
NONBLOCKING (r = $c_name ($1, 0));
- CHECK_ERROR (r == -1, conn, \"$c_name\");
+ CHECK_ERROR (r == -1, \"$c_name\");
CAMLreturn (Val_unit);
"
@@ -562,7 +590,7 @@ sub gen_c_code
int r;
NONBLOCKING (r = $c_name ($1));
- CHECK_ERROR (r == -1, conn, \"$c_name\");
+ CHECK_ERROR (r == -1, \"$c_name\");
CAMLreturn (Val_unit);
"
@@ -572,7 +600,7 @@ sub gen_c_code
int r;
NONBLOCKING (r = $c_name ($1));
- CHECK_ERROR (r == -1, conn, \"$c_name\");
+ CHECK_ERROR (r == -1, \"$c_name\");
/* So that we don't double-free in the finalizer: */
" . gen_free_arg ($1) . "
@@ -586,7 +614,7 @@ sub gen_c_code
int r;
NONBLOCKING (r = $c_name ($1, str));
- CHECK_ERROR (r == -1, conn, \"$c_name\");
+ CHECK_ERROR (r == -1, \"$c_name\");
CAMLreturn (Val_unit);
"
@@ -598,7 +626,7 @@ sub gen_c_code
int r;
NONBLOCKING (r = $c_name ($1, str, 0));
- CHECK_ERROR (!r, conn, \"$c_name\");
+ CHECK_ERROR (!r, \"$c_name\");
CAMLreturn (Val_unit);
"
@@ -611,7 +639,7 @@ sub gen_c_code
$c_ret_type r;
NONBLOCKING (r = $c_name ($1, str));
- CHECK_ERROR (!r, conn, \"$c_name\");
+ CHECK_ERROR (!r, \"$c_name\");
" . gen_pack_result ($2) . "
@@ -626,7 +654,23 @@ sub gen_c_code
$c_ret_type r;
NONBLOCKING (r = $c_name ($1, str, 0));
- CHECK_ERROR (!r, conn, \"$c_name\");
+ CHECK_ERROR (!r, \"$c_name\");
+
+ " . gen_pack_result ($2) . "
+
+ CAMLreturn (rv);
+"
+ } elsif ($sig =~ /^(\w+), string, unsigned : (\w+)$/) {
+ my $c_ret_type = short_name_to_c_type ($2);
+ "\
+ CAMLlocal1 (rv);
+ " . gen_unpack_args ($1) . "
+ char *str = String_val (strv);
+ unsigned int u = Int_val (uv);
+ $c_ret_type r;
+
+ NONBLOCKING (r = $c_name ($1, str, u));
+ CHECK_ERROR (!r, \"$c_name\");
" . gen_pack_result ($2) . "
@@ -640,7 +684,7 @@ sub gen_c_code
int r;
NONBLOCKING (r = $c_name ($1, i));
- CHECK_ERROR (r == -1, conn, \"$c_name\");
+ CHECK_ERROR (r == -1, \"$c_name\");
CAMLreturn (Val_unit);
"
@@ -654,7 +698,7 @@ sub gen_c_code
$c_ret_type r;
NONBLOCKING (r = $c_name ($1, i));
- CHECK_ERROR (!r, conn, \"$c_name\");
+ CHECK_ERROR (!r, \"$c_name\");
" . gen_pack_result ($3) . "
@@ -669,7 +713,7 @@ sub gen_c_code
$c_ret_type r;
NONBLOCKING (r = $c_name ($1, uuid));
- CHECK_ERROR (!r, conn, \"$c_name\");
+ CHECK_ERROR (!r, \"$c_name\");
" . gen_pack_result ($2) . "
@@ -683,7 +727,7 @@ sub gen_c_code
$c_ret_type r;
NONBLOCKING (r = $c_name ($1, 0));
- CHECK_ERROR (!r, conn, \"$c_name\");
+ CHECK_ERROR (!r, \"$c_name\");
" . gen_pack_result ($2) . "
@@ -697,7 +741,7 @@ sub gen_c_code
$c_ret_type r;
NONBLOCKING (r = $c_name ($1));
- CHECK_ERROR (!r, conn, \"$c_name\");
+ CHECK_ERROR (!r, \"$c_name\");
" . gen_pack_result ($2) . "
@@ -712,7 +756,7 @@ sub gen_c_code
$c_ret_type r;
NONBLOCKING (r = $c_name ($1, str));
- CHECK_ERROR (!r, conn, \"$c_name\");
+ CHECK_ERROR (!r, \"$c_name\");
connv = Field ($3v, 1);
" . gen_pack_result ($2) . "
@@ -728,7 +772,7 @@ sub gen_c_code
$c_ret_type r;
NONBLOCKING (r = $c_name ($1, str, 0));
- CHECK_ERROR (!r, conn, \"$c_name\");
+ CHECK_ERROR (!r, \"$c_name\");
connv = Field ($3v, 1);
" . gen_pack_result ($2) . "
@@ -743,7 +787,7 @@ sub gen_c_code
$c_ret_type r;
NONBLOCKING (r = $c_name ($1, 0));
- CHECK_ERROR (!r, conn, \"$c_name\");
+ CHECK_ERROR (!r, \"$c_name\");
connv = Field ($3v, 1);
" . gen_pack_result ($2) . "
@@ -758,7 +802,7 @@ sub gen_c_code
$c_ret_type r;
NONBLOCKING (r = $c_name ($1));
- CHECK_ERROR (!r, conn, \"$c_name\");
+ CHECK_ERROR (!r, \"$c_name\");
connv = Field ($3v, 1);
" . gen_pack_result ($2) . "
diff --git a/libvirt/libvirt.ml b/libvirt/libvirt.ml
index 9c9368a..03a5af8 100644
--- a/libvirt/libvirt.ml
+++ b/libvirt/libvirt.ml
@@ -1,6 +1,6 @@
(* OCaml bindings for libvirt.
- (C) Copyright 2007 Richard W.M. Jones, Red Hat Inc.
- http://libvirt.org/
+ (C) Copyright 2007-2015 Richard W.M. Jones, Red Hat Inc.
+ https://libvirt.org/
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -29,7 +29,7 @@ external get_version : ?driver:string -> unit -> int * int = "ocaml_libvirt_get_
let uuid_length = 16
let uuid_string_length = 36
-(* http://caml.inria.fr/pub/ml-archives/caml-list/2004/07/80683af867cce6bf8fff273973f70c95.en.html *)
+(* https://caml.inria.fr/pub/ml-archives/caml-list/2004/07/80683af867cce6bf8fff273973f70c95.en.html *)
type rw = [`R|`W]
type ro = [`R]
@@ -48,6 +48,29 @@ struct
threads : int;
}
+ type credential_type =
+ | CredentialUsername
+ | CredentialAuthname
+ | CredentialLanguage
+ | CredentialCnonce
+ | CredentialPassphrase
+ | CredentialEchoprompt
+ | CredentialNoechoprompt
+ | CredentialRealm
+ | CredentialExternal
+
+ type credential = {
+ typ : credential_type;
+ prompt : string;
+ challenge : string option;
+ defresult : string option;
+ }
+
+ type auth = {
+ credtype : credential_type list;
+ cb : (credential list -> string option list);
+ }
+
type list_flag =
| ListNoState | ListRunning | ListBlocked
| ListPaused | ListShutdown | ListShutoff | ListCrashed
@@ -57,6 +80,8 @@ struct
external connect : ?name:string -> unit -> rw t = "ocaml_libvirt_connect_open"
external connect_readonly : ?name:string -> unit -> ro t = "ocaml_libvirt_connect_open_readonly"
+ external connect_auth : ?name:string -> auth -> rw t = "ocaml_libvirt_connect_open_auth"
+ external connect_auth_readonly : ?name:string -> auth -> ro t = "ocaml_libvirt_connect_open_auth_readonly"
external close : [>`R] t -> unit = "ocaml_libvirt_connect_close"
external get_type : [>`R] t -> string = "ocaml_libvirt_connect_get_type"
external get_version : [>`R] t -> int = "ocaml_libvirt_connect_get_version"
@@ -76,6 +101,8 @@ struct
external list_pools : [>`R] t -> int -> string array = "ocaml_libvirt_connect_list_storage_pools"
external num_of_defined_pools : [>`R] t -> int = "ocaml_libvirt_connect_num_of_defined_storage_pools"
external list_defined_pools : [>`R] t -> int -> string array = "ocaml_libvirt_connect_list_defined_storage_pools"
+ external num_of_secrets : [>`R] t -> int = "ocaml_libvirt_connect_num_of_secrets"
+ external list_secrets : [>`R] t -> int -> string array = "ocaml_libvirt_connect_list_secrets"
external get_node_info : [>`R] t -> node_info = "ocaml_libvirt_connect_get_node_info"
external node_get_free_memory : [> `R] t -> int64 = "ocaml_libvirt_connect_node_get_free_memory"
@@ -92,16 +119,27 @@ struct
(* See VIR_USE_CPU, VIR_UNUSE_CPU, VIR_CPU_USABLE macros defined in <libvirt.h>. *)
let use_cpu cpumap cpu =
- cpumap.[cpu/8] <-
- Char.chr (Char.code cpumap.[cpu/8] lor (1 lsl (cpu mod 8)))
+ Bytes.set cpumap (cpu/8)
+ (Char.chr (Char.code (Bytes.get cpumap (cpu/8)) lor (1 lsl (cpu mod 8))))
let unuse_cpu cpumap cpu =
- cpumap.[cpu/8] <-
- Char.chr (Char.code cpumap.[cpu/8] land (lnot (1 lsl (cpu mod 8))))
+ Bytes.set cpumap (cpu/8)
+ (Char.chr (Char.code (Bytes.get cpumap (cpu/8)) land (lnot (1 lsl (cpu mod 8)))))
let cpu_usable cpumaps maplen vcpu cpu =
- Char.code cpumaps.[vcpu*maplen + cpu/8] land (1 lsl (cpu mod 8)) <> 0
+ Char.code (Bytes.get cpumaps (vcpu*maplen + cpu/8)) land (1 lsl (cpu mod 8)) <> 0
external set_keep_alive : [>`R] t -> int -> int -> unit = "ocaml_libvirt_connect_set_keep_alive"
+ (* Internal API needed for get_auth_default. *)
+ external _credtypes_from_auth_default : unit -> credential_type list = "ocaml_libvirt_connect_credtypes_from_auth_default"
+ external _call_auth_default_callback : credential list -> string option list = "ocaml_libvirt_connect_call_auth_default_callback"
+ let get_auth_default () =
+ {
+ credtype = _credtypes_from_auth_default ();
+ cb = _call_auth_default_callback;
+ }
+
+ external get_domain_capabilities : ?emulatorbin:string -> ?arch:string -> ?machine:string -> ?virttype:string -> [>`R] t -> string = "ocaml_libvirt_connect_get_domain_capabilities"
+
external const : [>`R] t -> ro t = "%identity"
end
@@ -159,6 +197,63 @@ struct
| VIR_WAR_NO_STORAGE
| VIR_ERR_NO_STORAGE_POOL
| VIR_ERR_NO_STORAGE_VOL
+ | VIR_WAR_NO_NODE
+ | VIR_ERR_INVALID_NODE_DEVICE
+ | VIR_ERR_NO_NODE_DEVICE
+ | VIR_ERR_NO_SECURITY_MODEL
+ | VIR_ERR_OPERATION_INVALID
+ | VIR_WAR_NO_INTERFACE
+ | VIR_ERR_NO_INTERFACE
+ | VIR_ERR_INVALID_INTERFACE
+ | VIR_ERR_MULTIPLE_INTERFACES
+ | VIR_WAR_NO_NWFILTER
+ | VIR_ERR_INVALID_NWFILTER
+ | VIR_ERR_NO_NWFILTER
+ | VIR_ERR_BUILD_FIREWALL
+ | VIR_WAR_NO_SECRET
+ | VIR_ERR_INVALID_SECRET
+ | VIR_ERR_NO_SECRET
+ | VIR_ERR_CONFIG_UNSUPPORTED
+ | VIR_ERR_OPERATION_TIMEOUT
+ | VIR_ERR_MIGRATE_PERSIST_FAILED
+ | VIR_ERR_HOOK_SCRIPT_FAILED
+ | VIR_ERR_INVALID_DOMAIN_SNAPSHOT
+ | VIR_ERR_NO_DOMAIN_SNAPSHOT
+ | VIR_ERR_INVALID_STREAM
+ | VIR_ERR_ARGUMENT_UNSUPPORTED
+ | VIR_ERR_STORAGE_PROBE_FAILED
+ | VIR_ERR_STORAGE_POOL_BUILT
+ | VIR_ERR_SNAPSHOT_REVERT_RISKY
+ | VIR_ERR_OPERATION_ABORTED
+ | VIR_ERR_AUTH_CANCELLED
+ | VIR_ERR_NO_DOMAIN_METADATA
+ | VIR_ERR_MIGRATE_UNSAFE
+ | VIR_ERR_OVERFLOW
+ | VIR_ERR_BLOCK_COPY_ACTIVE
+ | VIR_ERR_OPERATION_UNSUPPORTED
+ | VIR_ERR_SSH
+ | VIR_ERR_AGENT_UNRESPONSIVE
+ | VIR_ERR_RESOURCE_BUSY
+ | VIR_ERR_ACCESS_DENIED
+ | VIR_ERR_DBUS_SERVICE
+ | VIR_ERR_STORAGE_VOL_EXIST
+ | VIR_ERR_CPU_INCOMPATIBLE
+ | VIR_ERR_XML_INVALID_SCHEMA
+ | VIR_ERR_MIGRATE_FINISH_OK
+ | VIR_ERR_AUTH_UNAVAILABLE
+ | VIR_ERR_NO_SERVER
+ | VIR_ERR_NO_CLIENT
+ | VIR_ERR_AGENT_UNSYNCED
+ | VIR_ERR_LIBSSH
+ | VIR_ERR_DEVICE_MISSING
+ | VIR_ERR_INVALID_NWFILTER_BINDING
+ | VIR_ERR_NO_NWFILTER_BINDING
+ | VIR_ERR_INVALID_DOMAIN_CHECKPOINT
+ | VIR_ERR_NO_DOMAIN_CHECKPOINT
+ | VIR_ERR_NO_DOMAIN_BACKUP
+ | VIR_ERR_INVALID_NETWORK_PORT
+ | VIR_ERR_NETWORK_PORT_EXIST
+ | VIR_ERR_NO_NETWORK_PORT
| VIR_ERR_UNKNOWN of int
let string_of_code = function
@@ -213,6 +308,63 @@ struct
| VIR_WAR_NO_STORAGE -> "VIR_WAR_NO_STORAGE"
| VIR_ERR_NO_STORAGE_POOL -> "VIR_ERR_NO_STORAGE_POOL"
| VIR_ERR_NO_STORAGE_VOL -> "VIR_ERR_NO_STORAGE_VOL"
+ | VIR_WAR_NO_NODE -> "VIR_WAR_NO_NODE"
+ | VIR_ERR_INVALID_NODE_DEVICE -> "VIR_ERR_INVALID_NODE_DEVICE"
+ | VIR_ERR_NO_NODE_DEVICE -> "VIR_ERR_NO_NODE_DEVICE"
+ | VIR_ERR_NO_SECURITY_MODEL -> "VIR_ERR_NO_SECURITY_MODEL"
+ | VIR_ERR_OPERATION_INVALID -> "VIR_ERR_OPERATION_INVALID"
+ | VIR_WAR_NO_INTERFACE -> "VIR_WAR_NO_INTERFACE"
+ | VIR_ERR_NO_INTERFACE -> "VIR_ERR_NO_INTERFACE"
+ | VIR_ERR_INVALID_INTERFACE -> "VIR_ERR_INVALID_INTERFACE"
+ | VIR_ERR_MULTIPLE_INTERFACES -> "VIR_ERR_MULTIPLE_INTERFACES"
+ | VIR_WAR_NO_NWFILTER -> "VIR_WAR_NO_NWFILTER"
+ | VIR_ERR_INVALID_NWFILTER -> "VIR_ERR_INVALID_NWFILTER"
+ | VIR_ERR_NO_NWFILTER -> "VIR_ERR_NO_NWFILTER"
+ | VIR_ERR_BUILD_FIREWALL -> "VIR_ERR_BUILD_FIREWALL"
+ | VIR_WAR_NO_SECRET -> "VIR_WAR_NO_SECRET"
+ | VIR_ERR_INVALID_SECRET -> "VIR_ERR_INVALID_SECRET"
+ | VIR_ERR_NO_SECRET -> "VIR_ERR_NO_SECRET"
+ | VIR_ERR_CONFIG_UNSUPPORTED -> "VIR_ERR_CONFIG_UNSUPPORTED"
+ | VIR_ERR_OPERATION_TIMEOUT -> "VIR_ERR_OPERATION_TIMEOUT"
+ | VIR_ERR_MIGRATE_PERSIST_FAILED -> "VIR_ERR_MIGRATE_PERSIST_FAILED"
+ | VIR_ERR_HOOK_SCRIPT_FAILED -> "VIR_ERR_HOOK_SCRIPT_FAILED"
+ | VIR_ERR_INVALID_DOMAIN_SNAPSHOT -> "VIR_ERR_INVALID_DOMAIN_SNAPSHOT"
+ | VIR_ERR_NO_DOMAIN_SNAPSHOT -> "VIR_ERR_NO_DOMAIN_SNAPSHOT"
+ | VIR_ERR_INVALID_STREAM -> "VIR_ERR_INVALID_STREAM"
+ | VIR_ERR_ARGUMENT_UNSUPPORTED -> "VIR_ERR_ARGUMENT_UNSUPPORTED"
+ | VIR_ERR_STORAGE_PROBE_FAILED -> "VIR_ERR_STORAGE_PROBE_FAILED"
+ | VIR_ERR_STORAGE_POOL_BUILT -> "VIR_ERR_STORAGE_POOL_BUILT"
+ | VIR_ERR_SNAPSHOT_REVERT_RISKY -> "VIR_ERR_SNAPSHOT_REVERT_RISKY"
+ | VIR_ERR_OPERATION_ABORTED -> "VIR_ERR_OPERATION_ABORTED"
+ | VIR_ERR_AUTH_CANCELLED -> "VIR_ERR_AUTH_CANCELLED"
+ | VIR_ERR_NO_DOMAIN_METADATA -> "VIR_ERR_NO_DOMAIN_METADATA"
+ | VIR_ERR_MIGRATE_UNSAFE -> "VIR_ERR_MIGRATE_UNSAFE"
+ | VIR_ERR_OVERFLOW -> "VIR_ERR_OVERFLOW"
+ | VIR_ERR_BLOCK_COPY_ACTIVE -> "VIR_ERR_BLOCK_COPY_ACTIVE"
+ | VIR_ERR_OPERATION_UNSUPPORTED -> "VIR_ERR_OPERATION_UNSUPPORTED"
+ | VIR_ERR_SSH -> "VIR_ERR_SSH"
+ | VIR_ERR_AGENT_UNRESPONSIVE -> "VIR_ERR_AGENT_UNRESPONSIVE"
+ | VIR_ERR_RESOURCE_BUSY -> "VIR_ERR_RESOURCE_BUSY"
+ | VIR_ERR_ACCESS_DENIED -> "VIR_ERR_ACCESS_DENIED"
+ | VIR_ERR_DBUS_SERVICE -> "VIR_ERR_DBUS_SERVICE"
+ | VIR_ERR_STORAGE_VOL_EXIST -> "VIR_ERR_STORAGE_VOL_EXIST"
+ | VIR_ERR_CPU_INCOMPATIBLE -> "VIR_ERR_CPU_INCOMPATIBLE"
+ | VIR_ERR_XML_INVALID_SCHEMA -> "VIR_ERR_XML_INVALID_SCHEMA"
+ | VIR_ERR_MIGRATE_FINISH_OK -> "VIR_ERR_MIGRATE_FINISH_OK"
+ | VIR_ERR_AUTH_UNAVAILABLE -> "VIR_ERR_AUTH_UNAVAILABLE"
+ | VIR_ERR_NO_SERVER -> "VIR_ERR_NO_SERVER"
+ | VIR_ERR_NO_CLIENT -> "VIR_ERR_NO_CLIENT"
+ | VIR_ERR_AGENT_UNSYNCED -> "VIR_ERR_AGENT_UNSYNCED"
+ | VIR_ERR_LIBSSH -> "VIR_ERR_LIBSSH"
+ | VIR_ERR_DEVICE_MISSING -> "VIR_ERR_DEVICE_MISSING"
+ | VIR_ERR_INVALID_NWFILTER_BINDING -> "VIR_ERR_INVALID_NWFILTER_BINDING"
+ | VIR_ERR_NO_NWFILTER_BINDING -> "VIR_ERR_NO_NWFILTER_BINDING"
+ | VIR_ERR_INVALID_DOMAIN_CHECKPOINT -> "VIR_ERR_INVALID_DOMAIN_CHECKPOINT"
+ | VIR_ERR_NO_DOMAIN_CHECKPOINT -> "VIR_ERR_NO_DOMAIN_CHECKPOINT"
+ | VIR_ERR_NO_DOMAIN_BACKUP -> "VIR_ERR_NO_DOMAIN_BACKUP"
+ | VIR_ERR_INVALID_NETWORK_PORT -> "VIR_ERR_INVALID_NETWORK_PORT"
+ | VIR_ERR_NETWORK_PORT_EXIST -> "VIR_ERR_NETWORK_PORT_EXIST"
+ | VIR_ERR_NO_NETWORK_PORT -> "VIR_ERR_NO_NETWORK_PORT"
| VIR_ERR_UNKNOWN i -> "VIR_ERR_" ^ string_of_int i
type domain =
@@ -233,7 +385,60 @@ struct
| VIR_FROM_OPENVZ
| VIR_FROM_XENXM
| VIR_FROM_STATS_LINUX
+ | VIR_FROM_LXC
| VIR_FROM_STORAGE
+ | VIR_FROM_NETWORK
+ | VIR_FROM_DOMAIN
+ | VIR_FROM_UML
+ | VIR_FROM_NODEDEV
+ | VIR_FROM_XEN_INOTIFY
+ | VIR_FROM_SECURITY
+ | VIR_FROM_VBOX
+ | VIR_FROM_INTERFACE
+ | VIR_FROM_ONE
+ | VIR_FROM_ESX
+ | VIR_FROM_PHYP
+ | VIR_FROM_SECRET
+ | VIR_FROM_CPU
+ | VIR_FROM_XENAPI
+ | VIR_FROM_NWFILTER
+ | VIR_FROM_HOOK
+ | VIR_FROM_DOMAIN_SNAPSHOT
+ | VIR_FROM_AUDIT
+ | VIR_FROM_SYSINFO
+ | VIR_FROM_STREAMS
+ | VIR_FROM_VMWARE
+ | VIR_FROM_EVENT
+ | VIR_FROM_LIBXL
+ | VIR_FROM_LOCKING
+ | VIR_FROM_HYPERV
+ | VIR_FROM_CAPABILITIES
+ | VIR_FROM_URI
+ | VIR_FROM_AUTH
+ | VIR_FROM_DBUS
+ | VIR_FROM_PARALLELS
+ | VIR_FROM_DEVICE
+ | VIR_FROM_SSH
+ | VIR_FROM_LOCKSPACE
+ | VIR_FROM_INITCTL
+ | VIR_FROM_IDENTITY
+ | VIR_FROM_CGROUP
+ | VIR_FROM_ACCESS
+ | VIR_FROM_SYSTEMD
+ | VIR_FROM_BHYVE
+ | VIR_FROM_CRYPTO
+ | VIR_FROM_FIREWALL
+ | VIR_FROM_POLKIT
+ | VIR_FROM_THREAD
+ | VIR_FROM_ADMIN
+ | VIR_FROM_LOGGING
+ | VIR_FROM_XENXL
+ | VIR_FROM_PERF
+ | VIR_FROM_LIBSSH
+ | VIR_FROM_RESCTRL
+ | VIR_FROM_FIREWALLD
+ | VIR_FROM_DOMAIN_CHECKPOINT
+ | VIR_FROM_TPM
| VIR_FROM_UNKNOWN of int
let string_of_domain = function
@@ -254,7 +459,60 @@ struct
| VIR_FROM_OPENVZ -> "VIR_FROM_OPENVZ"
| VIR_FROM_XENXM -> "VIR_FROM_XENXM"
| VIR_FROM_STATS_LINUX -> "VIR_FROM_STATS_LINUX"
+ | VIR_FROM_LXC -> "VIR_FROM_LXC"
| VIR_FROM_STORAGE -> "VIR_FROM_STORAGE"
+ | VIR_FROM_NETWORK -> "VIR_FROM_NETWORK"
+ | VIR_FROM_DOMAIN -> "VIR_FROM_DOMAIN"
+ | VIR_FROM_UML -> "VIR_FROM_UML"
+ | VIR_FROM_NODEDEV -> "VIR_FROM_NODEDEV"
+ | VIR_FROM_XEN_INOTIFY -> "VIR_FROM_XEN_INOTIFY"
+ | VIR_FROM_SECURITY -> "VIR_FROM_SECURITY"
+ | VIR_FROM_VBOX -> "VIR_FROM_VBOX"
+ | VIR_FROM_INTERFACE -> "VIR_FROM_INTERFACE"
+ | VIR_FROM_ONE -> "VIR_FROM_ONE"
+ | VIR_FROM_ESX -> "VIR_FROM_ESX"
+ | VIR_FROM_PHYP -> "VIR_FROM_PHYP"
+ | VIR_FROM_SECRET -> "VIR_FROM_SECRET"
+ | VIR_FROM_CPU -> "VIR_FROM_CPU"
+ | VIR_FROM_XENAPI -> "VIR_FROM_XENAPI"
+ | VIR_FROM_NWFILTER -> "VIR_FROM_NWFILTER"
+ | VIR_FROM_HOOK -> "VIR_FROM_HOOK"
+ | VIR_FROM_DOMAIN_SNAPSHOT -> "VIR_FROM_DOMAIN_SNAPSHOT"
+ | VIR_FROM_AUDIT -> "VIR_FROM_AUDIT"
+ | VIR_FROM_SYSINFO -> "VIR_FROM_SYSINFO"
+ | VIR_FROM_STREAMS -> "VIR_FROM_STREAMS"
+ | VIR_FROM_VMWARE -> "VIR_FROM_VMWARE"
+ | VIR_FROM_EVENT -> "VIR_FROM_EVENT"
+ | VIR_FROM_LIBXL -> "VIR_FROM_LIBXL"
+ | VIR_FROM_LOCKING -> "VIR_FROM_LOCKING"
+ | VIR_FROM_HYPERV -> "VIR_FROM_HYPERV"
+ | VIR_FROM_CAPABILITIES -> "VIR_FROM_CAPABILITIES"
+ | VIR_FROM_URI -> "VIR_FROM_URI"
+ | VIR_FROM_AUTH -> "VIR_FROM_AUTH"
+ | VIR_FROM_DBUS -> "VIR_FROM_DBUS"
+ | VIR_FROM_PARALLELS -> "VIR_FROM_PARALLELS"
+ | VIR_FROM_DEVICE -> "VIR_FROM_DEVICE"
+ | VIR_FROM_SSH -> "VIR_FROM_SSH"
+ | VIR_FROM_LOCKSPACE -> "VIR_FROM_LOCKSPACE"
+ | VIR_FROM_INITCTL -> "VIR_FROM_INITCTL"
+ | VIR_FROM_IDENTITY -> "VIR_FROM_IDENTITY"
+ | VIR_FROM_CGROUP -> "VIR_FROM_CGROUP"
+ | VIR_FROM_ACCESS -> "VIR_FROM_ACCESS"
+ | VIR_FROM_SYSTEMD -> "VIR_FROM_SYSTEMD"
+ | VIR_FROM_BHYVE -> "VIR_FROM_BHYVE"
+ | VIR_FROM_CRYPTO -> "VIR_FROM_CRYPTO"
+ | VIR_FROM_FIREWALL -> "VIR_FROM_FIREWALL"
+ | VIR_FROM_POLKIT -> "VIR_FROM_POLKIT"
+ | VIR_FROM_THREAD -> "VIR_FROM_THREAD"
+ | VIR_FROM_ADMIN -> "VIR_FROM_ADMIN"
+ | VIR_FROM_LOGGING -> "VIR_FROM_LOGGING"
+ | VIR_FROM_XENXL -> "VIR_FROM_XENXL"
+ | VIR_FROM_PERF -> "VIR_FROM_PERF"
+ | VIR_FROM_LIBSSH -> "VIR_FROM_LIBSSH"
+ | VIR_FROM_RESCTRL -> "VIR_FROM_RESCTRL"
+ | VIR_FROM_FIREWALLD -> "VIR_FROM_FIREWALLD"
+ | VIR_FROM_DOMAIN_CHECKPOINT -> "VIR_FROM_DOMAIN_CHECKPOINT"
+ | VIR_FROM_TPM -> "VIR_FROM_TPM"
| VIR_FROM_UNKNOWN i -> "VIR_FROM_" ^ string_of_int i
type level =
@@ -318,7 +576,7 @@ struct
type state =
| InfoNoState | InfoRunning | InfoBlocked | InfoPaused
- | InfoShutdown | InfoShutoff | InfoCrashed
+ | InfoShutdown | InfoShutoff | InfoCrashed | InfoPMSuspended
type info = {
state : state;
@@ -337,6 +595,20 @@ struct
cpu : int;
}
+ type domain_create_flag =
+ | START_PAUSED
+ | START_AUTODESTROY
+ | START_BYPASS_CACHE
+ | START_FORCE_BOOT
+ | START_VALIDATE
+ let rec int_of_domain_create_flags = function
+ | [] -> 0
+ | START_PAUSED :: flags -> 1 lor int_of_domain_create_flags flags
+ | START_AUTODESTROY :: flags -> 2 lor int_of_domain_create_flags flags
+ | START_BYPASS_CACHE :: flags -> 4 lor int_of_domain_create_flags flags
+ | START_FORCE_BOOT :: flags -> 8 lor int_of_domain_create_flags flags
+ | START_VALIDATE :: flags -> 16 lor int_of_domain_create_flags flags
+
type sched_param = string * sched_param_value
and sched_param_value =
| SchedFieldInt32 of int32 | SchedFieldUInt32 of int32
@@ -378,6 +650,33 @@ struct
tx_drop : int64;
}
+ type get_all_domain_stats_flag =
+ | GetAllDomainsStatsActive
+ | GetAllDomainsStatsInactive
+ | GetAllDomainsStatsOther
+ | GetAllDomainsStatsPaused
+ | GetAllDomainsStatsPersistent
+ | GetAllDomainsStatsRunning
+ | GetAllDomainsStatsShutoff
+ | GetAllDomainsStatsTransient
+ | GetAllDomainsStatsBacking
+ | GetAllDomainsStatsEnforceStats
+
+ type stats_type =
+ | StatsState | StatsCpuTotal | StatsBalloon | StatsVcpu
+ | StatsInterface | StatsBlock | StatsPerf
+
+ type domain_stats_record = {
+ dom_uuid : uuid;
+ params : typed_param array;
+ }
+
+ type xml_desc_flag =
+ | XmlSecure
+ | XmlInactive
+ | XmlUpdateCPU
+ | XmlMigratable
+
(* The maximum size for Domain.memory_peek and Domain.block_peek
* supported by libvirt. This may change with different versions
* of libvirt in the future, hence it's a function.
@@ -385,6 +684,9 @@ struct
let max_peek _ = 65536
external create_linux : [>`W] Connect.t -> xml -> rw t = "ocaml_libvirt_domain_create_linux"
+ external _create_xml : [>`W] Connect.t -> xml -> int -> rw t = "ocaml_libvirt_domain_create_xml"
+ let create_xml conn xml flags =
+ _create_xml conn xml (int_of_domain_create_flags flags)
external lookup_by_id : 'a Connect.t -> int -> 'a t = "ocaml_libvirt_domain_lookup_by_id"
external lookup_by_uuid : 'a Connect.t -> uuid -> 'a t = "ocaml_libvirt_domain_lookup_by_uuid"
external lookup_by_uuid_string : 'a Connect.t -> string -> 'a t = "ocaml_libvirt_domain_lookup_by_uuid_string"
@@ -408,6 +710,7 @@ struct
external set_memory : [>`W] t -> int64 -> unit = "ocaml_libvirt_domain_set_memory"
external get_info : [>`R] t -> info = "ocaml_libvirt_domain_get_info"
external get_xml_desc : [>`R] t -> xml = "ocaml_libvirt_domain_get_xml_desc"
+ external get_xml_desc_flags : [>`W] t -> xml_desc_flag list -> xml = "ocaml_libvirt_domain_get_xml_desc_flags"
external get_scheduler_type : [>`R] t -> string * int = "ocaml_libvirt_domain_get_scheduler_type"
external get_scheduler_parameters : [>`R] t -> int -> sched_param array = "ocaml_libvirt_domain_get_scheduler_parameters"
external set_scheduler_parameters : [>`W] t -> sched_param array -> unit = "ocaml_libvirt_domain_set_scheduler_parameters"
@@ -429,6 +732,8 @@ struct
external block_peek : [>`W] t -> string -> int64 -> int -> string -> int -> unit = "ocaml_libvirt_domain_block_peek_bytecode" "ocaml_libvirt_domain_block_peek_native"
external memory_peek : [>`W] t -> memory_flag list -> int64 -> int -> string -> int -> unit = "ocaml_libvirt_domain_memory_peek_bytecode" "ocaml_libvirt_domain_memory_peek_native"
+ external get_all_domain_stats : [>`R] Connect.t -> stats_type list -> get_all_domain_stats_flag list -> domain_stats_record array = "ocaml_libvirt_domain_get_all_domain_stats"
+
external const : [>`R] t -> ro t = "%identity"
let get_domains conn flags =
@@ -1275,7 +1580,7 @@ end
module Pool =
struct
type 'rw t
- type pool_state = Inactive | Building | Running | Degraded
+ type pool_state = Inactive | Building | Running | Degraded | Inaccessible
type pool_build_flags = New | Repair | Resize
type pool_delete_flags = Normal | Zeroed
type pool_info = {
@@ -1312,7 +1617,7 @@ end
module Volume =
struct
type 'rw t
- type vol_type = File | Block
+ type vol_type = File | Block | Dir | Network | NetDir | Ploop
type vol_delete_flags = Normal | Zeroed
type vol_info = {
typ : vol_type;
@@ -1335,6 +1640,32 @@ struct
external const : [>`R] t -> ro t = "%identity"
end
+module Secret =
+struct
+ type 'rw t
+ type secret_usage_type =
+ | NoType
+ | Volume
+ | Ceph
+ | ISCSI
+ | TLS
+
+ external lookup_by_uuid : 'a Connect.t -> uuid -> 'a t = "ocaml_libvirt_secret_lookup_by_uuid"
+ external lookup_by_uuid_string : 'a Connect.t -> string -> 'a t = "ocaml_libvirt_secret_lookup_by_uuid_string"
+ external lookup_by_usage : 'a Connect.t -> secret_usage_type -> string -> 'a t = "ocaml_libvirt_secret_lookup_by_usage"
+ external define_xml : [>`W] Connect.t -> xml -> rw t = "ocaml_libvirt_secret_define_xml"
+ external get_uuid : [>`R] t -> uuid = "ocaml_libvirt_secret_get_uuid"
+ external get_uuid_string : [>`R] t -> string = "ocaml_libvirt_secret_get_uuid_string"
+ external get_usage_type : [>`R] t -> secret_usage_type = "ocaml_libvirt_secret_get_usage_type"
+ external get_usage_id : [>`R] t -> string = "ocaml_libvirt_secret_get_usage_id"
+ external get_xml_desc : [>`R] t -> xml = "ocaml_libvirt_secret_get_xml_desc"
+ external set_value : [>`W] t -> bytes -> unit = "ocaml_libvirt_secret_set_value"
+ external get_value : [>`R] t -> bytes = "ocaml_libvirt_secret_get_value"
+ external undefine : [>`W] t -> unit = "ocaml_libvirt_secret_undefine"
+ external free : [>`R] t -> unit = "ocaml_libvirt_secret_free"
+ external const : [>`R] t -> ro t = "%identity"
+end
+
(* Initialization. *)
external c_init : unit -> unit = "ocaml_libvirt_init"
let () =
@@ -1342,4 +1673,9 @@ let () =
"ocaml_libvirt_virterror" (Virterror (Virterror.no_error ()));
Callback.register_exception
"ocaml_libvirt_not_supported" (Not_supported "");
- c_init ()
+ c_init ();
+ Printexc.register_printer (
+ function
+ | Virterror e -> Some (Virterror.to_string e)
+ | _ -> None
+ )
diff --git a/libvirt/libvirt.mli b/libvirt/libvirt.mli
index 36cd113..72e83f9 100644
--- a/libvirt/libvirt.mli
+++ b/libvirt/libvirt.mli
@@ -1,6 +1,6 @@
(** OCaml bindings for libvirt. *)
-(* (C) Copyright 2007 Richard W.M. Jones, Red Hat Inc.
- http://libvirt.org/
+(* (C) Copyright 2007-2015 Richard W.M. Jones, Red Hat Inc.
+ https://libvirt.org/
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -22,7 +22,7 @@
{2 Introduction and examples}
This is a set of bindings for writing OCaml programs to
- manage virtual machines through {{:http://libvirt.org/}libvirt}.
+ manage virtual machines through {{:https://libvirt.org/}libvirt}.
{3 Using libvirt interactively}
@@ -58,7 +58,10 @@ v}
The main modules are {!Libvirt.Connect}, {!Libvirt.Domain} and
{!Libvirt.Network} corresponding respectively to the
- {{:http://libvirt.org/html/libvirt-libvirt.html}virConnect*, virDomain* and virNetwork* functions from libvirt}.
+ {{:https://libvirt.org/html/libvirt-libvirt-host.html}virConnect*},
+ {{:https://libvirt.org/html/libvirt-libvirt-domain.html}virDomain*}, and
+ {{:https://libvirt.org/html/libvirt-libvirt-network.html}virNetwork*}
+ functions from libvirt.
For brevity I usually rename these modules like this:
{[
@@ -128,8 +131,8 @@ printf "uri = %s\n%!" uri
or if your pure OCaml program ever segfaults, please contact the author.
You can force a libvirt object to be freed early by calling
- the [close] function on the object. This shouldn't affect
- the safety of garbage collection and should only be used when
+ the {!Libvirt.Connect.close} function on the object. This shouldn't
+ affect the safety of garbage collection and should only be used when
you want to explicitly free memory. Note that explicitly
closing a connection object does nothing if there are still
unclosed domain or network objects referencing it.
@@ -142,7 +145,7 @@ printf "uri = %s\n%!" uri
{3 Backwards and forwards compatibility}
- OCaml-libvirt requires libvirt version 1.0.2 or later. Future
+ OCaml-libvirt requires libvirt version 1.2.8 or later. Future
releases of OCaml-libvirt will use newer features of libvirt
and therefore will require later versions of libvirt. It is always
possible to dynamically link your application against a newer
@@ -199,7 +202,7 @@ val get_version : ?driver:string -> unit -> int * int
in the second part.
The version numbers are encoded as
- 1,000,000 * major + 1,000 * minor + release.
+ [major * 1_000_000 + minor * 1000 + release].
*)
val uuid_length : int
@@ -211,7 +214,7 @@ val uuid_string_length : int
type rw = [`R|`W]
type ro = [`R]
(** These
- {{:http://caml.inria.fr/pub/ml-archives/caml-list/2004/07/80683af867cce6bf8fff273973f70c95.en.html}phantom types}
+ {{:https://caml.inria.fr/pub/ml-archives/caml-list/2004/07/80683af867cce6bf8fff273973f70c95.en.html}phantom types}
are used to ensure the type-safety of read-only
versus read-write connections.
@@ -260,13 +263,65 @@ sig
threads : int; (** number of threads per core *)
}
+ type credential_type =
+ | CredentialUsername (** Identity to act as *)
+ | CredentialAuthname (** Identify to authorize as *)
+ | CredentialLanguage (** RFC 1766 languages, comma separated *)
+ | CredentialCnonce (** client supplies a nonce *)
+ | CredentialPassphrase (** Passphrase secret *)
+ | CredentialEchoprompt (** Challenge response *)
+ | CredentialNoechoprompt (** Challenge response *)
+ | CredentialRealm (** Authentication realm *)
+ | CredentialExternal (** Externally managed credential *)
+
+ type credential = {
+ typ : credential_type; (** The type of credential *)
+ prompt : string; (** Prompt to show to user *)
+ challenge : string option; (** Additional challenge to show *)
+ defresult : string option; (** Optional default result *)
+ }
+
+ type auth = {
+ credtype : credential_type list; (** List of supported credential_type values *)
+ cb : (credential list -> string option list);
+ (** Callback used to collect credentials.
+
+ The input is a list of all the requested credentials.
+
+ The function returns a list of all the results from the
+ requested credentials, so the number of results {e must} match
+ the number of input credentials. Each result is optional,
+ and in case it is [None] it means there was no result.
+ *)
+ }
+
val connect : ?name:string -> unit -> rw t
- val connect_readonly : ?name:string -> unit -> ro t
(** [connect ~name ()] connects to the hypervisor with URI [name].
[connect ()] connects to the default hypervisor.
+ *)
+ val connect_readonly : ?name:string -> unit -> ro t
+ (** [connect_readonly ~name ()] connects in read-only mode
+ to the hypervisor with URI [name].
+
+ [connect_readonly ()] connects in read-only mode to the
+ default hypervisor.
+ *)
+
+ val connect_auth : ?name:string -> auth -> rw t
+ (** [connect_auth ~name auth] connects to the hypervisor with URI
+ [name], using [auth] as authentication handler.
+
+ [connect_auth auth] connects to the default hypervisor, using
+ [auth] as authentication handler.
+ *)
+ val connect_auth_readonly : ?name:string -> auth -> ro t
+ (** [connect_auth_readonly ~name auth] connects in read-only mode
+ to the hypervisor with URI [name], using [auth] as authentication
+ handler.
- [connect_readonly] is the same but connects in read-only mode.
+ [connect_auth_readonly auth] connects in read-only mode to the
+ default hypervisor, using [auth] as authentication handler.
*)
val close : [>`R] t -> unit
@@ -347,6 +402,10 @@ sig
(* The name of this function is inconsistent, but the inconsistency
* is really in libvirt itself.
*)
+ val num_of_secrets : [>`R] t -> int
+ (** Returns the number of secrets. *)
+ val list_secrets : [>`R] t -> int -> string array
+ (** Returns the list of secrets. *)
val get_node_info : [>`R] t -> node_info
(** Return information about the physical server. *)
@@ -376,11 +435,11 @@ sig
CPU map between a single virtual and all physical CPUs of a domain.
*)
- val use_cpu : string -> int -> unit
+ val use_cpu : bytes -> int -> unit
(** [use_cpu cpumap cpu] marks [cpu] as usable in [cpumap]. *)
- val unuse_cpu : string -> int -> unit
+ val unuse_cpu : bytes -> int -> unit
(** [unuse_cpu cpumap cpu] marks [cpu] as not usable in [cpumap]. *)
- val cpu_usable : string -> int -> int -> int -> bool
+ val cpu_usable : bytes -> int -> int -> int -> bool
(** [cpu_usable cpumaps maplen vcpu cpu] checks returns true iff the
[cpu] is usable by [vcpu]. *)
@@ -392,6 +451,27 @@ sig
Note: the client has to implement and run an event loop to
be able to use keep-alive messages. *)
+ val get_auth_default : unit -> auth
+ (** [get_auth_default ()] returns the default authentication handler
+ of libvirt.
+ *)
+
+ val get_domain_capabilities : ?emulatorbin:string -> ?arch:string -> ?machine:string -> ?virttype:string -> [>`R] t -> string
+ (** [get_domain_capabilities ()] returns the XML with the
+ available capabilities of the emulator or libvirt for domains.
+
+ The optional flag [?emulatorbin] is used to specify a different
+ emulator.
+
+ The optional flag [?arch] is used to specify a different
+ architecture.
+
+ The optional flag [?machine] is used to specify a different
+ machine type.
+
+ The optional flag [?virttype] is used to specify a different
+ type of virtualization. *)
+
external const : [>`R] t -> ro t = "%identity"
(** [const conn] turns a read/write connection into a read-only
connection. Note that the opposite operation is impossible.
@@ -411,7 +491,7 @@ sig
type state =
| InfoNoState | InfoRunning | InfoBlocked | InfoPaused
- | InfoShutdown | InfoShutoff | InfoCrashed
+ | InfoShutdown | InfoShutoff | InfoCrashed | InfoPMSuspended
type info = {
state : state; (** running state *)
@@ -430,6 +510,13 @@ sig
cpu : int; (** real CPU number, -1 if offline *)
}
+ type domain_create_flag =
+ | START_PAUSED (** Launch guest in paused state *)
+ | START_AUTODESTROY (** Automatically kill guest on close *)
+ | START_BYPASS_CACHE (** Avoid filesystem cache pollution *)
+ | START_FORCE_BOOT (** Discard any managed save *)
+ | START_VALIDATE (** Validate XML against schema *)
+
type sched_param = string * sched_param_value
and sched_param_value =
| SchedFieldInt32 of int32 | SchedFieldUInt32 of int32
@@ -471,6 +558,33 @@ sig
tx_drop : int64;
}
+ type get_all_domain_stats_flag =
+ | GetAllDomainsStatsActive
+ | GetAllDomainsStatsInactive
+ | GetAllDomainsStatsOther
+ | GetAllDomainsStatsPaused
+ | GetAllDomainsStatsPersistent
+ | GetAllDomainsStatsRunning
+ | GetAllDomainsStatsShutoff
+ | GetAllDomainsStatsTransient
+ | GetAllDomainsStatsBacking
+ | GetAllDomainsStatsEnforceStats
+
+ type stats_type =
+ | StatsState | StatsCpuTotal | StatsBalloon | StatsVcpu
+ | StatsInterface | StatsBlock | StatsPerf
+
+ type domain_stats_record = {
+ dom_uuid : uuid;
+ params : typed_param array;
+ }
+
+ type xml_desc_flag =
+ | XmlSecure (** dump security sensitive information too *)
+ | XmlInactive (** dump inactive domain information *)
+ | XmlUpdateCPU (** update guest CPU requirements according to host CPU *)
+ | XmlMigratable (** dump XML suitable for migration *)
+
val max_peek : [>`R] t -> int
(** Maximum size supported by the {!block_peek} and {!memory_peek}
functions. If you want to peek more than this then you must
@@ -479,7 +593,10 @@ sig
val create_linux : [>`W] Connect.t -> xml -> rw t
(** Create a new guest domain (not necessarily a Linux one)
from the given XML.
+ @deprecated Use {!create_xml} instead.
*)
+ val create_xml : [>`W] Connect.t -> xml -> domain_create_flag list -> rw t
+ (** Create a new guest domain from the given XML. *)
val lookup_by_id : 'a Connect.t -> int -> 'a t
(** Lookup a domain by ID. *)
val lookup_by_uuid : 'a Connect.t -> uuid -> 'a t
@@ -533,6 +650,9 @@ sig
(** Get information about a domain. *)
val get_xml_desc : [>`R] t -> xml
(** Get the XML description of a domain. *)
+ val get_xml_desc_flags : [>`W] t -> xml_desc_flag list -> xml
+ (** Get the XML description of a domain, with the possibility
+ to specify flags. *)
val get_scheduler_type : [>`R] t -> string * int
(** Get the scheduler type. *)
val get_scheduler_parameters : [>`R] t -> int -> sched_param array
@@ -606,6 +726,13 @@ sig
See also {!max_peek}. *)
+ external get_all_domain_stats : [>`R] Connect.t -> stats_type list -> get_all_domain_stats_flag list -> domain_stats_record array = "ocaml_libvirt_domain_get_all_domain_stats"
+ (** [get_all_domain_stats conn stats flags] allows you to read
+ all stats across multiple/all domains in a single call.
+
+ See the libvirt documentation for
+ [virConnectGetAllDomainStats]. *)
+
external const : [>`R] t -> ro t = "%identity"
(** [const dom] turns a read/write domain handle into a read-only
domain handle. Note that the opposite operation is impossible.
@@ -970,7 +1097,7 @@ sig
to receive notification of arbitrary domain events. Return
a registration id which can be used in [deregister_any].
- If [?dom] is None then register for this kind of event on
+ If [?dom] is [None] then register for this kind of event on
all domains. If [dom] is [Some d] then register for this
kind of event only on [d].
*)
@@ -1056,7 +1183,7 @@ sig
type 'rw t
(** Storage pool handle. *)
- type pool_state = Inactive | Building | Running | Degraded
+ type pool_state = Inactive | Building | Running | Degraded | Inaccessible
(** State of the storage pool. *)
type pool_build_flags = New | Repair | Resize
@@ -1135,7 +1262,7 @@ sig
type 'rw t
(** Storage volume handle. *)
- type vol_type = File | Block
+ type vol_type = File | Block | Dir | Network | NetDir | Ploop
(** Type of a storage volume. *)
type vol_delete_flags = Normal | Zeroed
@@ -1185,6 +1312,65 @@ sig
end
(** Module dealing with storage volumes. *)
+(** {3 Secrets} *)
+
+module Secret :
+sig
+ type 'rw t
+ (** Secret handle. *)
+
+ type secret_usage_type =
+ | NoType
+ | Volume
+ | Ceph
+ | ISCSI
+ | TLS
+ (** Usage type of a secret. *)
+
+ val lookup_by_uuid : 'a Connect.t -> uuid -> 'a t
+ (** Lookup a secret by UUID. This uses the packed byte array UUID. *)
+ val lookup_by_uuid_string : 'a Connect.t -> string -> 'a t
+ (** Lookup a secret by (string) UUID. *)
+ val lookup_by_usage : 'a Connect.t -> secret_usage_type -> string -> 'a t
+ (** Lookup a secret by usage type, and usage ID. *)
+
+ val define_xml : [>`W] Connect.t -> xml -> rw t
+ (** Define a secret. *)
+
+ val get_uuid : [>`R] t -> uuid
+ (** Get the UUID (as a packed byte array) of the secret. *)
+ val get_uuid_string : [>`R] t -> string
+ (** Get the UUID (as a printable string) of the secret. *)
+ val get_usage_type : [>`R] t -> secret_usage_type
+ (** Get the usage type of the secret. *)
+ val get_usage_id : [>`R] t -> string
+ (** Get the usage ID of the secret. *)
+ val get_xml_desc : [>`R] t -> xml
+ (** Get the XML description. *)
+
+ val set_value : [>`W] t -> bytes -> unit
+ (** Set a new value for the secret. *)
+ val get_value : [>`R] t -> bytes
+ (** Get the value of the secret. *)
+
+ val undefine : [>`W] t -> unit
+ (** Undefine a secret. *)
+
+ val free : [>`R] t -> unit
+ (** Free a secret object in memory.
+
+ The secret object is automatically freed if it is garbage
+ collected. This function just forces it to be freed right
+ away.
+ *)
+
+ external const : [>`R] t -> ro t = "%identity"
+ (** [const conn] turns a read/write secret into a read-only
+ secret. Note that the opposite operation is impossible.
+ *)
+end
+ (** Module dealing with secrets. *)
+
(** {3 Error handling and exceptions} *)
module Virterror :
@@ -1241,9 +1427,66 @@ sig
| VIR_WAR_NO_STORAGE
| VIR_ERR_NO_STORAGE_POOL
| VIR_ERR_NO_STORAGE_VOL
+ | VIR_WAR_NO_NODE
+ | VIR_ERR_INVALID_NODE_DEVICE
+ | VIR_ERR_NO_NODE_DEVICE
+ | VIR_ERR_NO_SECURITY_MODEL
+ | VIR_ERR_OPERATION_INVALID
+ | VIR_WAR_NO_INTERFACE
+ | VIR_ERR_NO_INTERFACE
+ | VIR_ERR_INVALID_INTERFACE
+ | VIR_ERR_MULTIPLE_INTERFACES
+ | VIR_WAR_NO_NWFILTER
+ | VIR_ERR_INVALID_NWFILTER
+ | VIR_ERR_NO_NWFILTER
+ | VIR_ERR_BUILD_FIREWALL
+ | VIR_WAR_NO_SECRET
+ | VIR_ERR_INVALID_SECRET
+ | VIR_ERR_NO_SECRET
+ | VIR_ERR_CONFIG_UNSUPPORTED
+ | VIR_ERR_OPERATION_TIMEOUT
+ | VIR_ERR_MIGRATE_PERSIST_FAILED
+ | VIR_ERR_HOOK_SCRIPT_FAILED
+ | VIR_ERR_INVALID_DOMAIN_SNAPSHOT
+ | VIR_ERR_NO_DOMAIN_SNAPSHOT
+ | VIR_ERR_INVALID_STREAM
+ | VIR_ERR_ARGUMENT_UNSUPPORTED
+ | VIR_ERR_STORAGE_PROBE_FAILED
+ | VIR_ERR_STORAGE_POOL_BUILT
+ | VIR_ERR_SNAPSHOT_REVERT_RISKY
+ | VIR_ERR_OPERATION_ABORTED
+ | VIR_ERR_AUTH_CANCELLED
+ | VIR_ERR_NO_DOMAIN_METADATA
+ | VIR_ERR_MIGRATE_UNSAFE
+ | VIR_ERR_OVERFLOW
+ | VIR_ERR_BLOCK_COPY_ACTIVE
+ | VIR_ERR_OPERATION_UNSUPPORTED
+ | VIR_ERR_SSH
+ | VIR_ERR_AGENT_UNRESPONSIVE
+ | VIR_ERR_RESOURCE_BUSY
+ | VIR_ERR_ACCESS_DENIED
+ | VIR_ERR_DBUS_SERVICE
+ | VIR_ERR_STORAGE_VOL_EXIST
+ | VIR_ERR_CPU_INCOMPATIBLE
+ | VIR_ERR_XML_INVALID_SCHEMA
+ | VIR_ERR_MIGRATE_FINISH_OK
+ | VIR_ERR_AUTH_UNAVAILABLE
+ | VIR_ERR_NO_SERVER
+ | VIR_ERR_NO_CLIENT
+ | VIR_ERR_AGENT_UNSYNCED
+ | VIR_ERR_LIBSSH
+ | VIR_ERR_DEVICE_MISSING
+ | VIR_ERR_INVALID_NWFILTER_BINDING
+ | VIR_ERR_NO_NWFILTER_BINDING
+ | VIR_ERR_INVALID_DOMAIN_CHECKPOINT
+ | VIR_ERR_NO_DOMAIN_CHECKPOINT
+ | VIR_ERR_NO_DOMAIN_BACKUP
+ | VIR_ERR_INVALID_NETWORK_PORT
+ | VIR_ERR_NETWORK_PORT_EXIST
+ | VIR_ERR_NO_NETWORK_PORT
(* ^^ NB: If you add a variant you MUST edit
libvirt_c_epilogue.c:MAX_VIR_* *)
- | VIR_ERR_UNKNOWN of int
+ | VIR_ERR_UNKNOWN of int (** Other error, not handled with existing values. *)
(** See [<libvirt/virterror.h>] for meaning of these codes. *)
val string_of_code : code -> string
@@ -1266,10 +1509,63 @@ sig
| VIR_FROM_OPENVZ
| VIR_FROM_XENXM
| VIR_FROM_STATS_LINUX
+ | VIR_FROM_LXC
| VIR_FROM_STORAGE
+ | VIR_FROM_NETWORK
+ | VIR_FROM_DOMAIN
+ | VIR_FROM_UML
+ | VIR_FROM_NODEDEV
+ | VIR_FROM_XEN_INOTIFY
+ | VIR_FROM_SECURITY
+ | VIR_FROM_VBOX
+ | VIR_FROM_INTERFACE
+ | VIR_FROM_ONE
+ | VIR_FROM_ESX
+ | VIR_FROM_PHYP
+ | VIR_FROM_SECRET
+ | VIR_FROM_CPU
+ | VIR_FROM_XENAPI
+ | VIR_FROM_NWFILTER
+ | VIR_FROM_HOOK
+ | VIR_FROM_DOMAIN_SNAPSHOT
+ | VIR_FROM_AUDIT
+ | VIR_FROM_SYSINFO
+ | VIR_FROM_STREAMS
+ | VIR_FROM_VMWARE
+ | VIR_FROM_EVENT
+ | VIR_FROM_LIBXL
+ | VIR_FROM_LOCKING
+ | VIR_FROM_HYPERV
+ | VIR_FROM_CAPABILITIES
+ | VIR_FROM_URI
+ | VIR_FROM_AUTH
+ | VIR_FROM_DBUS
+ | VIR_FROM_PARALLELS
+ | VIR_FROM_DEVICE
+ | VIR_FROM_SSH
+ | VIR_FROM_LOCKSPACE
+ | VIR_FROM_INITCTL
+ | VIR_FROM_IDENTITY
+ | VIR_FROM_CGROUP
+ | VIR_FROM_ACCESS
+ | VIR_FROM_SYSTEMD
+ | VIR_FROM_BHYVE
+ | VIR_FROM_CRYPTO
+ | VIR_FROM_FIREWALL
+ | VIR_FROM_POLKIT
+ | VIR_FROM_THREAD
+ | VIR_FROM_ADMIN
+ | VIR_FROM_LOGGING
+ | VIR_FROM_XENXL
+ | VIR_FROM_PERF
+ | VIR_FROM_LIBSSH
+ | VIR_FROM_RESCTRL
+ | VIR_FROM_FIREWALLD
+ | VIR_FROM_DOMAIN_CHECKPOINT
+ | VIR_FROM_TPM
(* ^^ NB: If you add a variant you MUST edit
libvirt_c_epilogue.c: MAX_VIR_* *)
- | VIR_FROM_UNKNOWN of int
+ | VIR_FROM_UNKNOWN of int (** Other domain, not handled with existing values. *)
(** Subsystem / driver which produced the error. *)
val string_of_domain : domain -> string
@@ -1279,7 +1575,7 @@ sig
| VIR_ERR_WARNING
| VIR_ERR_ERROR
(* ^^ NB: If you add a variant you MUST edit libvirt_c.c: MAX_VIR_* *)
- | VIR_ERR_UNKNOWN_LEVEL of int
+ | VIR_ERR_UNKNOWN_LEVEL of int (** Other level, not handled with existing values. *)
(** No error, a warning or an error. *)
val string_of_level : level -> string
@@ -1337,7 +1633,7 @@ exception Not_supported of string
not supported at either compile or run time. This applies to
any libvirt function added after version 0.2.1.
- See also {{:http://libvirt.org/hvsupport.html}http://libvirt.org/hvsupport.html}
+ See also {{:https://libvirt.org/hvsupport.html}https://libvirt.org/hvsupport.html}
*)
(** {3 Utility functions} *)
diff --git a/libvirt/libvirt_c.c b/libvirt/libvirt_c.c
deleted file mode 100644
index 71e6f61..0000000
--- a/libvirt/libvirt_c.c
+++ /dev/null
@@ -1,2092 +0,0 @@
-/* !!! WARNING WARNING WARNING WARNING WARNING WARNING WARNING !!!
- *
- * THIS FILE IS AUTOMATICALLY GENERATED BY 'generator.pl'.
- *
- * Any changes you make to this file may be overwritten.
- */
-
-/* OCaml bindings for libvirt.
- * (C) Copyright 2007-2008 Richard W.M. Jones, Red Hat Inc.
- * http://libvirt.org/
- *
- * 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,
- * with the OCaml linking exception described in ../COPYING.LIB.
- *
- * 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
- */
-
-#include "config.h"
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include <libvirt/libvirt.h>
-#include <libvirt/virterror.h>
-
-#include <caml/config.h>
-#include <caml/alloc.h>
-#include <caml/callback.h>
-#include <caml/custom.h>
-#include <caml/fail.h>
-#include <caml/memory.h>
-#include <caml/misc.h>
-#include <caml/mlvalues.h>
-#include <caml/signals.h>
-
-#include "libvirt_c_prologue.c"
-
-#include "libvirt_c_oneoffs.c"
-
-/* Automatically generated binding for virConnectClose.
- * In generator.pl this function has signature "conn : free".
- */
-
-CAMLprim value
-ocaml_libvirt_connect_close (value connv)
-{
- CAMLparam1 (connv);
-
- virConnectPtr conn = Connect_val (connv);
- int r;
-
- NONBLOCKING (r = virConnectClose (conn));
- CHECK_ERROR (r == -1, conn, "virConnectClose");
-
- /* So that we don't double-free in the finalizer: */
- Connect_val (connv) = NULL;
-
- CAMLreturn (Val_unit);
-}
-
-/* Automatically generated binding for virConnectGetHostname.
- * In generator.pl this function has signature "conn : string".
- */
-
-CAMLprim value
-ocaml_libvirt_connect_get_hostname (value connv)
-{
- CAMLparam1 (connv);
-
- CAMLlocal1 (rv);
- virConnectPtr conn = Connect_val (connv);
- char *r;
-
- NONBLOCKING (r = virConnectGetHostname (conn));
- CHECK_ERROR (!r, conn, "virConnectGetHostname");
-
- rv = caml_copy_string (r);
- free (r);
- CAMLreturn (rv);
-}
-
-/* Automatically generated binding for virConnectGetURI.
- * In generator.pl this function has signature "conn : string".
- */
-
-CAMLprim value
-ocaml_libvirt_connect_get_uri (value connv)
-{
- CAMLparam1 (connv);
-
- CAMLlocal1 (rv);
- virConnectPtr conn = Connect_val (connv);
- char *r;
-
- NONBLOCKING (r = virConnectGetURI (conn));
- CHECK_ERROR (!r, conn, "virConnectGetURI");
-
- rv = caml_copy_string (r);
- free (r);
- CAMLreturn (rv);
-}
-
-/* Automatically generated binding for virConnectGetType.
- * In generator.pl this function has signature "conn : static string".
- */
-
-CAMLprim value
-ocaml_libvirt_connect_get_type (value connv)
-{
- CAMLparam1 (connv);
-
- CAMLlocal1 (rv);
- virConnectPtr conn = Connect_val (connv);
- const char *r;
-
- NONBLOCKING (r = virConnectGetType (conn));
- CHECK_ERROR (!r, conn, "virConnectGetType");
-
- rv = caml_copy_string (r);
- CAMLreturn (rv);
-}
-
-/* Automatically generated binding for virConnectNumOfDomains.
- * In generator.pl this function has signature "conn : int".
- */
-
-CAMLprim value
-ocaml_libvirt_connect_num_of_domains (value connv)
-{
- CAMLparam1 (connv);
-
- virConnectPtr conn = Connect_val (connv);
- int r;
-
- NONBLOCKING (r = virConnectNumOfDomains (conn));
- CHECK_ERROR (r == -1, conn, "virConnectNumOfDomains");
-
- CAMLreturn (Val_int (r));
-}
-
-/* Automatically generated binding for virConnectListDomains.
- * In generator.pl this function has signature "conn, int : int array".
- */
-
-CAMLprim value
-ocaml_libvirt_connect_list_domains (value connv, value iv)
-{
- CAMLparam2 (connv, iv);
-
- CAMLlocal1 (rv);
- virConnectPtr conn = Connect_val (connv);
- int i = Int_val (iv);
- int ids[i], r;
-
- /* Some libvirt List* functions still throw exceptions if i == 0,
- * so catch that and return an empty array directly. This changes
- * the semantics slightly (masking other failures) but it's
- * unlikely anyone will care. RWMJ 2008/06/10
- */
- if (i == 0) {
- rv = caml_alloc (0, 0);
- CAMLreturn (rv);
- }
-
- NONBLOCKING (r = virConnectListDomains (conn, ids, i));
- CHECK_ERROR (r == -1, conn, "virConnectListDomains");
-
- rv = caml_alloc (r, 0);
- for (i = 0; i < r; ++i)
- Store_field (rv, i, Val_int (ids[i]));
-
- CAMLreturn (rv);
-}
-
-/* Automatically generated binding for virConnectNumOfDefinedDomains.
- * In generator.pl this function has signature "conn : int".
- */
-
-CAMLprim value
-ocaml_libvirt_connect_num_of_defined_domains (value connv)
-{
- CAMLparam1 (connv);
-
- virConnectPtr conn = Connect_val (connv);
- int r;
-
- NONBLOCKING (r = virConnectNumOfDefinedDomains (conn));
- CHECK_ERROR (r == -1, conn, "virConnectNumOfDefinedDomains");
-
- CAMLreturn (Val_int (r));
-}
-
-/* Automatically generated binding for virConnectListDefinedDomains.
- * In generator.pl this function has signature "conn, int : string array".
- */
-
-CAMLprim value
-ocaml_libvirt_connect_list_defined_domains (value connv, value iv)
-{
- CAMLparam2 (connv, iv);
-
- CAMLlocal2 (rv, strv);
- virConnectPtr conn = Connect_val (connv);
- int i = Int_val (iv);
- char *names[i];
- int r;
-
- /* Some libvirt List* functions still throw exceptions if i == 0,
- * so catch that and return an empty array directly. This changes
- * the semantics slightly (masking other failures) but it's
- * unlikely anyone will care. RWMJ 2008/06/10
- */
- if (i == 0) {
- rv = caml_alloc (0, 0);
- CAMLreturn (rv);
- }
-
- NONBLOCKING (r = virConnectListDefinedDomains (conn, names, i));
- CHECK_ERROR (r == -1, conn, "virConnectListDefinedDomains");
-
- rv = caml_alloc (r, 0);
- for (i = 0; i < r; ++i) {
- strv = caml_copy_string (names[i]);
- Store_field (rv, i, strv);
- free (names[i]);
- }
-
- CAMLreturn (rv);
-}
-
-/* Automatically generated binding for virConnectNumOfNetworks.
- * In generator.pl this function has signature "conn : int".
- */
-
-CAMLprim value
-ocaml_libvirt_connect_num_of_networks (value connv)
-{
- CAMLparam1 (connv);
-
- virConnectPtr conn = Connect_val (connv);
- int r;
-
- NONBLOCKING (r = virConnectNumOfNetworks (conn));
- CHECK_ERROR (r == -1, conn, "virConnectNumOfNetworks");
-
- CAMLreturn (Val_int (r));
-}
-
-/* Automatically generated binding for virConnectListNetworks.
- * In generator.pl this function has signature "conn, int : string array".
- */
-
-CAMLprim value
-ocaml_libvirt_connect_list_networks (value connv, value iv)
-{
- CAMLparam2 (connv, iv);
-
- CAMLlocal2 (rv, strv);
- virConnectPtr conn = Connect_val (connv);
- int i = Int_val (iv);
- char *names[i];
- int r;
-
- /* Some libvirt List* functions still throw exceptions if i == 0,
- * so catch that and return an empty array directly. This changes
- * the semantics slightly (masking other failures) but it's
- * unlikely anyone will care. RWMJ 2008/06/10
- */
- if (i == 0) {
- rv = caml_alloc (0, 0);
- CAMLreturn (rv);
- }
-
- NONBLOCKING (r = virConnectListNetworks (conn, names, i));
- CHECK_ERROR (r == -1, conn, "virConnectListNetworks");
-
- rv = caml_alloc (r, 0);
- for (i = 0; i < r; ++i) {
- strv = caml_copy_string (names[i]);
- Store_field (rv, i, strv);
- free (names[i]);
- }
-
- CAMLreturn (rv);
-}
-
-/* Automatically generated binding for virConnectNumOfDefinedNetworks.
- * In generator.pl this function has signature "conn : int".
- */
-
-CAMLprim value
-ocaml_libvirt_connect_num_of_defined_networks (value connv)
-{
- CAMLparam1 (connv);
-
- virConnectPtr conn = Connect_val (connv);
- int r;
-
- NONBLOCKING (r = virConnectNumOfDefinedNetworks (conn));
- CHECK_ERROR (r == -1, conn, "virConnectNumOfDefinedNetworks");
-
- CAMLreturn (Val_int (r));
-}
-
-/* Automatically generated binding for virConnectListDefinedNetworks.
- * In generator.pl this function has signature "conn, int : string array".
- */
-
-CAMLprim value
-ocaml_libvirt_connect_list_defined_networks (value connv, value iv)
-{
- CAMLparam2 (connv, iv);
-
- CAMLlocal2 (rv, strv);
- virConnectPtr conn = Connect_val (connv);
- int i = Int_val (iv);
- char *names[i];
- int r;
-
- /* Some libvirt List* functions still throw exceptions if i == 0,
- * so catch that and return an empty array directly. This changes
- * the semantics slightly (masking other failures) but it's
- * unlikely anyone will care. RWMJ 2008/06/10
- */
- if (i == 0) {
- rv = caml_alloc (0, 0);
- CAMLreturn (rv);
- }
-
- NONBLOCKING (r = virConnectListDefinedNetworks (conn, names, i));
- CHECK_ERROR (r == -1, conn, "virConnectListDefinedNetworks");
-
- rv = caml_alloc (r, 0);
- for (i = 0; i < r; ++i) {
- strv = caml_copy_string (names[i]);
- Store_field (rv, i, strv);
- free (names[i]);
- }
-
- CAMLreturn (rv);
-}
-
-/* Automatically generated binding for virConnectNumOfStoragePools.
- * In generator.pl this function has signature "conn : int".
- */
-
-CAMLprim value
-ocaml_libvirt_connect_num_of_storage_pools (value connv)
-{
- CAMLparam1 (connv);
-
- virConnectPtr conn = Connect_val (connv);
- int r;
-
- NONBLOCKING (r = virConnectNumOfStoragePools (conn));
- CHECK_ERROR (r == -1, conn, "virConnectNumOfStoragePools");
-
- CAMLreturn (Val_int (r));
-}
-
-/* Automatically generated binding for virConnectListStoragePools.
- * In generator.pl this function has signature "conn, int : string array".
- */
-
-CAMLprim value
-ocaml_libvirt_connect_list_storage_pools (value connv, value iv)
-{
- CAMLparam2 (connv, iv);
-
- CAMLlocal2 (rv, strv);
- virConnectPtr conn = Connect_val (connv);
- int i = Int_val (iv);
- char *names[i];
- int r;
-
- /* Some libvirt List* functions still throw exceptions if i == 0,
- * so catch that and return an empty array directly. This changes
- * the semantics slightly (masking other failures) but it's
- * unlikely anyone will care. RWMJ 2008/06/10
- */
- if (i == 0) {
- rv = caml_alloc (0, 0);
- CAMLreturn (rv);
- }
-
- NONBLOCKING (r = virConnectListStoragePools (conn, names, i));
- CHECK_ERROR (r == -1, conn, "virConnectListStoragePools");
-
- rv = caml_alloc (r, 0);
- for (i = 0; i < r; ++i) {
- strv = caml_copy_string (names[i]);
- Store_field (rv, i, strv);
- free (names[i]);
- }
-
- CAMLreturn (rv);
-}
-
-/* Automatically generated binding for virConnectNumOfDefinedStoragePools.
- * In generator.pl this function has signature "conn : int".
- */
-
-CAMLprim value
-ocaml_libvirt_connect_num_of_defined_storage_pools (value connv)
-{
- CAMLparam1 (connv);
-
- virConnectPtr conn = Connect_val (connv);
- int r;
-
- NONBLOCKING (r = virConnectNumOfDefinedStoragePools (conn));
- CHECK_ERROR (r == -1, conn, "virConnectNumOfDefinedStoragePools");
-
- CAMLreturn (Val_int (r));
-}
-
-/* Automatically generated binding for virConnectListDefinedStoragePools.
- * In generator.pl this function has signature "conn, int : string array".
- */
-
-CAMLprim value
-ocaml_libvirt_connect_list_defined_storage_pools (value connv, value iv)
-{
- CAMLparam2 (connv, iv);
-
- CAMLlocal2 (rv, strv);
- virConnectPtr conn = Connect_val (connv);
- int i = Int_val (iv);
- char *names[i];
- int r;
-
- /* Some libvirt List* functions still throw exceptions if i == 0,
- * so catch that and return an empty array directly. This changes
- * the semantics slightly (masking other failures) but it's
- * unlikely anyone will care. RWMJ 2008/06/10
- */
- if (i == 0) {
- rv = caml_alloc (0, 0);
- CAMLreturn (rv);
- }
-
- NONBLOCKING (r = virConnectListDefinedStoragePools (conn, names, i));
- CHECK_ERROR (r == -1, conn, "virConnectListDefinedStoragePools");
-
- rv = caml_alloc (r, 0);
- for (i = 0; i < r; ++i) {
- strv = caml_copy_string (names[i]);
- Store_field (rv, i, strv);
- free (names[i]);
- }
-
- CAMLreturn (rv);
-}
-
-/* Automatically generated binding for virConnectGetCapabilities.
- * In generator.pl this function has signature "conn : string".
- */
-
-CAMLprim value
-ocaml_libvirt_connect_get_capabilities (value connv)
-{
- CAMLparam1 (connv);
-
- CAMLlocal1 (rv);
- virConnectPtr conn = Connect_val (connv);
- char *r;
-
- NONBLOCKING (r = virConnectGetCapabilities (conn));
- CHECK_ERROR (!r, conn, "virConnectGetCapabilities");
-
- rv = caml_copy_string (r);
- free (r);
- CAMLreturn (rv);
-}
-
-/* Automatically generated binding for virConnectDomainEventDeregisterAny.
- * In generator.pl this function has signature "conn, int : unit".
- */
-
-CAMLprim value
-ocaml_libvirt_connect_domain_event_deregister_any (value connv, value iv)
-{
- CAMLparam2 (connv, iv);
-
- virConnectPtr conn = Connect_val (connv);
- int i = Int_val (iv);
- int r;
-
- NONBLOCKING (r = virConnectDomainEventDeregisterAny (conn, i));
- CHECK_ERROR (r == -1, conn, "virConnectDomainEventDeregisterAny");
-
- CAMLreturn (Val_unit);
-}
-
-/* Automatically generated binding for virDomainCreateLinux.
- * In generator.pl this function has signature "conn, string, 0U : dom".
- */
-
-CAMLprim value
-ocaml_libvirt_domain_create_linux (value connv, value strv)
-{
- CAMLparam2 (connv, strv);
-
- CAMLlocal1 (rv);
- virConnectPtr conn = Connect_val (connv);
- char *str = String_val (strv);
- virDomainPtr r;
-
- NONBLOCKING (r = virDomainCreateLinux (conn, str, 0));
- CHECK_ERROR (!r, conn, "virDomainCreateLinux");
-
- rv = Val_domain (r, connv);
-
- CAMLreturn (rv);
-}
-
-/* Automatically generated binding for virDomainFree.
- * In generator.pl this function has signature "dom : free".
- */
-
-CAMLprim value
-ocaml_libvirt_domain_free (value domv)
-{
- CAMLparam1 (domv);
-
- virDomainPtr dom = Domain_val (domv);
- virConnectPtr conn = Connect_domv (domv);
- int r;
-
- NONBLOCKING (r = virDomainFree (dom));
- CHECK_ERROR (r == -1, conn, "virDomainFree");
-
- /* So that we don't double-free in the finalizer: */
- Domain_val (domv) = NULL;
-
- CAMLreturn (Val_unit);
-}
-
-/* Automatically generated binding for virDomainDestroy.
- * In generator.pl this function has signature "dom : free".
- */
-
-CAMLprim value
-ocaml_libvirt_domain_destroy (value domv)
-{
- CAMLparam1 (domv);
-
- virDomainPtr dom = Domain_val (domv);
- virConnectPtr conn = Connect_domv (domv);
- int r;
-
- NONBLOCKING (r = virDomainDestroy (dom));
- CHECK_ERROR (r == -1, conn, "virDomainDestroy");
-
- /* So that we don't double-free in the finalizer: */
- Domain_val (domv) = NULL;
-
- CAMLreturn (Val_unit);
-}
-
-/* Automatically generated binding for virDomainLookupByName.
- * In generator.pl this function has signature "conn, string : dom".
- */
-
-CAMLprim value
-ocaml_libvirt_domain_lookup_by_name (value connv, value strv)
-{
- CAMLparam2 (connv, strv);
-
- CAMLlocal1 (rv);
- virConnectPtr conn = Connect_val (connv);
- char *str = String_val (strv);
- virDomainPtr r;
-
- NONBLOCKING (r = virDomainLookupByName (conn, str));
- CHECK_ERROR (!r, conn, "virDomainLookupByName");
-
- rv = Val_domain (r, connv);
-
- CAMLreturn (rv);
-}
-
-/* Automatically generated binding for virDomainLookupByID.
- * In generator.pl this function has signature "conn, int : dom".
- */
-
-CAMLprim value
-ocaml_libvirt_domain_lookup_by_id (value connv, value iv)
-{
- CAMLparam2 (connv, iv);
-
- CAMLlocal1 (rv);
- virConnectPtr conn = Connect_val (connv);
- int i = Int_val (iv);
- virDomainPtr r;
-
- NONBLOCKING (r = virDomainLookupByID (conn, i));
- CHECK_ERROR (!r, conn, "virDomainLookupByID");
-
- rv = Val_domain (r, connv);
-
- CAMLreturn (rv);
-}
-
-/* Automatically generated binding for virDomainLookupByUUID.
- * In generator.pl this function has signature "conn, uuid : dom".
- */
-
-CAMLprim value
-ocaml_libvirt_domain_lookup_by_uuid (value connv, value uuidv)
-{
- CAMLparam2 (connv, uuidv);
-
- CAMLlocal1 (rv);
- virConnectPtr conn = Connect_val (connv);
- unsigned char *uuid = (unsigned char *) String_val (uuidv);
- virDomainPtr r;
-
- NONBLOCKING (r = virDomainLookupByUUID (conn, uuid));
- CHECK_ERROR (!r, conn, "virDomainLookupByUUID");
-
- rv = Val_domain (r, connv);
-
- CAMLreturn (rv);
-}
-
-/* Automatically generated binding for virDomainLookupByUUIDString.
- * In generator.pl this function has signature "conn, string : dom".
- */
-
-CAMLprim value
-ocaml_libvirt_domain_lookup_by_uuid_string (value connv, value strv)
-{
- CAMLparam2 (connv, strv);
-
- CAMLlocal1 (rv);
- virConnectPtr conn = Connect_val (connv);
- char *str = String_val (strv);
- virDomainPtr r;
-
- NONBLOCKING (r = virDomainLookupByUUIDString (conn, str));
- CHECK_ERROR (!r, conn, "virDomainLookupByUUIDString");
-
- rv = Val_domain (r, connv);
-
- CAMLreturn (rv);
-}
-
-/* Automatically generated binding for virDomainGetName.
- * In generator.pl this function has signature "dom : static string".
- */
-
-CAMLprim value
-ocaml_libvirt_domain_get_name (value domv)
-{
- CAMLparam1 (domv);
-
- CAMLlocal1 (rv);
- virDomainPtr dom = Domain_val (domv);
- virConnectPtr conn = Connect_domv (domv);
- const char *r;
-
- NONBLOCKING (r = virDomainGetName (dom));
- CHECK_ERROR (!r, conn, "virDomainGetName");
-
- rv = caml_copy_string (r);
- CAMLreturn (rv);
-}
-
-/* Automatically generated binding for virDomainGetOSType.
- * In generator.pl this function has signature "dom : string".
- */
-
-CAMLprim value
-ocaml_libvirt_domain_get_os_type (value domv)
-{
- CAMLparam1 (domv);
-
- CAMLlocal1 (rv);
- virDomainPtr dom = Domain_val (domv);
- virConnectPtr conn = Connect_domv (domv);
- char *r;
-
- NONBLOCKING (r = virDomainGetOSType (dom));
- CHECK_ERROR (!r, conn, "virDomainGetOSType");
-
- rv = caml_copy_string (r);
- free (r);
- CAMLreturn (rv);
-}
-
-/* Automatically generated binding for virDomainGetXMLDesc.
- * In generator.pl this function has signature "dom, 0 : string".
- */
-
-CAMLprim value
-ocaml_libvirt_domain_get_xml_desc (value domv)
-{
- CAMLparam1 (domv);
-
- CAMLlocal1 (rv);
- virDomainPtr dom = Domain_val (domv);
- virConnectPtr conn = Connect_domv (domv);
- char *r;
-
- NONBLOCKING (r = virDomainGetXMLDesc (dom, 0));
- CHECK_ERROR (!r, conn, "virDomainGetXMLDesc");
-
- rv = caml_copy_string (r);
- free (r);
- CAMLreturn (rv);
-}
-
-/* Automatically generated binding for virDomainGetUUID.
- * In generator.pl this function has signature "dom : uuid".
- */
-
-CAMLprim value
-ocaml_libvirt_domain_get_uuid (value domv)
-{
- CAMLparam1 (domv);
-
- CAMLlocal1 (rv);
- virDomainPtr dom = Domain_val (domv);
- virConnectPtr conn = Connect_domv (domv);
- unsigned char uuid[VIR_UUID_BUFLEN];
- int r;
-
- NONBLOCKING (r = virDomainGetUUID (dom, uuid));
- CHECK_ERROR (r == -1, conn, "virDomainGetUUID");
-
- /* UUIDs are byte arrays with a fixed length. */
- rv = caml_alloc_string (VIR_UUID_BUFLEN);
- memcpy (String_val (rv), uuid, VIR_UUID_BUFLEN);
- CAMLreturn (rv);
-}
-
-/* Automatically generated binding for virDomainGetUUIDString.
- * In generator.pl this function has signature "dom : uuid string".
- */
-
-CAMLprim value
-ocaml_libvirt_domain_get_uuid_string (value domv)
-{
- CAMLparam1 (domv);
-
- CAMLlocal1 (rv);
- virDomainPtr dom = Domain_val (domv);
- virConnectPtr conn = Connect_domv (domv);
- char uuid[VIR_UUID_STRING_BUFLEN];
- int r;
-
- NONBLOCKING (r = virDomainGetUUIDString (dom, uuid));
- CHECK_ERROR (r == -1, conn, "virDomainGetUUIDString");
-
- rv = caml_copy_string (uuid);
- CAMLreturn (rv);
-}
-
-/* Automatically generated binding for virDomainGetMaxVcpus.
- * In generator.pl this function has signature "dom : int".
- */
-
-CAMLprim value
-ocaml_libvirt_domain_get_max_vcpus (value domv)
-{
- CAMLparam1 (domv);
-
- virDomainPtr dom = Domain_val (domv);
- virConnectPtr conn = Connect_domv (domv);
- int r;
-
- NONBLOCKING (r = virDomainGetMaxVcpus (dom));
- CHECK_ERROR (r == -1, conn, "virDomainGetMaxVcpus");
-
- CAMLreturn (Val_int (r));
-}
-
-/* Automatically generated binding for virDomainSave.
- * In generator.pl this function has signature "dom, string : unit".
- */
-
-CAMLprim value
-ocaml_libvirt_domain_save (value domv, value strv)
-{
- CAMLparam2 (domv, strv);
-
- virDomainPtr dom = Domain_val (domv);
- virConnectPtr conn = Connect_domv (domv);
- char *str = String_val (strv);
- int r;
-
- NONBLOCKING (r = virDomainSave (dom, str));
- CHECK_ERROR (r == -1, conn, "virDomainSave");
-
- CAMLreturn (Val_unit);
-}
-
-/* Automatically generated binding for virDomainRestore.
- * In generator.pl this function has signature "conn, string : unit".
- */
-
-CAMLprim value
-ocaml_libvirt_domain_restore (value connv, value strv)
-{
- CAMLparam2 (connv, strv);
-
- virConnectPtr conn = Connect_val (connv);
- char *str = String_val (strv);
- int r;
-
- NONBLOCKING (r = virDomainRestore (conn, str));
- CHECK_ERROR (r == -1, conn, "virDomainRestore");
-
- CAMLreturn (Val_unit);
-}
-
-/* Automatically generated binding for virDomainCoreDump.
- * In generator.pl this function has signature "dom, string, 0 : unit".
- */
-
-CAMLprim value
-ocaml_libvirt_domain_core_dump (value domv, value strv)
-{
- CAMLparam2 (domv, strv);
-
- CAMLlocal1 (rv);
- virDomainPtr dom = Domain_val (domv);
- virConnectPtr conn = Connect_domv (domv);
- char *str = String_val (strv);
- int r;
-
- NONBLOCKING (r = virDomainCoreDump (dom, str, 0));
- CHECK_ERROR (!r, conn, "virDomainCoreDump");
-
- CAMLreturn (Val_unit);
-}
-
-/* Automatically generated binding for virDomainSuspend.
- * In generator.pl this function has signature "dom : unit".
- */
-
-CAMLprim value
-ocaml_libvirt_domain_suspend (value domv)
-{
- CAMLparam1 (domv);
-
- virDomainPtr dom = Domain_val (domv);
- virConnectPtr conn = Connect_domv (domv);
- int r;
-
- NONBLOCKING (r = virDomainSuspend (dom));
- CHECK_ERROR (r == -1, conn, "virDomainSuspend");
-
- CAMLreturn (Val_unit);
-}
-
-/* Automatically generated binding for virDomainResume.
- * In generator.pl this function has signature "dom : unit".
- */
-
-CAMLprim value
-ocaml_libvirt_domain_resume (value domv)
-{
- CAMLparam1 (domv);
-
- virDomainPtr dom = Domain_val (domv);
- virConnectPtr conn = Connect_domv (domv);
- int r;
-
- NONBLOCKING (r = virDomainResume (dom));
- CHECK_ERROR (r == -1, conn, "virDomainResume");
-
- CAMLreturn (Val_unit);
-}
-
-/* Automatically generated binding for virDomainShutdown.
- * In generator.pl this function has signature "dom : unit".
- */
-
-CAMLprim value
-ocaml_libvirt_domain_shutdown (value domv)
-{
- CAMLparam1 (domv);
-
- virDomainPtr dom = Domain_val (domv);
- virConnectPtr conn = Connect_domv (domv);
- int r;
-
- NONBLOCKING (r = virDomainShutdown (dom));
- CHECK_ERROR (r == -1, conn, "virDomainShutdown");
-
- CAMLreturn (Val_unit);
-}
-
-/* Automatically generated binding for virDomainReboot.
- * In generator.pl this function has signature "dom, 0 : unit".
- */
-
-CAMLprim value
-ocaml_libvirt_domain_reboot (value domv)
-{
- CAMLparam1 (domv);
-
- virDomainPtr dom = Domain_val (domv);
- virConnectPtr conn = Connect_domv (domv);
- int r;
-
- NONBLOCKING (r = virDomainReboot (dom, 0));
- CHECK_ERROR (r == -1, conn, "virDomainReboot");
-
- CAMLreturn (Val_unit);
-}
-
-/* Automatically generated binding for virDomainDefineXML.
- * In generator.pl this function has signature "conn, string : dom".
- */
-
-CAMLprim value
-ocaml_libvirt_domain_define_xml (value connv, value strv)
-{
- CAMLparam2 (connv, strv);
-
- CAMLlocal1 (rv);
- virConnectPtr conn = Connect_val (connv);
- char *str = String_val (strv);
- virDomainPtr r;
-
- NONBLOCKING (r = virDomainDefineXML (conn, str));
- CHECK_ERROR (!r, conn, "virDomainDefineXML");
-
- rv = Val_domain (r, connv);
-
- CAMLreturn (rv);
-}
-
-/* Automatically generated binding for virDomainUndefine.
- * In generator.pl this function has signature "dom : unit".
- */
-
-CAMLprim value
-ocaml_libvirt_domain_undefine (value domv)
-{
- CAMLparam1 (domv);
-
- virDomainPtr dom = Domain_val (domv);
- virConnectPtr conn = Connect_domv (domv);
- int r;
-
- NONBLOCKING (r = virDomainUndefine (dom));
- CHECK_ERROR (r == -1, conn, "virDomainUndefine");
-
- CAMLreturn (Val_unit);
-}
-
-/* Automatically generated binding for virDomainCreate.
- * In generator.pl this function has signature "dom : unit".
- */
-
-CAMLprim value
-ocaml_libvirt_domain_create (value domv)
-{
- CAMLparam1 (domv);
-
- virDomainPtr dom = Domain_val (domv);
- virConnectPtr conn = Connect_domv (domv);
- int r;
-
- NONBLOCKING (r = virDomainCreate (dom));
- CHECK_ERROR (r == -1, conn, "virDomainCreate");
-
- CAMLreturn (Val_unit);
-}
-
-/* Automatically generated binding for virDomainAttachDevice.
- * In generator.pl this function has signature "dom, string : unit".
- */
-
-CAMLprim value
-ocaml_libvirt_domain_attach_device (value domv, value strv)
-{
- CAMLparam2 (domv, strv);
-
- virDomainPtr dom = Domain_val (domv);
- virConnectPtr conn = Connect_domv (domv);
- char *str = String_val (strv);
- int r;
-
- NONBLOCKING (r = virDomainAttachDevice (dom, str));
- CHECK_ERROR (r == -1, conn, "virDomainAttachDevice");
-
- CAMLreturn (Val_unit);
-}
-
-/* Automatically generated binding for virDomainDetachDevice.
- * In generator.pl this function has signature "dom, string : unit".
- */
-
-CAMLprim value
-ocaml_libvirt_domain_detach_device (value domv, value strv)
-{
- CAMLparam2 (domv, strv);
-
- virDomainPtr dom = Domain_val (domv);
- virConnectPtr conn = Connect_domv (domv);
- char *str = String_val (strv);
- int r;
-
- NONBLOCKING (r = virDomainDetachDevice (dom, str));
- CHECK_ERROR (r == -1, conn, "virDomainDetachDevice");
-
- CAMLreturn (Val_unit);
-}
-
-/* Automatically generated binding for virDomainGetAutostart.
- * In generator.pl this function has signature "dom : bool".
- */
-
-CAMLprim value
-ocaml_libvirt_domain_get_autostart (value domv)
-{
- CAMLparam1 (domv);
-
- virDomainPtr dom = Domain_val (domv);
- virConnectPtr conn = Connect_domv (domv);
- int r, b;
-
- NONBLOCKING (r = virDomainGetAutostart (dom, &b));
- CHECK_ERROR (r == -1, conn, "virDomainGetAutostart");
-
- CAMLreturn (b ? Val_true : Val_false);
-}
-
-/* Automatically generated binding for virDomainSetAutostart.
- * In generator.pl this function has signature "dom, bool : unit".
- */
-
-CAMLprim value
-ocaml_libvirt_domain_set_autostart (value domv, value bv)
-{
- CAMLparam2 (domv, bv);
-
- virDomainPtr dom = Domain_val (domv);
- virConnectPtr conn = Connect_domv (domv);
- int r, b;
-
- b = bv == Val_true ? 1 : 0;
-
- NONBLOCKING (r = virDomainSetAutostart (dom, b));
- CHECK_ERROR (r == -1, conn, "virDomainSetAutostart");
-
- CAMLreturn (Val_unit);
-}
-
-/* Automatically generated binding for virNetworkFree.
- * In generator.pl this function has signature "net : free".
- */
-
-CAMLprim value
-ocaml_libvirt_network_free (value netv)
-{
- CAMLparam1 (netv);
-
- virNetworkPtr net = Network_val (netv);
- virConnectPtr conn = Connect_netv (netv);
- int r;
-
- NONBLOCKING (r = virNetworkFree (net));
- CHECK_ERROR (r == -1, conn, "virNetworkFree");
-
- /* So that we don't double-free in the finalizer: */
- Network_val (netv) = NULL;
-
- CAMLreturn (Val_unit);
-}
-
-/* Automatically generated binding for virNetworkDestroy.
- * In generator.pl this function has signature "net : free".
- */
-
-CAMLprim value
-ocaml_libvirt_network_destroy (value netv)
-{
- CAMLparam1 (netv);
-
- virNetworkPtr net = Network_val (netv);
- virConnectPtr conn = Connect_netv (netv);
- int r;
-
- NONBLOCKING (r = virNetworkDestroy (net));
- CHECK_ERROR (r == -1, conn, "virNetworkDestroy");
-
- /* So that we don't double-free in the finalizer: */
- Network_val (netv) = NULL;
-
- CAMLreturn (Val_unit);
-}
-
-/* Automatically generated binding for virNetworkLookupByName.
- * In generator.pl this function has signature "conn, string : net".
- */
-
-CAMLprim value
-ocaml_libvirt_network_lookup_by_name (value connv, value strv)
-{
- CAMLparam2 (connv, strv);
-
- CAMLlocal1 (rv);
- virConnectPtr conn = Connect_val (connv);
- char *str = String_val (strv);
- virNetworkPtr r;
-
- NONBLOCKING (r = virNetworkLookupByName (conn, str));
- CHECK_ERROR (!r, conn, "virNetworkLookupByName");
-
- rv = Val_network (r, connv);
-
- CAMLreturn (rv);
-}
-
-/* Automatically generated binding for virNetworkLookupByUUID.
- * In generator.pl this function has signature "conn, uuid : net".
- */
-
-CAMLprim value
-ocaml_libvirt_network_lookup_by_uuid (value connv, value uuidv)
-{
- CAMLparam2 (connv, uuidv);
-
- CAMLlocal1 (rv);
- virConnectPtr conn = Connect_val (connv);
- unsigned char *uuid = (unsigned char *) String_val (uuidv);
- virNetworkPtr r;
-
- NONBLOCKING (r = virNetworkLookupByUUID (conn, uuid));
- CHECK_ERROR (!r, conn, "virNetworkLookupByUUID");
-
- rv = Val_network (r, connv);
-
- CAMLreturn (rv);
-}
-
-/* Automatically generated binding for virNetworkLookupByUUIDString.
- * In generator.pl this function has signature "conn, string : net".
- */
-
-CAMLprim value
-ocaml_libvirt_network_lookup_by_uuid_string (value connv, value strv)
-{
- CAMLparam2 (connv, strv);
-
- CAMLlocal1 (rv);
- virConnectPtr conn = Connect_val (connv);
- char *str = String_val (strv);
- virNetworkPtr r;
-
- NONBLOCKING (r = virNetworkLookupByUUIDString (conn, str));
- CHECK_ERROR (!r, conn, "virNetworkLookupByUUIDString");
-
- rv = Val_network (r, connv);
-
- CAMLreturn (rv);
-}
-
-/* Automatically generated binding for virNetworkGetName.
- * In generator.pl this function has signature "net : static string".
- */
-
-CAMLprim value
-ocaml_libvirt_network_get_name (value netv)
-{
- CAMLparam1 (netv);
-
- CAMLlocal1 (rv);
- virNetworkPtr net = Network_val (netv);
- virConnectPtr conn = Connect_netv (netv);
- const char *r;
-
- NONBLOCKING (r = virNetworkGetName (net));
- CHECK_ERROR (!r, conn, "virNetworkGetName");
-
- rv = caml_copy_string (r);
- CAMLreturn (rv);
-}
-
-/* Automatically generated binding for virNetworkGetXMLDesc.
- * In generator.pl this function has signature "net, 0 : string".
- */
-
-CAMLprim value
-ocaml_libvirt_network_get_xml_desc (value netv)
-{
- CAMLparam1 (netv);
-
- CAMLlocal1 (rv);
- virNetworkPtr net = Network_val (netv);
- virConnectPtr conn = Connect_netv (netv);
- char *r;
-
- NONBLOCKING (r = virNetworkGetXMLDesc (net, 0));
- CHECK_ERROR (!r, conn, "virNetworkGetXMLDesc");
-
- rv = caml_copy_string (r);
- free (r);
- CAMLreturn (rv);
-}
-
-/* Automatically generated binding for virNetworkGetBridgeName.
- * In generator.pl this function has signature "net : string".
- */
-
-CAMLprim value
-ocaml_libvirt_network_get_bridge_name (value netv)
-{
- CAMLparam1 (netv);
-
- CAMLlocal1 (rv);
- virNetworkPtr net = Network_val (netv);
- virConnectPtr conn = Connect_netv (netv);
- char *r;
-
- NONBLOCKING (r = virNetworkGetBridgeName (net));
- CHECK_ERROR (!r, conn, "virNetworkGetBridgeName");
-
- rv = caml_copy_string (r);
- free (r);
- CAMLreturn (rv);
-}
-
-/* Automatically generated binding for virNetworkGetUUID.
- * In generator.pl this function has signature "net : uuid".
- */
-
-CAMLprim value
-ocaml_libvirt_network_get_uuid (value netv)
-{
- CAMLparam1 (netv);
-
- CAMLlocal1 (rv);
- virNetworkPtr net = Network_val (netv);
- virConnectPtr conn = Connect_netv (netv);
- unsigned char uuid[VIR_UUID_BUFLEN];
- int r;
-
- NONBLOCKING (r = virNetworkGetUUID (net, uuid));
- CHECK_ERROR (r == -1, conn, "virNetworkGetUUID");
-
- /* UUIDs are byte arrays with a fixed length. */
- rv = caml_alloc_string (VIR_UUID_BUFLEN);
- memcpy (String_val (rv), uuid, VIR_UUID_BUFLEN);
- CAMLreturn (rv);
-}
-
-/* Automatically generated binding for virNetworkGetUUIDString.
- * In generator.pl this function has signature "net : uuid string".
- */
-
-CAMLprim value
-ocaml_libvirt_network_get_uuid_string (value netv)
-{
- CAMLparam1 (netv);
-
- CAMLlocal1 (rv);
- virNetworkPtr net = Network_val (netv);
- virConnectPtr conn = Connect_netv (netv);
- char uuid[VIR_UUID_STRING_BUFLEN];
- int r;
-
- NONBLOCKING (r = virNetworkGetUUIDString (net, uuid));
- CHECK_ERROR (r == -1, conn, "virNetworkGetUUIDString");
-
- rv = caml_copy_string (uuid);
- CAMLreturn (rv);
-}
-
-/* Automatically generated binding for virNetworkUndefine.
- * In generator.pl this function has signature "net : unit".
- */
-
-CAMLprim value
-ocaml_libvirt_network_undefine (value netv)
-{
- CAMLparam1 (netv);
-
- virNetworkPtr net = Network_val (netv);
- virConnectPtr conn = Connect_netv (netv);
- int r;
-
- NONBLOCKING (r = virNetworkUndefine (net));
- CHECK_ERROR (r == -1, conn, "virNetworkUndefine");
-
- CAMLreturn (Val_unit);
-}
-
-/* Automatically generated binding for virNetworkCreateXML.
- * In generator.pl this function has signature "conn, string : net".
- */
-
-CAMLprim value
-ocaml_libvirt_network_create_xml (value connv, value strv)
-{
- CAMLparam2 (connv, strv);
-
- CAMLlocal1 (rv);
- virConnectPtr conn = Connect_val (connv);
- char *str = String_val (strv);
- virNetworkPtr r;
-
- NONBLOCKING (r = virNetworkCreateXML (conn, str));
- CHECK_ERROR (!r, conn, "virNetworkCreateXML");
-
- rv = Val_network (r, connv);
-
- CAMLreturn (rv);
-}
-
-/* Automatically generated binding for virNetworkDefineXML.
- * In generator.pl this function has signature "conn, string : net".
- */
-
-CAMLprim value
-ocaml_libvirt_network_define_xml (value connv, value strv)
-{
- CAMLparam2 (connv, strv);
-
- CAMLlocal1 (rv);
- virConnectPtr conn = Connect_val (connv);
- char *str = String_val (strv);
- virNetworkPtr r;
-
- NONBLOCKING (r = virNetworkDefineXML (conn, str));
- CHECK_ERROR (!r, conn, "virNetworkDefineXML");
-
- rv = Val_network (r, connv);
-
- CAMLreturn (rv);
-}
-
-/* Automatically generated binding for virNetworkCreate.
- * In generator.pl this function has signature "net : unit".
- */
-
-CAMLprim value
-ocaml_libvirt_network_create (value netv)
-{
- CAMLparam1 (netv);
-
- virNetworkPtr net = Network_val (netv);
- virConnectPtr conn = Connect_netv (netv);
- int r;
-
- NONBLOCKING (r = virNetworkCreate (net));
- CHECK_ERROR (r == -1, conn, "virNetworkCreate");
-
- CAMLreturn (Val_unit);
-}
-
-/* Automatically generated binding for virNetworkGetAutostart.
- * In generator.pl this function has signature "net : bool".
- */
-
-CAMLprim value
-ocaml_libvirt_network_get_autostart (value netv)
-{
- CAMLparam1 (netv);
-
- virNetworkPtr net = Network_val (netv);
- virConnectPtr conn = Connect_netv (netv);
- int r, b;
-
- NONBLOCKING (r = virNetworkGetAutostart (net, &b));
- CHECK_ERROR (r == -1, conn, "virNetworkGetAutostart");
-
- CAMLreturn (b ? Val_true : Val_false);
-}
-
-/* Automatically generated binding for virNetworkSetAutostart.
- * In generator.pl this function has signature "net, bool : unit".
- */
-
-CAMLprim value
-ocaml_libvirt_network_set_autostart (value netv, value bv)
-{
- CAMLparam2 (netv, bv);
-
- virNetworkPtr net = Network_val (netv);
- virConnectPtr conn = Connect_netv (netv);
- int r, b;
-
- b = bv == Val_true ? 1 : 0;
-
- NONBLOCKING (r = virNetworkSetAutostart (net, b));
- CHECK_ERROR (r == -1, conn, "virNetworkSetAutostart");
-
- CAMLreturn (Val_unit);
-}
-
-/* Automatically generated binding for virStoragePoolFree.
- * In generator.pl this function has signature "pool : free".
- */
-
-CAMLprim value
-ocaml_libvirt_storage_pool_free (value poolv)
-{
- CAMLparam1 (poolv);
-
- virStoragePoolPtr pool = Pool_val (poolv);
- virConnectPtr conn = Connect_polv (poolv);
- int r;
-
- NONBLOCKING (r = virStoragePoolFree (pool));
- CHECK_ERROR (r == -1, conn, "virStoragePoolFree");
-
- /* So that we don't double-free in the finalizer: */
- Pool_val (poolv) = NULL;
-
- CAMLreturn (Val_unit);
-}
-
-/* Automatically generated binding for virStoragePoolDestroy.
- * In generator.pl this function has signature "pool : free".
- */
-
-CAMLprim value
-ocaml_libvirt_storage_pool_destroy (value poolv)
-{
- CAMLparam1 (poolv);
-
- virStoragePoolPtr pool = Pool_val (poolv);
- virConnectPtr conn = Connect_polv (poolv);
- int r;
-
- NONBLOCKING (r = virStoragePoolDestroy (pool));
- CHECK_ERROR (r == -1, conn, "virStoragePoolDestroy");
-
- /* So that we don't double-free in the finalizer: */
- Pool_val (poolv) = NULL;
-
- CAMLreturn (Val_unit);
-}
-
-/* Automatically generated binding for virStoragePoolLookupByName.
- * In generator.pl this function has signature "conn, string : pool".
- */
-
-CAMLprim value
-ocaml_libvirt_storage_pool_lookup_by_name (value connv, value strv)
-{
- CAMLparam2 (connv, strv);
-
- CAMLlocal1 (rv);
- virConnectPtr conn = Connect_val (connv);
- char *str = String_val (strv);
- virStoragePoolPtr r;
-
- NONBLOCKING (r = virStoragePoolLookupByName (conn, str));
- CHECK_ERROR (!r, conn, "virStoragePoolLookupByName");
-
- rv = Val_pool (r, connv);
-
- CAMLreturn (rv);
-}
-
-/* Automatically generated binding for virStoragePoolLookupByUUID.
- * In generator.pl this function has signature "conn, uuid : pool".
- */
-
-CAMLprim value
-ocaml_libvirt_storage_pool_lookup_by_uuid (value connv, value uuidv)
-{
- CAMLparam2 (connv, uuidv);
-
- CAMLlocal1 (rv);
- virConnectPtr conn = Connect_val (connv);
- unsigned char *uuid = (unsigned char *) String_val (uuidv);
- virStoragePoolPtr r;
-
- NONBLOCKING (r = virStoragePoolLookupByUUID (conn, uuid));
- CHECK_ERROR (!r, conn, "virStoragePoolLookupByUUID");
-
- rv = Val_pool (r, connv);
-
- CAMLreturn (rv);
-}
-
-/* Automatically generated binding for virStoragePoolLookupByUUIDString.
- * In generator.pl this function has signature "conn, string : pool".
- */
-
-CAMLprim value
-ocaml_libvirt_storage_pool_lookup_by_uuid_string (value connv, value strv)
-{
- CAMLparam2 (connv, strv);
-
- CAMLlocal1 (rv);
- virConnectPtr conn = Connect_val (connv);
- char *str = String_val (strv);
- virStoragePoolPtr r;
-
- NONBLOCKING (r = virStoragePoolLookupByUUIDString (conn, str));
- CHECK_ERROR (!r, conn, "virStoragePoolLookupByUUIDString");
-
- rv = Val_pool (r, connv);
-
- CAMLreturn (rv);
-}
-
-/* Automatically generated binding for virStoragePoolGetName.
- * In generator.pl this function has signature "pool : static string".
- */
-
-CAMLprim value
-ocaml_libvirt_storage_pool_get_name (value poolv)
-{
- CAMLparam1 (poolv);
-
- CAMLlocal1 (rv);
- virStoragePoolPtr pool = Pool_val (poolv);
- virConnectPtr conn = Connect_polv (poolv);
- const char *r;
-
- NONBLOCKING (r = virStoragePoolGetName (pool));
- CHECK_ERROR (!r, conn, "virStoragePoolGetName");
-
- rv = caml_copy_string (r);
- CAMLreturn (rv);
-}
-
-/* Automatically generated binding for virStoragePoolGetXMLDesc.
- * In generator.pl this function has signature "pool, 0U : string".
- */
-
-CAMLprim value
-ocaml_libvirt_storage_pool_get_xml_desc (value poolv)
-{
- CAMLparam1 (poolv);
-
- CAMLlocal1 (rv);
- virStoragePoolPtr pool = Pool_val (poolv);
- virConnectPtr conn = Connect_polv (poolv);
- char *r;
-
- NONBLOCKING (r = virStoragePoolGetXMLDesc (pool, 0));
- CHECK_ERROR (!r, conn, "virStoragePoolGetXMLDesc");
-
- rv = caml_copy_string (r);
- free (r);
- CAMLreturn (rv);
-}
-
-/* Automatically generated binding for virStoragePoolGetUUID.
- * In generator.pl this function has signature "pool : uuid".
- */
-
-CAMLprim value
-ocaml_libvirt_storage_pool_get_uuid (value poolv)
-{
- CAMLparam1 (poolv);
-
- CAMLlocal1 (rv);
- virStoragePoolPtr pool = Pool_val (poolv);
- virConnectPtr conn = Connect_polv (poolv);
- unsigned char uuid[VIR_UUID_BUFLEN];
- int r;
-
- NONBLOCKING (r = virStoragePoolGetUUID (pool, uuid));
- CHECK_ERROR (r == -1, conn, "virStoragePoolGetUUID");
-
- /* UUIDs are byte arrays with a fixed length. */
- rv = caml_alloc_string (VIR_UUID_BUFLEN);
- memcpy (String_val (rv), uuid, VIR_UUID_BUFLEN);
- CAMLreturn (rv);
-}
-
-/* Automatically generated binding for virStoragePoolGetUUIDString.
- * In generator.pl this function has signature "pool : uuid string".
- */
-
-CAMLprim value
-ocaml_libvirt_storage_pool_get_uuid_string (value poolv)
-{
- CAMLparam1 (poolv);
-
- CAMLlocal1 (rv);
- virStoragePoolPtr pool = Pool_val (poolv);
- virConnectPtr conn = Connect_polv (poolv);
- char uuid[VIR_UUID_STRING_BUFLEN];
- int r;
-
- NONBLOCKING (r = virStoragePoolGetUUIDString (pool, uuid));
- CHECK_ERROR (r == -1, conn, "virStoragePoolGetUUIDString");
-
- rv = caml_copy_string (uuid);
- CAMLreturn (rv);
-}
-
-/* Automatically generated binding for virStoragePoolCreateXML.
- * In generator.pl this function has signature "conn, string, 0U : pool".
- */
-
-CAMLprim value
-ocaml_libvirt_storage_pool_create_xml (value connv, value strv)
-{
- CAMLparam2 (connv, strv);
-
- CAMLlocal1 (rv);
- virConnectPtr conn = Connect_val (connv);
- char *str = String_val (strv);
- virStoragePoolPtr r;
-
- NONBLOCKING (r = virStoragePoolCreateXML (conn, str, 0));
- CHECK_ERROR (!r, conn, "virStoragePoolCreateXML");
-
- rv = Val_pool (r, connv);
-
- CAMLreturn (rv);
-}
-
-/* Automatically generated binding for virStoragePoolDefineXML.
- * In generator.pl this function has signature "conn, string, 0U : pool".
- */
-
-CAMLprim value
-ocaml_libvirt_storage_pool_define_xml (value connv, value strv)
-{
- CAMLparam2 (connv, strv);
-
- CAMLlocal1 (rv);
- virConnectPtr conn = Connect_val (connv);
- char *str = String_val (strv);
- virStoragePoolPtr r;
-
- NONBLOCKING (r = virStoragePoolDefineXML (conn, str, 0));
- CHECK_ERROR (!r, conn, "virStoragePoolDefineXML");
-
- rv = Val_pool (r, connv);
-
- CAMLreturn (rv);
-}
-
-/* Automatically generated binding for virStoragePoolBuild.
- * In generator.pl this function has signature "pool, uint : unit".
- */
-
-CAMLprim value
-ocaml_libvirt_storage_pool_build (value poolv, value iv)
-{
- CAMLparam2 (poolv, iv);
-
- virStoragePoolPtr pool = Pool_val (poolv);
- virConnectPtr conn = Connect_polv (poolv);
- unsigned int i = Int_val (iv);
- int r;
-
- NONBLOCKING (r = virStoragePoolBuild (pool, i));
- CHECK_ERROR (r == -1, conn, "virStoragePoolBuild");
-
- CAMLreturn (Val_unit);
-}
-
-/* Automatically generated binding for virStoragePoolUndefine.
- * In generator.pl this function has signature "pool : unit".
- */
-
-CAMLprim value
-ocaml_libvirt_storage_pool_undefine (value poolv)
-{
- CAMLparam1 (poolv);
-
- virStoragePoolPtr pool = Pool_val (poolv);
- virConnectPtr conn = Connect_polv (poolv);
- int r;
-
- NONBLOCKING (r = virStoragePoolUndefine (pool));
- CHECK_ERROR (r == -1, conn, "virStoragePoolUndefine");
-
- CAMLreturn (Val_unit);
-}
-
-/* Automatically generated binding for virStoragePoolCreate.
- * In generator.pl this function has signature "pool, 0U : unit".
- */
-
-CAMLprim value
-ocaml_libvirt_storage_pool_create (value poolv)
-{
- CAMLparam1 (poolv);
-
- virStoragePoolPtr pool = Pool_val (poolv);
- virConnectPtr conn = Connect_polv (poolv);
- int r;
-
- NONBLOCKING (r = virStoragePoolCreate (pool, 0));
- CHECK_ERROR (r == -1, conn, "virStoragePoolCreate");
-
- CAMLreturn (Val_unit);
-}
-
-/* Automatically generated binding for virStoragePoolDelete.
- * In generator.pl this function has signature "pool, uint : unit".
- */
-
-CAMLprim value
-ocaml_libvirt_storage_pool_delete (value poolv, value iv)
-{
- CAMLparam2 (poolv, iv);
-
- virStoragePoolPtr pool = Pool_val (poolv);
- virConnectPtr conn = Connect_polv (poolv);
- unsigned int i = Int_val (iv);
- int r;
-
- NONBLOCKING (r = virStoragePoolDelete (pool, i));
- CHECK_ERROR (r == -1, conn, "virStoragePoolDelete");
-
- CAMLreturn (Val_unit);
-}
-
-/* Automatically generated binding for virStoragePoolRefresh.
- * In generator.pl this function has signature "pool, 0U : unit".
- */
-
-CAMLprim value
-ocaml_libvirt_storage_pool_refresh (value poolv)
-{
- CAMLparam1 (poolv);
-
- virStoragePoolPtr pool = Pool_val (poolv);
- virConnectPtr conn = Connect_polv (poolv);
- int r;
-
- NONBLOCKING (r = virStoragePoolRefresh (pool, 0));
- CHECK_ERROR (r == -1, conn, "virStoragePoolRefresh");
-
- CAMLreturn (Val_unit);
-}
-
-/* Automatically generated binding for virStoragePoolGetAutostart.
- * In generator.pl this function has signature "pool : bool".
- */
-
-CAMLprim value
-ocaml_libvirt_storage_pool_get_autostart (value poolv)
-{
- CAMLparam1 (poolv);
-
- virStoragePoolPtr pool = Pool_val (poolv);
- virConnectPtr conn = Connect_polv (poolv);
- int r, b;
-
- NONBLOCKING (r = virStoragePoolGetAutostart (pool, &b));
- CHECK_ERROR (r == -1, conn, "virStoragePoolGetAutostart");
-
- CAMLreturn (b ? Val_true : Val_false);
-}
-
-/* Automatically generated binding for virStoragePoolSetAutostart.
- * In generator.pl this function has signature "pool, bool : unit".
- */
-
-CAMLprim value
-ocaml_libvirt_storage_pool_set_autostart (value poolv, value bv)
-{
- CAMLparam2 (poolv, bv);
-
- virStoragePoolPtr pool = Pool_val (poolv);
- virConnectPtr conn = Connect_polv (poolv);
- int r, b;
-
- b = bv == Val_true ? 1 : 0;
-
- NONBLOCKING (r = virStoragePoolSetAutostart (pool, b));
- CHECK_ERROR (r == -1, conn, "virStoragePoolSetAutostart");
-
- CAMLreturn (Val_unit);
-}
-
-/* Automatically generated binding for virStoragePoolNumOfVolumes.
- * In generator.pl this function has signature "pool : int".
- */
-
-CAMLprim value
-ocaml_libvirt_storage_pool_num_of_volumes (value poolv)
-{
- CAMLparam1 (poolv);
-
- virStoragePoolPtr pool = Pool_val (poolv);
- virConnectPtr conn = Connect_polv (poolv);
- int r;
-
- NONBLOCKING (r = virStoragePoolNumOfVolumes (pool));
- CHECK_ERROR (r == -1, conn, "virStoragePoolNumOfVolumes");
-
- CAMLreturn (Val_int (r));
-}
-
-/* Automatically generated binding for virStoragePoolListVolumes.
- * In generator.pl this function has signature "pool, int : string array".
- */
-
-CAMLprim value
-ocaml_libvirt_storage_pool_list_volumes (value poolv, value iv)
-{
- CAMLparam2 (poolv, iv);
-
- CAMLlocal2 (rv, strv);
- virStoragePoolPtr pool = Pool_val (poolv);
- virConnectPtr conn = Connect_polv (poolv);
- int i = Int_val (iv);
- char *names[i];
- int r;
-
- /* Some libvirt List* functions still throw exceptions if i == 0,
- * so catch that and return an empty array directly. This changes
- * the semantics slightly (masking other failures) but it's
- * unlikely anyone will care. RWMJ 2008/06/10
- */
- if (i == 0) {
- rv = caml_alloc (0, 0);
- CAMLreturn (rv);
- }
-
- NONBLOCKING (r = virStoragePoolListVolumes (pool, names, i));
- CHECK_ERROR (r == -1, conn, "virStoragePoolListVolumes");
-
- rv = caml_alloc (r, 0);
- for (i = 0; i < r; ++i) {
- strv = caml_copy_string (names[i]);
- Store_field (rv, i, strv);
- free (names[i]);
- }
-
- CAMLreturn (rv);
-}
-
-/* Automatically generated binding for virStorageVolFree.
- * In generator.pl this function has signature "vol : free".
- */
-
-CAMLprim value
-ocaml_libvirt_storage_vol_free (value volv)
-{
- CAMLparam1 (volv);
-
- virStorageVolPtr vol = Volume_val (volv);
- virConnectPtr conn = Connect_volv (volv);
- int r;
-
- NONBLOCKING (r = virStorageVolFree (vol));
- CHECK_ERROR (r == -1, conn, "virStorageVolFree");
-
- /* So that we don't double-free in the finalizer: */
- Volume_val (volv) = NULL;
-
- CAMLreturn (Val_unit);
-}
-
-/* Automatically generated binding for virStorageVolDelete.
- * In generator.pl this function has signature "vol, uint : unit".
- */
-
-CAMLprim value
-ocaml_libvirt_storage_vol_delete (value volv, value iv)
-{
- CAMLparam2 (volv, iv);
-
- virStorageVolPtr vol = Volume_val (volv);
- virConnectPtr conn = Connect_volv (volv);
- unsigned int i = Int_val (iv);
- int r;
-
- NONBLOCKING (r = virStorageVolDelete (vol, i));
- CHECK_ERROR (r == -1, conn, "virStorageVolDelete");
-
- CAMLreturn (Val_unit);
-}
-
-/* Automatically generated binding for virStorageVolLookupByName.
- * In generator.pl this function has signature "pool, string : vol from pool".
- */
-
-CAMLprim value
-ocaml_libvirt_storage_vol_lookup_by_name (value poolv, value strv)
-{
- CAMLparam2 (poolv, strv);
-
- CAMLlocal2 (rv, connv);
- virStoragePoolPtr pool = Pool_val (poolv);
- virConnectPtr conn = Connect_polv (poolv);
- char *str = String_val (strv);
- virStorageVolPtr r;
-
- NONBLOCKING (r = virStorageVolLookupByName (pool, str));
- CHECK_ERROR (!r, conn, "virStorageVolLookupByName");
-
- connv = Field (poolv, 1);
- rv = Val_volume (r, connv);
-
- CAMLreturn (rv);
-}
-
-/* Automatically generated binding for virStorageVolLookupByKey.
- * In generator.pl this function has signature "conn, string : vol".
- */
-
-CAMLprim value
-ocaml_libvirt_storage_vol_lookup_by_key (value connv, value strv)
-{
- CAMLparam2 (connv, strv);
-
- CAMLlocal1 (rv);
- virConnectPtr conn = Connect_val (connv);
- char *str = String_val (strv);
- virStorageVolPtr r;
-
- NONBLOCKING (r = virStorageVolLookupByKey (conn, str));
- CHECK_ERROR (!r, conn, "virStorageVolLookupByKey");
-
- rv = Val_volume (r, connv);
-
- CAMLreturn (rv);
-}
-
-/* Automatically generated binding for virStorageVolLookupByPath.
- * In generator.pl this function has signature "conn, string : vol".
- */
-
-CAMLprim value
-ocaml_libvirt_storage_vol_lookup_by_path (value connv, value strv)
-{
- CAMLparam2 (connv, strv);
-
- CAMLlocal1 (rv);
- virConnectPtr conn = Connect_val (connv);
- char *str = String_val (strv);
- virStorageVolPtr r;
-
- NONBLOCKING (r = virStorageVolLookupByPath (conn, str));
- CHECK_ERROR (!r, conn, "virStorageVolLookupByPath");
-
- rv = Val_volume (r, connv);
-
- CAMLreturn (rv);
-}
-
-/* Automatically generated binding for virStorageVolCreateXML.
- * In generator.pl this function has signature "pool, string, 0U : vol from pool".
- */
-
-CAMLprim value
-ocaml_libvirt_storage_vol_create_xml (value poolv, value strv)
-{
- CAMLparam2 (poolv, strv);
-
- CAMLlocal2 (rv, connv);
- virStoragePoolPtr pool = Pool_val (poolv);
- virConnectPtr conn = Connect_polv (poolv);
- char *str = String_val (strv);
- virStorageVolPtr r;
-
- NONBLOCKING (r = virStorageVolCreateXML (pool, str, 0));
- CHECK_ERROR (!r, conn, "virStorageVolCreateXML");
-
- connv = Field (poolv, 1);
- rv = Val_volume (r, connv);
-
- CAMLreturn (rv);
-}
-
-/* Automatically generated binding for virStorageVolGetXMLDesc.
- * In generator.pl this function has signature "vol, 0U : string".
- */
-
-CAMLprim value
-ocaml_libvirt_storage_vol_get_xml_desc (value volv)
-{
- CAMLparam1 (volv);
-
- CAMLlocal1 (rv);
- virStorageVolPtr vol = Volume_val (volv);
- virConnectPtr conn = Connect_volv (volv);
- char *r;
-
- NONBLOCKING (r = virStorageVolGetXMLDesc (vol, 0));
- CHECK_ERROR (!r, conn, "virStorageVolGetXMLDesc");
-
- rv = caml_copy_string (r);
- free (r);
- CAMLreturn (rv);
-}
-
-/* Automatically generated binding for virStorageVolGetPath.
- * In generator.pl this function has signature "vol : string".
- */
-
-CAMLprim value
-ocaml_libvirt_storage_vol_get_path (value volv)
-{
- CAMLparam1 (volv);
-
- CAMLlocal1 (rv);
- virStorageVolPtr vol = Volume_val (volv);
- virConnectPtr conn = Connect_volv (volv);
- char *r;
-
- NONBLOCKING (r = virStorageVolGetPath (vol));
- CHECK_ERROR (!r, conn, "virStorageVolGetPath");
-
- rv = caml_copy_string (r);
- free (r);
- CAMLreturn (rv);
-}
-
-/* Automatically generated binding for virStorageVolGetKey.
- * In generator.pl this function has signature "vol : static string".
- */
-
-CAMLprim value
-ocaml_libvirt_storage_vol_get_key (value volv)
-{
- CAMLparam1 (volv);
-
- CAMLlocal1 (rv);
- virStorageVolPtr vol = Volume_val (volv);
- virConnectPtr conn = Connect_volv (volv);
- const char *r;
-
- NONBLOCKING (r = virStorageVolGetKey (vol));
- CHECK_ERROR (!r, conn, "virStorageVolGetKey");
-
- rv = caml_copy_string (r);
- CAMLreturn (rv);
-}
-
-/* Automatically generated binding for virStorageVolGetName.
- * In generator.pl this function has signature "vol : static string".
- */
-
-CAMLprim value
-ocaml_libvirt_storage_vol_get_name (value volv)
-{
- CAMLparam1 (volv);
-
- CAMLlocal1 (rv);
- virStorageVolPtr vol = Volume_val (volv);
- virConnectPtr conn = Connect_volv (volv);
- const char *r;
-
- NONBLOCKING (r = virStorageVolGetName (vol));
- CHECK_ERROR (!r, conn, "virStorageVolGetName");
-
- rv = caml_copy_string (r);
- CAMLreturn (rv);
-}
-
-/* Automatically generated binding for virStoragePoolLookupByVolume.
- * In generator.pl this function has signature "vol : pool from vol".
- */
-
-CAMLprim value
-ocaml_libvirt_storage_pool_lookup_by_volume (value volv)
-{
- CAMLparam1 (volv);
-
- CAMLlocal2 (rv, connv);
- virStorageVolPtr vol = Volume_val (volv);
- virConnectPtr conn = Connect_volv (volv);
- virStoragePoolPtr r;
-
- NONBLOCKING (r = virStoragePoolLookupByVolume (vol));
- CHECK_ERROR (!r, conn, "virStoragePoolLookupByVolume");
-
- connv = Field (volv, 1);
- rv = Val_pool (r, connv);
-
- CAMLreturn (rv);
-}
-
-#include "libvirt_c_epilogue.c"
-
-/* EOF */
diff --git a/libvirt/libvirt_c_epilogue.c b/libvirt/libvirt_c_epilogue.c
index 4649724..37efc43 100644
--- a/libvirt/libvirt_c_epilogue.c
+++ b/libvirt/libvirt_c_epilogue.c
@@ -1,6 +1,6 @@
/* OCaml bindings for libvirt.
* (C) Copyright 2007 Richard W.M. Jones, Red Hat Inc.
- * http://libvirt.org/
+ * https://libvirt.org/
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -20,7 +20,7 @@
/* Please read libvirt/README file. */
-static char *
+static const char *
Optstring_val (value strv)
{
if (strv == Val_int (0)) /* None */
@@ -45,6 +45,22 @@ Val_opt (void *ptr, Val_ptr_t Val_ptr)
CAMLreturn (optv);
}
+static value
+Val_opt_const (const void *ptr, Val_const_ptr_t Val_ptr)
+{
+ CAMLparam0 ();
+ CAMLlocal2 (optv, ptrv);
+
+ if (ptr) { /* Some ptr */
+ optv = caml_alloc (1, 0);
+ ptrv = Val_ptr (ptr);
+ Store_field (optv, 0, ptrv);
+ } else /* None */
+ optv = Val_int (0);
+
+ CAMLreturn (optv);
+}
+
#if 0
static value
option_default (value option, value deflt)
@@ -57,14 +73,14 @@ option_default (value option, value deflt)
#endif
static void
-_raise_virterror (virConnectPtr conn, const char *fn)
+_raise_virterror (const char *fn)
{
CAMLparam0 ();
CAMLlocal1 (rv);
virErrorPtr errp;
struct _virError err;
- errp = conn ? virConnGetLastError (conn) : virGetLastError ();
+ errp = virGetLastError ();
if (!errp) {
/* Fake a _virError structure. */
@@ -84,19 +100,34 @@ _raise_virterror (virConnectPtr conn, const char *fn)
(void) caml__frame;
}
-/* Raise an error if a function is not supported. */
-static void
-not_supported (const char *fn)
+static int
+_list_length (value listv)
+{
+ CAMLparam1 (listv);
+ int len = 0;
+
+ for (; listv != Val_emptylist; listv = Field (listv, 1), ++len) {}
+
+ CAMLreturnT (int, len);
+}
+
+static value
+Val_virconnectcredential (const virConnectCredentialPtr cred)
{
CAMLparam0 ();
- CAMLlocal1 (fnv);
+ CAMLlocal1 (rv);
- fnv = caml_copy_string (fn);
- caml_raise_with_arg (*caml_named_value ("ocaml_libvirt_not_supported"), fnv);
+ rv = caml_alloc (4, 0);
+ Store_field (rv, 0, Val_int (cred->type - 1));
+ Store_field (rv, 1, caml_copy_string (cred->prompt));
+ Store_field (rv, 2,
+ Val_opt_const (cred->challenge,
+ (Val_const_ptr_t) caml_copy_string));
+ Store_field (rv, 3,
+ Val_opt_const (cred->defresult,
+ (Val_const_ptr_t) caml_copy_string));
- /*NOTREACHED*/
- /* Suppresses a compiler warning. */
- (void) caml__frame;
+ CAMLreturn (rv);
}
/* Convert the virErrorNumber, virErrorDomain and virErrorLevel enums
@@ -112,8 +143,8 @@ not_supported (const char *fn)
* to convert it into VIR_*_UNKNOWN (code).
*/
-#define MAX_VIR_CODE 50 /* VIR_ERR_NO_STORAGE_VOL */
-#define MAX_VIR_DOMAIN 17 /* VIR_FROM_STORAGE */
+#define MAX_VIR_CODE 107 /* VIR_ERR_NO_NETWORK_PORT */
+#define MAX_VIR_DOMAIN 70 /* VIR_FROM_TPM */
#define MAX_VIR_LEVEL VIR_ERR_ERROR
static inline value
@@ -122,7 +153,7 @@ Val_err_number (virErrorNumber code)
CAMLparam0 ();
CAMLlocal1 (rv);
- if (0 <= code && code <= MAX_VIR_CODE)
+ if (0 <= (int) code && code <= MAX_VIR_CODE)
rv = Val_int (code);
else {
rv = caml_alloc (1, 0); /* VIR_ERR_UNKNOWN (code) */
@@ -138,7 +169,7 @@ Val_err_domain (virErrorDomain code)
CAMLparam0 ();
CAMLlocal1 (rv);
- if (0 <= code && code <= MAX_VIR_DOMAIN)
+ if (0 <= (int) code && code <= MAX_VIR_DOMAIN)
rv = Val_int (code);
else {
rv = caml_alloc (1, 0); /* VIR_FROM_UNKNOWN (code) */
@@ -154,7 +185,7 @@ Val_err_level (virErrorLevel code)
CAMLparam0 ();
CAMLlocal1 (rv);
- if (0 <= code && code <= MAX_VIR_LEVEL)
+ if (0 <= (int) code && code <= MAX_VIR_LEVEL)
rv = Val_int (code);
else {
rv = caml_alloc (1, 0); /* VIR_ERR_UNKNOWN_LEVEL (code) */
@@ -195,9 +226,10 @@ static void dom_finalize (value);
static void net_finalize (value);
static void pol_finalize (value);
static void vol_finalize (value);
+static void sec_finalize (value);
static struct custom_operations conn_custom_operations = {
- "conn_custom_operations",
+ (char *) "conn_custom_operations",
conn_finalize,
custom_compare_default,
custom_hash_default,
@@ -206,7 +238,7 @@ static struct custom_operations conn_custom_operations = {
};
static struct custom_operations dom_custom_operations = {
- "dom_custom_operations",
+ (char *) "dom_custom_operations",
dom_finalize,
custom_compare_default,
custom_hash_default,
@@ -216,7 +248,7 @@ static struct custom_operations dom_custom_operations = {
};
static struct custom_operations net_custom_operations = {
- "net_custom_operations",
+ (char *) "net_custom_operations",
net_finalize,
custom_compare_default,
custom_hash_default,
@@ -225,7 +257,7 @@ static struct custom_operations net_custom_operations = {
};
static struct custom_operations pol_custom_operations = {
- "pol_custom_operations",
+ (char *) "pol_custom_operations",
pol_finalize,
custom_compare_default,
custom_hash_default,
@@ -234,7 +266,7 @@ static struct custom_operations pol_custom_operations = {
};
static struct custom_operations vol_custom_operations = {
- "vol_custom_operations",
+ (char *) "vol_custom_operations",
vol_finalize,
custom_compare_default,
custom_hash_default,
@@ -242,6 +274,15 @@ static struct custom_operations vol_custom_operations = {
custom_deserialize_default
};
+static struct custom_operations sec_custom_operations = {
+ (char *) "sec_custom_operations",
+ sec_finalize,
+ custom_compare_default,
+ custom_hash_default,
+ custom_serialize_default,
+ custom_deserialize_default
+};
+
static value
Val_connect (virConnectPtr conn)
{
@@ -297,6 +338,17 @@ Val_vol (virStorageVolPtr vol)
CAMLreturn (rv);
}
+static value
+Val_sec (virSecretPtr sec)
+{
+ CAMLparam0 ();
+ CAMLlocal1 (rv);
+ rv = caml_alloc_custom (&sec_custom_operations,
+ sizeof (virSecretPtr), 0, 1);
+ Sec_val (rv) = sec;
+ CAMLreturn (rv);
+}
+
/* This wraps up the (dom, conn) pair (Domain.t). */
static value
Val_domain (virDomainPtr dom, value connv)
@@ -353,6 +405,20 @@ Val_volume (virStorageVolPtr vol, value connv)
CAMLreturn (rv);
}
+/* This wraps up the (sec, conn) pair (Secret.t). */
+static value
+Val_secret (virSecretPtr sec, value connv)
+{
+ CAMLparam1 (connv);
+ CAMLlocal2 (rv, v);
+
+ rv = caml_alloc_tuple (2);
+ v = Val_sec (sec);
+ Store_field (rv, 0, v);
+ Store_field (rv, 1, connv);
+ CAMLreturn (rv);
+}
+
static void
conn_finalize (value connv)
{
@@ -387,3 +453,10 @@ vol_finalize (value volv)
virStorageVolPtr vol = Vol_val (volv);
if (vol) (void) virStorageVolFree (vol);
}
+
+static void
+sec_finalize (value secv)
+{
+ virSecretPtr sec = Sec_val (secv);
+ if (sec) (void) virSecretFree (sec);
+}
diff --git a/libvirt/libvirt_c_oneoffs.c b/libvirt/libvirt_c_oneoffs.c
index 3bb572f..0a9e485 100644
--- a/libvirt/libvirt_c_oneoffs.c
+++ b/libvirt/libvirt_c_oneoffs.c
@@ -1,6 +1,6 @@
/* OCaml bindings for libvirt.
- * (C) Copyright 2007 Richard W.M. Jones, Red Hat Inc.
- * http://libvirt.org/
+ * (C) Copyright 2007-2017 Richard W.M. Jones, Red Hat Inc.
+ * https://libvirt.org/
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -19,6 +19,10 @@
/* Please read libvirt/README file. */
+#ifdef __GNUC__
+#pragma GCC diagnostic ignored "-Wmissing-prototypes"
+#endif
+
/*----------------------------------------------------------------------*/
CAMLprim value
@@ -32,7 +36,7 @@ ocaml_libvirt_get_version (value driverv, value unit)
typeVer_ptr = driver ? &typeVer : NULL;
NONBLOCKING (r = virGetVersion (&libVer, driver, typeVer_ptr));
- CHECK_ERROR (r == -1, NULL, "virGetVersion");
+ CHECK_ERROR (r == -1, "virGetVersion");
rv = caml_alloc_tuple (2);
Store_field (rv, 0, Val_int (libVer));
@@ -53,7 +57,7 @@ ocaml_libvirt_connect_open (value namev, value unit)
virConnectPtr conn;
NONBLOCKING (conn = virConnectOpen (name));
- CHECK_ERROR (!conn, NULL, "virConnectOpen");
+ CHECK_ERROR (!conn, "virConnectOpen");
rv = Val_connect (conn);
@@ -69,8 +73,138 @@ ocaml_libvirt_connect_open_readonly (value namev, value unit)
virConnectPtr conn;
NONBLOCKING (conn = virConnectOpenReadOnly (name));
- CHECK_ERROR (!conn, NULL, "virConnectOpen");
+ CHECK_ERROR (!conn, "virConnectOpen");
+
+ rv = Val_connect (conn);
+
+ CAMLreturn (rv);
+}
+
+/* Helper struct holding data needed for the helper C authentication
+ * callback (which will call the actual OCaml callback).
+ */
+struct ocaml_auth_callback_data {
+ value *fvp; /* The OCaml auth callback. */
+};
+
+static int
+_ocaml_auth_callback (virConnectCredentialPtr cred, unsigned int ncred, void *cbdata)
+{
+ CAMLparam0 ();
+ CAMLlocal4 (listv, elemv, rv, v);
+ struct ocaml_auth_callback_data *s = cbdata;
+ int i, len;
+
+ listv = Val_emptylist;
+ for (i = ncred - 1; i >= 0; --i) {
+ elemv = caml_alloc (2, 0);
+ Store_field (elemv, 0, Val_virconnectcredential (&cred[i]));
+ Store_field (elemv, 1, listv);
+ listv = elemv;
+ }
+
+ /* Call the auth callback. */
+ rv = caml_callback_exn (*s->fvp, listv);
+ if (Is_exception_result (rv)) {
+ /* The callback raised an exception, so return an error. */
+ CAMLreturnT (int, -1);
+ }
+
+ len = _list_length (rv);
+ if (len != (int) ncred) {
+ /* The callback did not return the same number of results as the
+ * credentials.
+ */
+ CAMLreturnT (int, -1);
+ }
+
+ for (i = 0; rv != Val_emptylist; rv = Field (rv, 1), ++i) {
+ virConnectCredentialPtr c = &cred[i];
+ elemv = Field (rv, 0);
+ if (elemv == Val_int (0)) {
+ c->result = NULL;
+ c->resultlen = 0;
+ } else {
+ v = Field (elemv, 0);
+ len = caml_string_length (v);
+ c->result = malloc (len + 1);
+ if (c->result == NULL)
+ CAMLreturnT (int, -1);
+ memcpy (c->result, String_val (v), len);
+ c->result[len] = '\0';
+ c->resultlen = len;
+ }
+ }
+
+ CAMLreturnT (int, 0);
+}
+
+static virConnectPtr
+_ocaml_libvirt_connect_open_auth_common (value namev, value authv, int flags)
+{
+ CAMLparam2 (namev, authv);
+ CAMLlocal2 (listv, fv);
+ virConnectPtr conn;
+ virConnectAuth auth;
+ struct ocaml_auth_callback_data data;
+ int i;
+ char *name = NULL;
+
+ /* Keep a copy of the 'namev' string, as its value could move around
+ * when calling other OCaml code that allocates memory.
+ */
+ if (namev != Val_int (0)) { /* Some string */
+ name = strdup (String_val (Field (namev, 0)));
+ if (name == NULL)
+ caml_raise_out_of_memory ();
+ }
+
+ fv = Field (authv, 1);
+ data.fvp = &fv;
+
+ listv = Field (authv, 0);
+ auth.ncredtype = _list_length (listv);
+ auth.credtype = malloc (sizeof (int) * auth.ncredtype);
+ if (auth.credtype == NULL)
+ caml_raise_out_of_memory ();
+ for (i = 0; listv != Val_emptylist; listv = Field (listv, 1), ++i) {
+ auth.credtype[i] = Int_val (Field (listv, 0)) + 1;
+ }
+ auth.cb = &_ocaml_auth_callback;
+ auth.cbdata = &data;
+
+ /* Call virConnectOpenAuth directly, without using the NONBLOCKING
+ * macro, as this will indeed call ocaml_* APIs, and run OCaml code.
+ */
+ conn = virConnectOpenAuth (name, &auth, flags);
+ free (auth.credtype);
+ free (name);
+ CHECK_ERROR (!conn, "virConnectOpenAuth");
+
+ CAMLreturnT (virConnectPtr, conn);
+}
+
+CAMLprim value
+ocaml_libvirt_connect_open_auth (value namev, value authv)
+{
+ CAMLparam2 (namev, authv);
+ CAMLlocal1 (rv);
+ virConnectPtr conn;
+ conn = _ocaml_libvirt_connect_open_auth_common (namev, authv, 0);
+ rv = Val_connect (conn);
+
+ CAMLreturn (rv);
+}
+
+CAMLprim value
+ocaml_libvirt_connect_open_auth_readonly (value namev, value authv)
+{
+ CAMLparam2 (namev, authv);
+ CAMLlocal1 (rv);
+ virConnectPtr conn;
+
+ conn = _ocaml_libvirt_connect_open_auth_common (namev, authv, VIR_CONNECT_RO);
rv = Val_connect (conn);
CAMLreturn (rv);
@@ -85,7 +219,7 @@ ocaml_libvirt_connect_get_version (value connv)
int r;
NONBLOCKING (r = virConnectGetVersion (conn, &hvVer));
- CHECK_ERROR (r == -1, conn, "virConnectGetVersion");
+ CHECK_ERROR (r == -1, "virConnectGetVersion");
CAMLreturn (Val_int (hvVer));
}
@@ -99,7 +233,7 @@ ocaml_libvirt_connect_get_max_vcpus (value connv, value typev)
int r;
NONBLOCKING (r = virConnectGetMaxVcpus (conn, type));
- CHECK_ERROR (r == -1, conn, "virConnectGetMaxVcpus");
+ CHECK_ERROR (r == -1, "virConnectGetMaxVcpus");
CAMLreturn (Val_int (r));
}
@@ -114,7 +248,7 @@ ocaml_libvirt_connect_get_node_info (value connv)
int r;
NONBLOCKING (r = virNodeGetInfo (conn, &info));
- CHECK_ERROR (r == -1, conn, "virNodeGetInfo");
+ CHECK_ERROR (r == -1, "virNodeGetInfo");
rv = caml_alloc (8, 0);
v = caml_copy_string (info.model); Store_field (rv, 0, v);
@@ -138,9 +272,9 @@ ocaml_libvirt_connect_node_get_free_memory (value connv)
unsigned long long r;
NONBLOCKING (r = virNodeGetFreeMemory (conn));
- CHECK_ERROR (r == 0, conn, "virNodeGetFreeMemory");
+ CHECK_ERROR (r == 0, "virNodeGetFreeMemory");
- rv = caml_copy_int64 ((int64) r);
+ rv = caml_copy_int64 ((int64_t) r);
CAMLreturn (rv);
}
@@ -154,16 +288,21 @@ ocaml_libvirt_connect_node_get_cells_free_memory (value connv,
int start = Int_val (startv);
int max = Int_val (maxv);
int r, i;
- unsigned long long freemems[max];
+ unsigned long long *freemems;
+
+ freemems = malloc(sizeof (*freemems) * max);
+ if (freemems == NULL)
+ caml_raise_out_of_memory ();
NONBLOCKING (r = virNodeGetCellsFreeMemory (conn, freemems, start, max));
- CHECK_ERROR (r == -1, conn, "virNodeGetCellsFreeMemory");
+ CHECK_ERROR_CLEANUP (r == -1, free (freemems), "virNodeGetCellsFreeMemory");
rv = caml_alloc (r, 0);
for (i = 0; i < r; ++i) {
- iv = caml_copy_int64 ((int64) freemems[i]);
+ iv = caml_copy_int64 ((int64_t) freemems[i]);
Store_field (rv, i, iv);
}
+ free (freemems);
CAMLreturn (rv);
}
@@ -179,18 +318,128 @@ ocaml_libvirt_connect_set_keep_alive(value connv,
int r;
NONBLOCKING(r = virConnectSetKeepAlive(conn, interval, count));
- CHECK_ERROR (r == -1, conn, "virConnectSetKeepAlive");
+ CHECK_ERROR (r == -1, "virConnectSetKeepAlive");
CAMLreturn(Val_unit);
}
+CAMLprim value
+ocaml_libvirt_connect_credtypes_from_auth_default (value unitv)
+{
+ CAMLparam1 (unitv);
+ CAMLlocal2 (listv, itemv);
+ int i;
+
+ listv = Val_emptylist;
+
+ if (virConnectAuthPtrDefault) {
+ for (i = virConnectAuthPtrDefault->ncredtype; i >= 0; --i) {
+ const int type = virConnectAuthPtrDefault->credtype[i];
+ itemv = caml_alloc (2, 0);
+ Store_field (itemv, 0, Val_int (type - 1));
+ Store_field (itemv, 1, listv);
+ listv = itemv;
+ }
+ }
+
+ CAMLreturn (listv);
+}
+
+CAMLprim value
+ocaml_libvirt_connect_call_auth_default_callback (value listv)
+{
+ CAMLparam1 (listv);
+ CAMLlocal5 (credv, retv, elemv, optv, v);
+ int i, len, ret;
+ const char *str;
+ virConnectCredentialPtr creds;
+
+ if (virConnectAuthPtrDefault == NULL
+ || virConnectAuthPtrDefault->cb == NULL)
+ CAMLreturn (Val_unit);
+
+ len = _list_length (listv);
+ creds = calloc (len, sizeof (*creds));
+ if (creds == NULL)
+ caml_raise_out_of_memory ();
+ for (i = 0; listv != Val_emptylist; listv = Field (listv, 1), ++i) {
+ virConnectCredentialPtr cred = &creds[i];
+ credv = Field (listv, 0);
+ cred->type = Int_val (Field (credv, 0)) + 1;
+ cred->prompt = strdup (String_val (Field (credv, 1)));
+ if (cred->prompt == NULL)
+ caml_raise_out_of_memory ();
+ str = Optstring_val (Field (credv, 2));
+ if (str) {
+ cred->challenge = strdup (str);
+ if (cred->challenge == NULL)
+ caml_raise_out_of_memory ();
+ }
+ str = Optstring_val (Field (credv, 3));
+ if (str) {
+ cred->defresult = strdup (str);
+ if (cred->defresult == NULL)
+ caml_raise_out_of_memory ();
+ }
+ }
+
+ ret = virConnectAuthPtrDefault->cb (creds, len,
+ virConnectAuthPtrDefault->cbdata);
+ if (ret >= 0) {
+ retv = Val_emptylist;
+ for (i = len - 1; i >= 0; --i) {
+ virConnectCredentialPtr cred = &creds[i];
+ elemv = caml_alloc (2, 0);
+ if (cred->result != NULL && cred->resultlen > 0) {
+ v = caml_alloc_string (cred->resultlen);
+ memcpy (String_val (v), cred->result, cred->resultlen);
+ optv = caml_alloc (1, 0);
+ Store_field (optv, 0, v);
+ } else
+ optv = Val_int (0);
+ Store_field (elemv, 0, optv);
+ Store_field (elemv, 1, retv);
+ retv = elemv;
+ }
+ }
+ for (i = 0; i < len; ++i) {
+ virConnectCredentialPtr cred = &creds[i];
+ /* Cast to char *, as the virConnectCredential structs we fill have
+ * const char * qualifiers.
+ */
+ free ((char *) cred->prompt);
+ free ((char *) cred->challenge);
+ free ((char *) cred->defresult);
+ }
+ free (creds);
+
+ if (ret < 0)
+ caml_failwith ("virConnectAuthPtrDefault callback failed");
+
+ CAMLreturn (retv);
+}
+
+CAMLprim value
+ocaml_libvirt_connect_get_domain_capabilities (value emulatorbinv, value archv, value machinev, value virttypev, value connv)
+{
+ CAMLparam5 (emulatorbinv, archv, machinev, virttypev, connv);
+ CAMLlocal1 (rv);
+ virConnectPtr conn = Connect_val (connv);
+ char *r;
+
+ NONBLOCKING (r = virConnectGetDomainCapabilities (conn, Optstring_val (emulatorbinv), Optstring_val (archv), Optstring_val (machinev), Optstring_val (virttypev), 0));
+ CHECK_ERROR (r == NULL, "virConnectGetDomainCapabilities");
+
+ rv = caml_copy_string (r);
+ free (r);
+ CAMLreturn (rv);
+}
CAMLprim value
ocaml_libvirt_domain_get_id (value domv)
{
CAMLparam1 (domv);
virDomainPtr dom = Domain_val (domv);
- /*virConnectPtr conn = Connect_domv (domv);*/
unsigned int r;
NONBLOCKING (r = virDomainGetID (dom));
@@ -208,11 +457,10 @@ ocaml_libvirt_domain_get_max_memory (value domv)
CAMLparam1 (domv);
CAMLlocal1 (rv);
virDomainPtr dom = Domain_val (domv);
- virConnectPtr conn = Connect_domv (domv);
unsigned long r;
NONBLOCKING (r = virDomainGetMaxMemory (dom));
- CHECK_ERROR (r == 0 /* [sic] */, conn, "virDomainGetMaxMemory");
+ CHECK_ERROR (r == 0 /* [sic] */, "virDomainGetMaxMemory");
rv = caml_copy_int64 (r);
CAMLreturn (rv);
@@ -223,12 +471,11 @@ ocaml_libvirt_domain_set_max_memory (value domv, value memv)
{
CAMLparam2 (domv, memv);
virDomainPtr dom = Domain_val (domv);
- virConnectPtr conn = Connect_domv (domv);
unsigned long mem = Int64_val (memv);
int r;
NONBLOCKING (r = virDomainSetMaxMemory (dom, mem));
- CHECK_ERROR (r == -1, conn, "virDomainSetMaxMemory");
+ CHECK_ERROR (r == -1, "virDomainSetMaxMemory");
CAMLreturn (Val_unit);
}
@@ -238,12 +485,11 @@ ocaml_libvirt_domain_set_memory (value domv, value memv)
{
CAMLparam2 (domv, memv);
virDomainPtr dom = Domain_val (domv);
- virConnectPtr conn = Connect_domv (domv);
unsigned long mem = Int64_val (memv);
int r;
NONBLOCKING (r = virDomainSetMemory (dom, mem));
- CHECK_ERROR (r == -1, conn, "virDomainSetMemory");
+ CHECK_ERROR (r == -1, "virDomainSetMemory");
CAMLreturn (Val_unit);
}
@@ -254,12 +500,11 @@ ocaml_libvirt_domain_get_info (value domv)
CAMLparam1 (domv);
CAMLlocal2 (rv, v);
virDomainPtr dom = Domain_val (domv);
- virConnectPtr conn = Connect_domv (domv);
virDomainInfo info;
int r;
NONBLOCKING (r = virDomainGetInfo (dom, &info));
- CHECK_ERROR (r == -1, conn, "virDomainGetInfo");
+ CHECK_ERROR (r == -1, "virDomainGetInfo");
rv = caml_alloc (5, 0);
Store_field (rv, 0, Val_int (info.state)); // These flags are compatible.
@@ -277,12 +522,11 @@ ocaml_libvirt_domain_get_scheduler_type (value domv)
CAMLparam1 (domv);
CAMLlocal2 (rv, strv);
virDomainPtr dom = Domain_val (domv);
- virConnectPtr conn = Connect_domv (domv);
char *r;
int nparams;
NONBLOCKING (r = virDomainGetSchedulerType (dom, &nparams));
- CHECK_ERROR (!r, conn, "virDomainGetSchedulerType");
+ CHECK_ERROR (!r, "virDomainGetSchedulerType");
rv = caml_alloc_tuple (2);
strv = caml_copy_string (r); Store_field (rv, 0, strv);
@@ -297,13 +541,16 @@ ocaml_libvirt_domain_get_scheduler_parameters (value domv, value nparamsv)
CAMLparam2 (domv, nparamsv);
CAMLlocal4 (rv, v, v2, v3);
virDomainPtr dom = Domain_val (domv);
- virConnectPtr conn = Connect_domv (domv);
int nparams = Int_val (nparamsv);
- virSchedParameter params[nparams];
+ virSchedParameterPtr params;
int r, i;
+ params = malloc (sizeof (*params) * nparams);
+ if (params == NULL)
+ caml_raise_out_of_memory ();
+
NONBLOCKING (r = virDomainGetSchedulerParameters (dom, params, &nparams));
- CHECK_ERROR (r == -1, conn, "virDomainGetSchedulerParameters");
+ CHECK_ERROR_CLEANUP (r == -1, free (params), "virDomainGetSchedulerParameters");
rv = caml_alloc (nparams, 0);
for (i = 0; i < nparams; ++i) {
@@ -339,6 +586,7 @@ ocaml_libvirt_domain_get_scheduler_parameters (value domv, value nparamsv)
}
Store_field (v, 1, v2);
}
+ free (params);
CAMLreturn (rv);
}
@@ -348,12 +596,15 @@ ocaml_libvirt_domain_set_scheduler_parameters (value domv, value paramsv)
CAMLparam2 (domv, paramsv);
CAMLlocal1 (v);
virDomainPtr dom = Domain_val (domv);
- virConnectPtr conn = Connect_domv (domv);
int nparams = Wosize_val (paramsv);
- virSchedParameter params[nparams];
+ virSchedParameterPtr params;
int r, i;
char *name;
+ params = malloc (sizeof (*params) * nparams);
+ if (params == NULL)
+ caml_raise_out_of_memory ();
+
for (i = 0; i < nparams; ++i) {
v = Field (paramsv, i); /* Points to the two-element tuple. */
name = String_val (Field (v, 0));
@@ -391,7 +642,8 @@ ocaml_libvirt_domain_set_scheduler_parameters (value domv, value paramsv)
}
NONBLOCKING (r = virDomainSetSchedulerParameters (dom, params, nparams));
- CHECK_ERROR (r == -1, conn, "virDomainSetSchedulerParameters");
+ free (params);
+ CHECK_ERROR (r == -1, "virDomainSetSchedulerParameters");
CAMLreturn (Val_unit);
}
@@ -401,11 +653,10 @@ ocaml_libvirt_domain_set_vcpus (value domv, value nvcpusv)
{
CAMLparam2 (domv, nvcpusv);
virDomainPtr dom = Domain_val (domv);
- virConnectPtr conn = Connect_domv (domv);
int r, nvcpus = Int_val (nvcpusv);
NONBLOCKING (r = virDomainSetVcpus (dom, nvcpus));
- CHECK_ERROR (r == -1, conn, "virDomainSetVcpus");
+ CHECK_ERROR (r == -1, "virDomainSetVcpus");
CAMLreturn (Val_unit);
}
@@ -415,14 +666,13 @@ ocaml_libvirt_domain_pin_vcpu (value domv, value vcpuv, value cpumapv)
{
CAMLparam3 (domv, vcpuv, cpumapv);
virDomainPtr dom = Domain_val (domv);
- virConnectPtr conn = Connect_domv (domv);
int maplen = caml_string_length (cpumapv);
unsigned char *cpumap = (unsigned char *) String_val (cpumapv);
int vcpu = Int_val (vcpuv);
int r;
NONBLOCKING (r = virDomainPinVcpu (dom, vcpu, cpumap, maplen));
- CHECK_ERROR (r == -1, conn, "virDomainPinVcpu");
+ CHECK_ERROR (r == -1, "virDomainPinVcpu");
CAMLreturn (Val_unit);
}
@@ -433,18 +683,23 @@ ocaml_libvirt_domain_get_vcpus (value domv, value maxinfov, value maplenv)
CAMLparam3 (domv, maxinfov, maplenv);
CAMLlocal5 (rv, infov, strv, v, v2);
virDomainPtr dom = Domain_val (domv);
- virConnectPtr conn = Connect_domv (domv);
int maxinfo = Int_val (maxinfov);
int maplen = Int_val (maplenv);
- virVcpuInfo info[maxinfo];
- unsigned char cpumaps[maxinfo * maplen];
+ virVcpuInfoPtr info;
+ unsigned char *cpumaps;
int r, i;
- memset (info, 0, sizeof (virVcpuInfo) * maxinfo);
- memset (cpumaps, 0, maxinfo * maplen);
+ info = calloc (maxinfo, sizeof (*info));
+ if (info == NULL)
+ caml_raise_out_of_memory ();
+ cpumaps = calloc (maxinfo * maplen, sizeof (*cpumaps));
+ if (cpumaps == NULL) {
+ free (info);
+ caml_raise_out_of_memory ();
+ }
NONBLOCKING (r = virDomainGetVcpus (dom, info, maxinfo, cpumaps, maplen));
- CHECK_ERROR (r == -1, conn, "virDomainPinVcpu");
+ CHECK_ERROR_CLEANUP (r == -1, free (info); free (cpumaps), "virDomainPinVcpu");
/* Copy the virVcpuInfo structures. */
infov = caml_alloc (maxinfo, 0);
@@ -466,6 +721,9 @@ ocaml_libvirt_domain_get_vcpus (value domv, value maxinfov, value maplenv)
Store_field (rv, 1, infov);
Store_field (rv, 2, strv);
+ free (info);
+ free (cpumaps);
+
CAMLreturn (rv);
}
@@ -476,18 +734,17 @@ ocaml_libvirt_domain_get_cpu_stats (value domv)
CAMLlocal5 (cpustats, param_head, param_node, typed_param, typed_param_value);
CAMLlocal1 (v);
virDomainPtr dom = Domain_val (domv);
- virConnectPtr conn = Connect_domv (domv);
virTypedParameterPtr params;
int r, cpu, ncpus, nparams, i, j, pos;
int nr_pcpus;
/* get number of pcpus */
NONBLOCKING (nr_pcpus = virDomainGetCPUStats(dom, NULL, 0, 0, 0, 0));
- CHECK_ERROR (nr_pcpus < 0, conn, "virDomainGetCPUStats");
+ CHECK_ERROR (nr_pcpus < 0, "virDomainGetCPUStats");
/* get percpu information */
NONBLOCKING (nparams = virDomainGetCPUStats(dom, NULL, 0, 0, 1, 0));
- CHECK_ERROR (nparams < 0, conn, "virDomainGetCPUStats");
+ CHECK_ERROR (nparams < 0, "virDomainGetCPUStats");
if ((params = malloc(sizeof(*params) * nparams * 128)) == NULL)
caml_failwith ("virDomainGetCPUStats: malloc");
@@ -498,7 +755,7 @@ ocaml_libvirt_domain_get_cpu_stats (value domv)
ncpus = nr_pcpus - cpu > 128 ? 128 : nr_pcpus - cpu;
NONBLOCKING (r = virDomainGetCPUStats(dom, params, nparams, cpu, ncpus, 0));
- CHECK_ERROR (r < 0, conn, "virDomainGetCPUStats");
+ CHECK_ERROR (r < 0, "virDomainGetCPUStats");
for (i = 0; i < ncpus; i++) {
/* list of typed_param: single linked list of param_nodes */
@@ -572,6 +829,131 @@ ocaml_libvirt_domain_get_cpu_stats (value domv)
CAMLreturn (cpustats);
}
+value
+ocaml_libvirt_domain_get_all_domain_stats (value connv,
+ value statsv, value flagsv)
+{
+ CAMLparam3 (connv, statsv, flagsv);
+ CAMLlocal5 (rv, dsv, tpv, v, v1);
+ CAMLlocal1 (v2);
+ virConnectPtr conn = Connect_val (connv);
+ virDomainStatsRecordPtr *rstats;
+ unsigned int stats = 0, flags = 0;
+ int i, j, r;
+ unsigned char uuid[VIR_UUID_BUFLEN];
+
+ /* Get stats and flags. */
+ for (; statsv != Val_int (0); statsv = Field (statsv, 1)) {
+ v = Field (statsv, 0);
+ if (v == Val_int (0))
+ stats |= VIR_DOMAIN_STATS_STATE;
+ else if (v == Val_int (1))
+ stats |= VIR_DOMAIN_STATS_CPU_TOTAL;
+ else if (v == Val_int (2))
+ stats |= VIR_DOMAIN_STATS_BALLOON;
+ else if (v == Val_int (3))
+ stats |= VIR_DOMAIN_STATS_VCPU;
+ else if (v == Val_int (4))
+ stats |= VIR_DOMAIN_STATS_INTERFACE;
+ else if (v == Val_int (5))
+ stats |= VIR_DOMAIN_STATS_BLOCK;
+ else if (v == Val_int (6))
+ stats |= VIR_DOMAIN_STATS_PERF;
+ }
+ for (; flagsv != Val_int (0); flagsv = Field (flagsv, 1)) {
+ v = Field (flagsv, 0);
+ if (v == Val_int (0))
+ flags |= VIR_CONNECT_GET_ALL_DOMAINS_STATS_ACTIVE;
+ else if (v == Val_int (1))
+ flags |= VIR_CONNECT_GET_ALL_DOMAINS_STATS_INACTIVE;
+ else if (v == Val_int (2))
+ flags |= VIR_CONNECT_GET_ALL_DOMAINS_STATS_OTHER;
+ else if (v == Val_int (3))
+ flags |= VIR_CONNECT_GET_ALL_DOMAINS_STATS_PAUSED;
+ else if (v == Val_int (4))
+ flags |= VIR_CONNECT_GET_ALL_DOMAINS_STATS_PERSISTENT;
+ else if (v == Val_int (5))
+ flags |= VIR_CONNECT_GET_ALL_DOMAINS_STATS_RUNNING;
+ else if (v == Val_int (6))
+ flags |= VIR_CONNECT_GET_ALL_DOMAINS_STATS_SHUTOFF;
+ else if (v == Val_int (7))
+ flags |= VIR_CONNECT_GET_ALL_DOMAINS_STATS_TRANSIENT;
+ else if (v == Val_int (8))
+ flags |= VIR_CONNECT_GET_ALL_DOMAINS_STATS_BACKING;
+ else if (v == Val_int (9))
+ flags |= VIR_CONNECT_GET_ALL_DOMAINS_STATS_ENFORCE_STATS;
+ }
+
+ NONBLOCKING (r = virConnectGetAllDomainStats (conn, stats, &rstats, flags));
+ CHECK_ERROR (r == -1, "virConnectGetAllDomainStats");
+
+ rv = caml_alloc (r, 0); /* domain_stats_record array. */
+ for (i = 0; i < r; ++i) {
+ dsv = caml_alloc (2, 0); /* domain_stats_record */
+
+ /* Libvirt returns something superficially resembling a
+ * virDomainPtr, but it's not a real virDomainPtr object
+ * (eg. dom->id == -1, and its refcount is wrong). The only thing
+ * we can safely get from it is the UUID.
+ */
+ v = caml_alloc_string (VIR_UUID_BUFLEN);
+ virDomainGetUUID (rstats[i]->dom, uuid);
+ memcpy (String_val (v), uuid, VIR_UUID_BUFLEN);
+ Store_field (dsv, 0, v);
+
+ tpv = caml_alloc (rstats[i]->nparams, 0); /* typed_param array */
+ for (j = 0; j < rstats[i]->nparams; ++j) {
+ v2 = caml_alloc (2, 0); /* typed_param: field name, value */
+ Store_field (v2, 0, caml_copy_string (rstats[i]->params[j].field));
+
+ switch (rstats[i]->params[j].type) {
+ case VIR_TYPED_PARAM_INT:
+ v1 = caml_alloc (1, 0);
+ v = caml_copy_int32 (rstats[i]->params[j].value.i);
+ break;
+ case VIR_TYPED_PARAM_UINT:
+ v1 = caml_alloc (1, 1);
+ v = caml_copy_int32 (rstats[i]->params[j].value.ui);
+ break;
+ case VIR_TYPED_PARAM_LLONG:
+ v1 = caml_alloc (1, 2);
+ v = caml_copy_int64 (rstats[i]->params[j].value.l);
+ break;
+ case VIR_TYPED_PARAM_ULLONG:
+ v1 = caml_alloc (1, 3);
+ v = caml_copy_int64 (rstats[i]->params[j].value.ul);
+ break;
+ case VIR_TYPED_PARAM_DOUBLE:
+ v1 = caml_alloc (1, 4);
+ v = caml_copy_double (rstats[i]->params[j].value.d);
+ break;
+ case VIR_TYPED_PARAM_BOOLEAN:
+ v1 = caml_alloc (1, 5);
+ v = Val_bool (rstats[i]->params[j].value.b);
+ break;
+ case VIR_TYPED_PARAM_STRING:
+ v1 = caml_alloc (1, 6);
+ v = caml_copy_string (rstats[i]->params[j].value.s);
+ break;
+ default:
+ virDomainStatsRecordListFree (rstats);
+ caml_failwith ("virConnectGetAllDomainStats: "
+ "unknown parameter type returned");
+ }
+ Store_field (v1, 0, v);
+
+ Store_field (v2, 1, v1);
+ Store_field (tpv, j, v2);
+ }
+
+ Store_field (dsv, 1, tpv);
+ Store_field (rv, i, dsv);
+ }
+
+ virDomainStatsRecordListFree (rstats);
+ CAMLreturn (rv);
+}
+
CAMLprim value
ocaml_libvirt_domain_migrate_native (value domv, value dconnv, value flagsv, value optdnamev, value opturiv, value optbandwidthv, value unitv)
{
@@ -579,7 +961,6 @@ ocaml_libvirt_domain_migrate_native (value domv, value dconnv, value flagsv, val
CAMLxparam2 (optbandwidthv, unitv);
CAMLlocal2 (flagv, rv);
virDomainPtr dom = Domain_val (domv);
- virConnectPtr conn = Connect_domv (domv);
virConnectPtr dconn = Connect_val (dconnv);
int flags = 0;
const char *dname = Optstring_val (optdnamev);
@@ -601,7 +982,7 @@ ocaml_libvirt_domain_migrate_native (value domv, value dconnv, value flagsv, val
bandwidth = Int_val (Field (optbandwidthv, 0));
NONBLOCKING (r = virDomainMigrate (dom, dconn, flags, dname, uri, bandwidth));
- CHECK_ERROR (!r, conn, "virDomainMigrate");
+ CHECK_ERROR (!r, "virDomainMigrate");
rv = Val_domain (r, dconnv);
@@ -622,13 +1003,12 @@ ocaml_libvirt_domain_block_stats (value domv, value pathv)
CAMLparam2 (domv, pathv);
CAMLlocal2 (rv,v);
virDomainPtr dom = Domain_val (domv);
- virConnectPtr conn = Connect_domv (domv);
char *path = String_val (pathv);
struct _virDomainBlockStats stats;
int r;
NONBLOCKING (r = virDomainBlockStats (dom, path, &stats, sizeof stats));
- CHECK_ERROR (r == -1, conn, "virDomainBlockStats");
+ CHECK_ERROR (r == -1, "virDomainBlockStats");
rv = caml_alloc (5, 0);
v = caml_copy_int64 (stats.rd_req); Store_field (rv, 0, v);
@@ -646,13 +1026,12 @@ ocaml_libvirt_domain_interface_stats (value domv, value pathv)
CAMLparam2 (domv, pathv);
CAMLlocal2 (rv,v);
virDomainPtr dom = Domain_val (domv);
- virConnectPtr conn = Connect_domv (domv);
char *path = String_val (pathv);
struct _virDomainInterfaceStats stats;
int r;
NONBLOCKING (r = virDomainInterfaceStats (dom, path, &stats, sizeof stats));
- CHECK_ERROR (r == -1, conn, "virDomainInterfaceStats");
+ CHECK_ERROR (r == -1, "virDomainInterfaceStats");
rv = caml_alloc (8, 0);
v = caml_copy_int64 (stats.rx_bytes); Store_field (rv, 0, v);
@@ -673,7 +1052,6 @@ ocaml_libvirt_domain_block_peek_native (value domv, value pathv, value offsetv,
CAMLparam5 (domv, pathv, offsetv, sizev, bufferv);
CAMLxparam1 (boffv);
virDomainPtr dom = Domain_val (domv);
- virConnectPtr conn = Connect_domv (domv);
const char *path = String_val (pathv);
unsigned long long offset = Int64_val (offsetv);
size_t size = Int_val (sizev);
@@ -687,7 +1065,7 @@ ocaml_libvirt_domain_block_peek_native (value domv, value pathv, value offsetv,
/* NB. not NONBLOCKING because buffer might move (XXX) */
r = virDomainBlockPeek (dom, path, offset, size, buffer+boff, 0);
- CHECK_ERROR (r == -1, conn, "virDomainBlockPeek");
+ CHECK_ERROR (r == -1, "virDomainBlockPeek");
CAMLreturn (Val_unit);
}
@@ -706,7 +1084,6 @@ ocaml_libvirt_domain_memory_peek_native (value domv, value flagsv, value offsetv
CAMLxparam1 (boffv);
CAMLlocal1 (flagv);
virDomainPtr dom = Domain_val (domv);
- virConnectPtr conn = Connect_domv (domv);
int flags = 0;
unsigned long long offset = Int64_val (offsetv);
size_t size = Int_val (sizev);
@@ -728,7 +1105,7 @@ ocaml_libvirt_domain_memory_peek_native (value domv, value flagsv, value offsetv
/* NB. not NONBLOCKING because buffer might move (XXX) */
r = virDomainMemoryPeek (dom, offset, size, buffer+boff, flags);
- CHECK_ERROR (r == -1, conn, "virDomainMemoryPeek");
+ CHECK_ERROR (r == -1, "virDomainMemoryPeek");
CAMLreturn (Val_unit);
}
@@ -740,6 +1117,37 @@ ocaml_libvirt_domain_memory_peek_bytecode (value *argv, int argn)
argv[3], argv[4], argv[5]);
}
+CAMLprim value
+ocaml_libvirt_domain_get_xml_desc_flags (value domv, value flagsv)
+{
+ CAMLparam2 (domv, flagsv);
+ CAMLlocal2 (rv, flagv);
+ virDomainPtr dom = Domain_val (domv);
+ int flags = 0;
+ char *r;
+
+ /* Do flags. */
+ for (; flagsv != Val_int (0); flagsv = Field (flagsv, 1))
+ {
+ flagv = Field (flagsv, 0);
+ if (flagv == Val_int (0))
+ flags |= VIR_DOMAIN_XML_SECURE;
+ else if (flagv == Val_int (1))
+ flags |= VIR_DOMAIN_XML_INACTIVE;
+ else if (flagv == Val_int (2))
+ flags |= VIR_DOMAIN_XML_UPDATE_CPU;
+ else if (flagv == Val_int (3))
+ flags |= VIR_DOMAIN_XML_MIGRATABLE;
+ }
+
+ NONBLOCKING (r = virDomainGetXMLDesc (dom, flags));
+ CHECK_ERROR (!r, "virDomainGetXMLDesc");
+
+ rv = caml_copy_string (r);
+ free (r);
+ CAMLreturn (rv);
+}
+
/*----------------------------------------------------------------------*/
/* Domain events */
@@ -1042,7 +1450,6 @@ CAMLprim value
ocaml_libvirt_event_add_timeout (value connv, value ms, value callback_id)
{
CAMLparam3 (connv, ms, callback_id);
- virConnectPtr conn = Connect_val (connv);
void *opaque;
virFreeCallback freecb = free;
virEventTimeoutCallback cb = timeout_callback;
@@ -1055,7 +1462,7 @@ ocaml_libvirt_event_add_timeout (value connv, value ms, value callback_id)
caml_failwith ("virEventAddTimeout: malloc");
*((long*)opaque) = Int64_val(callback_id);
NONBLOCKING(r = virEventAddTimeout(Int_val(ms), cb, opaque, freecb));
- CHECK_ERROR(r == -1, conn, "virEventAddTimeout");
+ CHECK_ERROR(r == -1, "virEventAddTimeout");
CAMLreturn(Val_int(r));
}
@@ -1064,11 +1471,10 @@ CAMLprim value
ocaml_libvirt_event_remove_timeout (value connv, value timer_id)
{
CAMLparam2 (connv, timer_id);
- virConnectPtr conn = Connect_val (connv);
int r;
NONBLOCKING(r = virEventRemoveTimeout(Int_val(timer_id)));
- CHECK_ERROR(r == -1, conn, "virEventRemoveTimeout");
+ CHECK_ERROR(r == -1, "virEventRemoveTimeout");
CAMLreturn(Val_int(r));
}
@@ -1146,7 +1552,7 @@ ocaml_libvirt_connect_domain_event_register_any(value connv, value domv, value c
caml_failwith ("virConnectDomainEventRegisterAny: malloc");
*((long*)opaque) = Int64_val(callback_id);
NONBLOCKING(r = virConnectDomainEventRegisterAny(conn, dom, eventID, cb, opaque, freecb));
- CHECK_ERROR(r == -1, conn, "virConnectDomainEventRegisterAny");
+ CHECK_ERROR(r == -1, "virConnectDomainEventRegisterAny");
CAMLreturn(Val_int(r));
}
@@ -1157,12 +1563,11 @@ ocaml_libvirt_storage_pool_get_info (value poolv)
CAMLparam1 (poolv);
CAMLlocal2 (rv, v);
virStoragePoolPtr pool = Pool_val (poolv);
- virConnectPtr conn = Connect_polv (poolv);
virStoragePoolInfo info;
int r;
NONBLOCKING (r = virStoragePoolGetInfo (pool, &info));
- CHECK_ERROR (r == -1, conn, "virStoragePoolGetInfo");
+ CHECK_ERROR (r == -1, "virStoragePoolGetInfo");
rv = caml_alloc (4, 0);
Store_field (rv, 0, Val_int (info.state));
@@ -1179,12 +1584,11 @@ ocaml_libvirt_storage_vol_get_info (value volv)
CAMLparam1 (volv);
CAMLlocal2 (rv, v);
virStorageVolPtr vol = Volume_val (volv);
- virConnectPtr conn = Connect_volv (volv);
virStorageVolInfo info;
int r;
NONBLOCKING (r = virStorageVolGetInfo (vol, &info));
- CHECK_ERROR (r == -1, conn, "virStorageVolGetInfo");
+ CHECK_ERROR (r == -1, "virStorageVolGetInfo");
rv = caml_alloc (3, 0);
Store_field (rv, 0, Val_int (info.type));
@@ -1194,6 +1598,58 @@ ocaml_libvirt_storage_vol_get_info (value volv)
CAMLreturn (rv);
}
+CAMLprim value
+ocaml_libvirt_secret_lookup_by_usage (value connv, value usagetypev, value usageidv)
+{
+ CAMLparam3 (connv, usagetypev, usageidv);
+ CAMLlocal1 (rv);
+ virConnectPtr conn = Connect_val (connv);
+ int usageType = Int_val (usagetypev);
+ const char *usageID = String_val (usageidv);
+ virSecretPtr r;
+
+ NONBLOCKING (r = virSecretLookupByUsage (conn, usageType, usageID));
+ CHECK_ERROR (!r, "virSecretLookupByUsage");
+
+ rv = Val_secret (r, connv);
+
+ CAMLreturn (rv);
+}
+
+CAMLprim value
+ocaml_libvirt_secret_set_value (value secv, value vv)
+{
+ CAMLparam2 (secv, vv);
+ virSecretPtr sec = Secret_val (secv);
+ const unsigned char *secval = (unsigned char *) String_val (vv);
+ const size_t size = caml_string_length (vv);
+ int r;
+
+ NONBLOCKING (r = virSecretSetValue (sec, secval, size, 0));
+ CHECK_ERROR (r == -1, "virSecretSetValue");
+
+ CAMLreturn (Val_unit);
+}
+
+CAMLprim value
+ocaml_libvirt_secret_get_value (value secv)
+{
+ CAMLparam1 (secv);
+ CAMLlocal1 (rv);
+ virSecretPtr sec = Secret_val (secv);
+ unsigned char *secval;
+ size_t size = 0;
+
+ NONBLOCKING (secval = virSecretGetValue (sec, &size, 0));
+ CHECK_ERROR (secval == NULL, "virSecretGetValue");
+
+ rv = caml_alloc_string (size);
+ memcpy (String_val (rv), secval, size);
+ free (secval);
+
+ CAMLreturn (rv);
+}
+
/*----------------------------------------------------------------------*/
CAMLprim value
@@ -1239,16 +1695,20 @@ ocaml_libvirt_virterror_reset_last_conn_error (value connv)
/*----------------------------------------------------------------------*/
+static void
+ignore_errors (void *user_data, virErrorPtr error)
+{
+ /* do nothing */
+}
+
/* Initialise the library. */
CAMLprim value
ocaml_libvirt_init (value unit)
{
CAMLparam1 (unit);
- CAMLlocal1 (rv);
- int r;
- r = virInitialize ();
- CHECK_ERROR (r == -1, NULL, "virInitialize");
+ virSetErrorFunc (NULL, ignore_errors);
+ virInitialize ();
CAMLreturn (Val_unit);
}
diff --git a/libvirt/libvirt_c_prologue.c b/libvirt/libvirt_c_prologue.c
index 7d9c0f5..8533618 100644
--- a/libvirt/libvirt_c_prologue.c
+++ b/libvirt/libvirt_c_prologue.c
@@ -1,6 +1,6 @@
/* OCaml bindings for libvirt.
* (C) Copyright 2007 Richard W.M. Jones, Red Hat Inc.
- * http://libvirt.org/
+ * https://libvirt.org/
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -20,18 +20,21 @@
/* Please read libvirt/README file. */
-static char *Optstring_val (value strv);
+static const char *Optstring_val (value strv);
typedef value (*Val_ptr_t) (void *);
static value Val_opt (void *ptr, Val_ptr_t Val_ptr);
+typedef value (*Val_const_ptr_t) (const void *);
+static value Val_opt_const (const void *ptr, Val_const_ptr_t Val_ptr);
/*static value option_default (value option, value deflt);*/
-static void _raise_virterror (virConnectPtr conn, const char *fn) Noreturn;
-static void not_supported (const char *fn) Noreturn;
+static void _raise_virterror (const char *fn) Noreturn;
static value Val_virterror (virErrorPtr err);
+static int _list_length (value listv);
+static value Val_virconnectcredential (const virConnectCredentialPtr cred);
/* Use this around synchronous libvirt API calls to release the OCaml
* lock, allowing other threads to run simultaneously. 'code' must not
* perform any caml_* calls, run any OCaml code, or raise any exception.
- * http://web.archive.org/web/20030521020915/http://caml.inria.fr/archives/200106/msg00199.html
+ * https://web.archive.org/web/20030521020915/http://caml.inria.fr/archives/200106/msg00199.html
*/
#define NONBLOCKING(code) \
do { \
@@ -40,11 +43,18 @@ static value Val_virterror (virErrorPtr err);
caml_leave_blocking_section (); \
} while (0)
+/* Empty macro to use as empty parameter for other macros, since
+ * a null token as parameter when calling a macro is not allowed
+ * before C99.
+ */
+#define EMPTY
/* Check error condition from a libvirt function, and automatically raise
* an exception if one is found.
*/
-#define CHECK_ERROR(cond, conn, fn) \
- do { if (cond) _raise_virterror (conn, fn); } while (0)
+#define CHECK_ERROR_CLEANUP(cond, cleanup, fn) \
+ do { if (cond) { cleanup; _raise_virterror (fn); } } while (0)
+#define CHECK_ERROR(cond, fn) \
+ CHECK_ERROR_CLEANUP(cond, EMPTY, fn)
/*----------------------------------------------------------------------*/
@@ -93,6 +103,7 @@ static value Val_virterror (virErrorPtr err);
#define Net_val(rv) (*((virNetworkPtr *)Data_custom_val(rv)))
#define Pol_val(rv) (*((virStoragePoolPtr *)Data_custom_val(rv)))
#define Vol_val(rv) (*((virStorageVolPtr *)Data_custom_val(rv)))
+#define Sec_val(rv) (*((virSecretPtr *)Data_custom_val(rv)))
/* Wrap up a pointer to something in a custom block. */
static value Val_connect (virConnectPtr conn);
@@ -100,6 +111,7 @@ static value Val_dom (virDomainPtr dom);
static value Val_net (virNetworkPtr net);
static value Val_pol (virStoragePoolPtr pool);
static value Val_vol (virStorageVolPtr vol);
+static value Val_sec (virSecretPtr sec);
/* Domains and networks are stored as pairs (dom/net, conn), so have
* some convenience functions for unwrapping and wrapping them.
@@ -108,12 +120,15 @@ static value Val_vol (virStorageVolPtr vol);
#define Network_val(rv) (Net_val(Field((rv),0)))
#define Pool_val(rv) (Pol_val(Field((rv),0)))
#define Volume_val(rv) (Vol_val(Field((rv),0)))
+#define Secret_val(rv) (Sec_val(Field((rv),0)))
#define Connect_domv(rv) (Connect_val(Field((rv),1)))
#define Connect_netv(rv) (Connect_val(Field((rv),1)))
#define Connect_polv(rv) (Connect_val(Field((rv),1)))
#define Connect_volv(rv) (Connect_val(Field((rv),1)))
+#define Connect_secv(rv) (Connect_val(Field((rv),1)))
static value Val_domain (virDomainPtr dom, value connv);
static value Val_network (virNetworkPtr net, value connv);
static value Val_pool (virStoragePoolPtr pol, value connv);
static value Val_volume (virStorageVolPtr vol, value connv);
+static value Val_secret (virSecretPtr sec, value connv);
diff --git a/libvirt/libvirt_version.ml.in b/libvirt/libvirt_version.ml.in
index b70d09d..4fc570c 100644
--- a/libvirt/libvirt_version.ml.in
+++ b/libvirt/libvirt_version.ml.in
@@ -1,6 +1,6 @@
(* Helper module containing the version of the OCaml bindings.
(C) Copyright 2007 Richard W.M. Jones, Red Hat Inc.
- http://libvirt.org/
+ https://libvirt.org/
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
diff --git a/libvirt/libvirt_version.mli b/libvirt/libvirt_version.mli
index 2080df3..fe98fc9 100644
--- a/libvirt/libvirt_version.mli
+++ b/libvirt/libvirt_version.mli
@@ -1,6 +1,6 @@
-(** OCaml bindings for libvirt.
- (C) Copyright 2007 Richard W.M. Jones, Red Hat Inc.
- http://libvirt.org/
+(* OCaml bindings for libvirt.
+ (C) Copyright 2007 Richard W.M. Jones, Red Hat Inc.
+ https://libvirt.org/
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -18,9 +18,12 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*)
+(** Information on OCaml-libvirt itself. *)
+
val package : string
+(** The name of the OCaml libvirt bindings. *)
val version : string
-(** The name and version of the OCaml libvirt bindings.
+(** The version of the OCaml libvirt bindings.
(To get the version of libvirt C library itself
use {!Libvirt.get_version}). *)
diff --git a/m4/ocaml.m4 b/m4/ocaml.m4
new file mode 100644
index 0000000..fddd6a0
--- /dev/null
+++ b/m4/ocaml.m4
@@ -0,0 +1,217 @@
+dnl autoconf macros for OCaml
+dnl
+dnl Copyright © 2009 Richard W.M. Jones
+dnl Copyright © 2009 Stefano Zacchiroli
+dnl Copyright © 2000-2005 Olivier Andrieu
+dnl Copyright © 2000-2005 Jean-Christophe Filliâtre
+dnl Copyright © 2000-2005 Georges Mariano
+dnl
+dnl For documentation, please read the ocaml.m4 man page.
+
+AC_DEFUN([AC_PROG_OCAML],
+[dnl
+ # checking for ocamlc
+ AC_CHECK_TOOL([OCAMLC],[ocamlc],[no])
+
+ if test "$OCAMLC" != "no"; then
+ OCAMLVERSION=`$OCAMLC -v | sed -n -e 's|.*version* *\(.*\)$|\1|p'`
+ AC_MSG_RESULT([OCaml version is $OCAMLVERSION])
+ OCAMLLIB=`$OCAMLC -where 2>/dev/null || $OCAMLC -v|tail -1|cut -d ' ' -f 4`
+ AC_MSG_RESULT([OCaml library path is $OCAMLLIB])
+
+ AC_SUBST([OCAMLVERSION])
+ AC_SUBST([OCAMLLIB])
+
+ # checking for ocamlopt
+ AC_CHECK_TOOL([OCAMLOPT],[ocamlopt],[no])
+ OCAMLBEST=byte
+ if test "$OCAMLOPT" = "no"; then
+ AC_MSG_WARN([Cannot find ocamlopt; bytecode compilation only.])
+ else
+ TMPVERSION=`$OCAMLOPT -v | sed -n -e 's|.*version* *\(.*\)$|\1|p' `
+ if test "$TMPVERSION" != "$OCAMLVERSION" ; then
+ AC_MSG_RESULT([versions differs from ocamlc; ocamlopt discarded.])
+ OCAMLOPT=no
+ else
+ OCAMLBEST=opt
+ fi
+ fi
+
+ AC_SUBST([OCAMLBEST])
+
+ # checking for ocamlc.opt
+ AC_CHECK_TOOL([OCAMLCDOTOPT],[ocamlc.opt],[no])
+ if test "$OCAMLCDOTOPT" != "no"; then
+ TMPVERSION=`$OCAMLCDOTOPT -v | sed -n -e 's|.*version* *\(.*\)$|\1|p' `
+ if test "$TMPVERSION" != "$OCAMLVERSION" ; then
+ AC_MSG_RESULT([versions differs from ocamlc; ocamlc.opt discarded.])
+ else
+ OCAMLC=$OCAMLCDOTOPT
+ fi
+ fi
+
+ # checking for ocamlopt.opt
+ if test "$OCAMLOPT" != "no" ; then
+ AC_CHECK_TOOL([OCAMLOPTDOTOPT],[ocamlopt.opt],[no])
+ if test "$OCAMLOPTDOTOPT" != "no"; then
+ TMPVERSION=`$OCAMLOPTDOTOPT -v | sed -n -e 's|.*version* *\(.*\)$|\1|p' `
+ if test "$TMPVERSION" != "$OCAMLVERSION" ; then
+ AC_MSG_RESULT([version differs from ocamlc; ocamlopt.opt discarded.])
+ else
+ OCAMLOPT=$OCAMLOPTDOTOPT
+ fi
+ fi
+ fi
+
+ AC_SUBST([OCAMLOPT])
+ fi
+
+ AC_SUBST([OCAMLC])
+
+ # checking for ocamldep
+ AC_CHECK_TOOL([OCAMLDEP],[ocamldep],[no])
+
+ # checking for ocamlmktop
+ AC_CHECK_TOOL([OCAMLMKTOP],[ocamlmktop],[no])
+
+ # checking for ocamlmklib
+ AC_CHECK_TOOL([OCAMLMKLIB],[ocamlmklib],[no])
+
+ # checking for ocamldoc
+ AC_CHECK_TOOL([OCAMLDOC],[ocamldoc],[no])
+
+ # checking for ocamlbuild
+ AC_CHECK_TOOL([OCAMLBUILD],[ocamlbuild],[no])
+])
+
+
+AC_DEFUN([AC_PROG_OCAMLLEX],
+[dnl
+ # checking for ocamllex
+ AC_CHECK_TOOL([OCAMLLEX],[ocamllex],[no])
+ if test "$OCAMLLEX" != "no"; then
+ AC_CHECK_TOOL([OCAMLLEXDOTOPT],[ocamllex.opt],[no])
+ if test "$OCAMLLEXDOTOPT" != "no"; then
+ OCAMLLEX=$OCAMLLEXDOTOPT
+ fi
+ fi
+ AC_SUBST([OCAMLLEX])
+])
+
+AC_DEFUN([AC_PROG_OCAMLYACC],
+[dnl
+ AC_CHECK_TOOL([OCAMLYACC],[ocamlyacc],[no])
+ AC_SUBST([OCAMLYACC])
+])
+
+
+AC_DEFUN([AC_PROG_CAMLP4],
+[dnl
+ AC_REQUIRE([AC_PROG_OCAML])dnl
+
+ # checking for camlp4
+ AC_CHECK_TOOL([CAMLP4],[camlp4],[no])
+ if test "$CAMLP4" != "no"; then
+ TMPVERSION=`$CAMLP4 -v 2>&1| sed -n -e 's|.*version *\(.*\)$|\1|p'`
+ if test "$TMPVERSION" != "$OCAMLVERSION" ; then
+ AC_MSG_RESULT([versions differs from ocamlc])
+ CAMLP4=no
+ fi
+ fi
+ AC_SUBST([CAMLP4])
+
+ # checking for companion tools
+ AC_CHECK_TOOL([CAMLP4BOOT],[camlp4boot],[no])
+ AC_CHECK_TOOL([CAMLP4O],[camlp4o],[no])
+ AC_CHECK_TOOL([CAMLP4OF],[camlp4of],[no])
+ AC_CHECK_TOOL([CAMLP4OOF],[camlp4oof],[no])
+ AC_CHECK_TOOL([CAMLP4ORF],[camlp4orf],[no])
+ AC_CHECK_TOOL([CAMLP4PROF],[camlp4prof],[no])
+ AC_CHECK_TOOL([CAMLP4R],[camlp4r],[no])
+ AC_CHECK_TOOL([CAMLP4RF],[camlp4rf],[no])
+ AC_SUBST([CAMLP4BOOT])
+ AC_SUBST([CAMLP4O])
+ AC_SUBST([CAMLP4OF])
+ AC_SUBST([CAMLP4OOF])
+ AC_SUBST([CAMLP4ORF])
+ AC_SUBST([CAMLP4PROF])
+ AC_SUBST([CAMLP4R])
+ AC_SUBST([CAMLP4RF])
+])
+
+
+AC_DEFUN([AC_PROG_FINDLIB],
+[dnl
+ AC_REQUIRE([AC_PROG_OCAML])dnl
+
+ # checking for ocamlfind
+ AC_CHECK_TOOL([OCAMLFIND],[ocamlfind],[no])
+ AC_SUBST([OCAMLFIND])
+])
+
+
+dnl Thanks to Jim Meyering for working this next bit out for us.
+dnl XXX We should define AS_TR_SH if it's not defined already
+dnl (eg. for old autoconf).
+AC_DEFUN([AC_CHECK_OCAML_PKG],
+[dnl
+ AC_REQUIRE([AC_PROG_FINDLIB])dnl
+
+ AC_MSG_CHECKING([for OCaml findlib package $1])
+
+ unset found
+ unset pkg
+ found=no
+ for pkg in $1 $2 ; do
+ if $OCAMLFIND query $pkg >/dev/null 2>/dev/null; then
+ AC_MSG_RESULT([found])
+ AS_TR_SH([OCAML_PKG_$1])=$pkg
+ found=yes
+ break
+ fi
+ done
+ if test "$found" = "no" ; then
+ AC_MSG_RESULT([not found])
+ AS_TR_SH([OCAML_PKG_$1])=no
+ fi
+
+ AC_SUBST(AS_TR_SH([OCAML_PKG_$1]))
+])
+
+
+AC_DEFUN([AC_CHECK_OCAML_MODULE],
+[dnl
+ AC_MSG_CHECKING([for OCaml module $2])
+
+ cat > conftest.ml <<EOF
+open $3
+EOF
+ unset found
+ for $1 in $$1 $4 ; do
+ if $OCAMLC -c -I "$$1" conftest.ml >&5 2>&5 ; then
+ found=yes
+ break
+ fi
+ done
+
+ if test "$found" ; then
+ AC_MSG_RESULT([$$1])
+ else
+ AC_MSG_RESULT([not found])
+ $1=no
+ fi
+ AC_SUBST([$1])
+])
+
+
+dnl XXX Cross-compiling
+AC_DEFUN([AC_CHECK_OCAML_WORD_SIZE],
+[dnl
+ AC_MSG_CHECKING([for OCaml compiler word size])
+ cat > conftest.ml <<EOF
+ print_endline (string_of_int Sys.word_size)
+ EOF
+ OCAML_WORD_SIZE=`ocaml conftest.ml`
+ AC_MSG_RESULT([$OCAML_WORD_SIZE])
+ AC_SUBST([OCAML_WORD_SIZE])
+])