libvirt/m4/virt-driver-bhyve.m4
Fabian Freyer b436a8ae5c gnulib: add getopt module
Unconditionally use gnulib's getopt module. This is needed by the bhyve driver
to provide a reentrant interface for getopt.

Several gnulib headers rely on features.h being included by ctype.h to provide
__GNUC_PREREQ, but on systems without glibc, this is not provided. In these
cases __GNUC_PREREQ gets redefined to 0, which causes build errors from checks
in src/internal.h.
Therefore, define __GNUC_PREREQ as early as possible. config-post.h is probably
the first header that is included, before any other headers.
2016-07-10 15:39:44 -04:00

61 lines
2.3 KiB
Plaintext

dnl The bhyve driver
dnl
dnl Copyright (C) 2014 Roman Bogorodskiy
dnl
dnl This library is free software; you can redistribute it and/or
dnl modify it under the terms of the GNU Lesser General Public
dnl License as published by the Free Software Foundation; either
dnl version 2.1 of the License, or (at your option) any later version.
dnl
dnl This library is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
dnl Lesser General Public License for more details.
dnl
dnl You should have received a copy of the GNU Lesser General Public
dnl License along with this library. If not, see
dnl <http://www.gnu.org/licenses/>.
dnl
AC_DEFUN([LIBVIRT_DRIVER_CHECK_BHYVE],[
AC_ARG_WITH([bhyve],
[AS_HELP_STRING([--with-bhyve],
[add BHyVe support @<:@default=check@:>@])])
m4_divert_text([DEFAULTS], [with_bhyve=check])
if test "$with_bhyve" != "no"; then
AC_PATH_PROG([BHYVE], [bhyve], [], [$PATH:/usr/sbin])
AC_PATH_PROG([BHYVECTL], [bhyvectl], [], [$PATH:/usr/sbin])
AC_PATH_PROG([BHYVELOAD], [bhyveload], [], [$PATH:/usr/sbin/])
if test -z "$BHYVE" || test -z "$BHYVECTL" || \
test -z "$BHYVELOAD" || test "$with_freebsd" = "no"; then
if test "$with_bhyve" = "check"; then
with_bhyve="no"
else
AC_MSG_ERROR([The bhyve driver cannot be enabled])
fi
else
with_bhyve="yes"
fi
fi
if test "$with_bhyve" = "yes"; then
AC_DEFINE_UNQUOTED([WITH_BHYVE], 1, [whether bhyve driver is enabled])
AC_DEFINE_UNQUOTED([BHYVE], ["$BHYVE"],
[Location of the bhyve tool])
AC_DEFINE_UNQUOTED([BHYVECTL], ["$BHYVECTL"],
[Location of the bhyvectl tool])
AC_DEFINE_UNQUOTED([BHYVELOAD], ["$BHYVELOAD"],
[Location of the bhyveload tool])
fi
AM_CONDITIONAL([WITH_BHYVE], [test "$with_bhyve" = "yes"])
])
dnl Build with gnulib's getopt which contains a reentrant interface
AC_DEFUN([gl_REPLACE_GETOPT_ALWAYS], [])
AC_DEFUN([LIBVIRT_DRIVER_RESULT_BHYVE],[
AC_MSG_NOTICE([ Bhyve: $with_bhyve])
])