summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2013-01-25 21:33:26 +0100
committerGuido Günther <agx@sigxcpu.org>2013-01-25 21:33:26 +0100
commit9335bdd76d10a33df7e10d89f1cfb948672b586f (patch)
tree7d137de7be84e323137a7307cd1396a9677723e9 /m4
parente72245657ff92f2c6671fe33ee607cd1a93aba31 (diff)
New upstream version 1.0.2~rc1
Diffstat (limited to 'm4')
-rw-r--r--m4/virt-apparmor.m442
-rw-r--r--m4/virt-attr.m49
-rw-r--r--m4/virt-audit.m427
-rw-r--r--m4/virt-avahi.m426
-rw-r--r--m4/virt-blkid.m426
-rw-r--r--m4/virt-capng.m426
-rw-r--r--m4/virt-compile-warnings.m422
-rw-r--r--m4/virt-curl.m434
-rw-r--r--m4/virt-dbus.m436
-rw-r--r--m4/virt-fuse.m426
-rw-r--r--m4/virt-hal.m426
-rw-r--r--m4/virt-lib.m4391
-rw-r--r--m4/virt-netcf.m440
-rw-r--r--m4/virt-numactl.m426
-rw-r--r--m4/virt-openwsman.m426
-rw-r--r--m4/virt-pciaccess.m426
-rw-r--r--m4/virt-result.m442
-rw-r--r--m4/virt-sanlock.m456
-rw-r--r--m4/virt-sasl.m429
-rw-r--r--m4/virt-selinux.m451
-rw-r--r--m4/virt-ssh2.m426
-rw-r--r--m4/virt-udev.m432
-rw-r--r--m4/virt-yajl.m451
23 files changed, 1096 insertions, 0 deletions
diff --git a/m4/virt-apparmor.m4 b/m4/virt-apparmor.m4
new file mode 100644
index 000000000..b358b129c
--- /dev/null
+++ b/m4/virt-apparmor.m4
@@ -0,0 +1,42 @@
+dnl The libapparmor.so library
+dnl
+dnl Copyright (C) 2012-2013 Red Hat, Inc.
+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_CHECK_APPARMOR],[
+ LIBVIRT_CHECK_LIB([APPARMOR], [apparmor],
+ [aa_change_profile], [sys/apparmor.h])
+
+ AC_ARG_WITH([apparmor_mount],
+ AC_HELP_STRING([--with-apparmor-mount],
+ [set AppArmor mount point @<:@default=check@:>@]),
+ [],
+ [with_apparmor_mount=check])
+
+ if test "$with_apparmor" = "yes"; then
+ AC_DEFINE_UNQUOTED([APPARMOR_DIR],
+ "/etc/apparmor.d",
+ [path to apparmor directory])
+ AC_DEFINE_UNQUOTED([APPARMOR_PROFILES_PATH],
+ "/sys/kernel/security/apparmor/profiles",
+ [path to kernel profiles])
+ fi
+])
+
+AC_DEFUN([LIBVIRT_RESULT_APPARMOR],[
+ LIBVIRT_RESULT_LIB([APPARMOR])
+])
diff --git a/m4/virt-attr.m4 b/m4/virt-attr.m4
new file mode 100644
index 000000000..341b35b98
--- /dev/null
+++ b/m4/virt-attr.m4
@@ -0,0 +1,9 @@
+dnl The libattr.so library
+
+AC_DEFUN([LIBVIRT_CHECK_ATTR],[
+ LIBVIRT_CHECK_LIB([ATTR], [attr], [getxattr], [attr/xattr.h])
+])
+
+AC_DEFUN([LIBVIRT_RESULT_ATTR],[
+ LIBVIRT_RESULT_LIB([ATTR])
+])
diff --git a/m4/virt-audit.m4 b/m4/virt-audit.m4
new file mode 100644
index 000000000..60bf76cc7
--- /dev/null
+++ b/m4/virt-audit.m4
@@ -0,0 +1,27 @@
+dnl The libaudit.so library
+dnl
+dnl Copyright (C) 2012-2013 Red Hat, Inc.
+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_CHECK_AUDIT],[
+ LIBVIRT_CHECK_LIB([AUDIT], [audit],
+ [audit_encode_nv_string], [libaudit.h])
+])
+
+AC_DEFUN([LIBVIRT_RESULT_AUDIT],[
+ LIBVIRT_RESULT_LIB([AUDIT])
+])
diff --git a/m4/virt-avahi.m4 b/m4/virt-avahi.m4
new file mode 100644
index 000000000..d0ac86c23
--- /dev/null
+++ b/m4/virt-avahi.m4
@@ -0,0 +1,26 @@
+dnl The libavahi.so library
+dnl
+dnl Copyright (C) 2012-2013 Red Hat, Inc.
+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_CHECK_AVAHI],[
+ LIBVIRT_CHECK_PKG([AVAHI], [avahi-client], [0.6.0])
+])
+
+AC_DEFUN([LIBVIRT_RESULT_AVAHI],[
+ LIBVIRT_RESULT_LIB([AVAHI])
+])
diff --git a/m4/virt-blkid.m4 b/m4/virt-blkid.m4
new file mode 100644
index 000000000..69b7cf47c
--- /dev/null
+++ b/m4/virt-blkid.m4
@@ -0,0 +1,26 @@
+dnl The libblkid.so library
+dnl
+dnl Copyright (C) 2012-2013 Red Hat, Inc.
+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_CHECK_BLKID],[
+ LIBVIRT_CHECK_PKG([BLKID], [blkid], [2.17])
+])
+
+AC_DEFUN([LIBVIRT_RESULT_BLKID],[
+ LIBVIRT_RESULT_LIB([BLKID])
+])
diff --git a/m4/virt-capng.m4 b/m4/virt-capng.m4
new file mode 100644
index 000000000..ab08321c9
--- /dev/null
+++ b/m4/virt-capng.m4
@@ -0,0 +1,26 @@
+dnl The libcapng.so library
+dnl
+dnl Copyright (C) 2012-2013 Red Hat, Inc.
+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_CHECK_CAPNG],[
+ LIBVIRT_CHECK_LIB([CAPNG], [cap-ng], [capng_updatev], [cap-ng.h])
+])
+
+AC_DEFUN([LIBVIRT_RESULT_CAPNG],[
+ LIBVIRT_RESULT_LIB([CAPNG])
+])
diff --git a/m4/virt-compile-warnings.m4 b/m4/virt-compile-warnings.m4
index 4a0f28929..a08fcac9f 100644
--- a/m4/virt-compile-warnings.m4
+++ b/m4/virt-compile-warnings.m4
@@ -95,6 +95,22 @@ AC_DEFUN([LIBVIRT_COMPILE_WARNINGS],[
dontwarn="$dontwarn -Wmissing-declarations"
fi
+ dnl Check whether strchr(s, char variable) causes a bogus compile
+ dnl warning, which is the case with GCC < 4.6 on some glibc
+ AC_CACHE_CHECK([whether GCC -Wlogical-op gives bogus warnings],
+ [lv_cv_gcc_wlogical_op_broken], [
+ save_CFLAGS="$CFLAGS"
+ CFLAGS="-O2 -Wlogical-op -Werror"
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+ #include <string.h>
+ ]], [[
+ const char *haystack;
+ char needle;
+ return strchr(haystack, needle) == haystack;]])],
+ [lv_cv_gcc_wlogical_op_broken=no],
+ [lv_cv_gcc_wlogical_op_broken=yes])
+ CFLAGS="$save_CFLAGS"])
+
# We might fundamentally need some of these disabled forever, but
# ideally we'd turn many of them on
dontwarn="$dontwarn -Wfloat-equal"
@@ -196,4 +212,10 @@ AC_DEFUN([LIBVIRT_COMPILE_WARNINGS],[
WARN_PYTHON_CFLAGS=$WARN_CFLAGS
AC_SUBST(WARN_PYTHON_CFLAGS)
WARN_CFLAGS=$save_WARN_CFLAGS
+
+ if test "$gl_cv_warn_c__Wlogical_op" = yes &&
+ test "$lv_cv_gcc_wlogical_op_broken" = yes; then
+ AC_DEFINE_UNQUOTED([BROKEN_GCC_WLOGICALOP], 1,
+ [Define to 1 if gcc -Wlogical-op reports false positives on strchr])
+ fi
])
diff --git a/m4/virt-curl.m4 b/m4/virt-curl.m4
new file mode 100644
index 000000000..8b71119b8
--- /dev/null
+++ b/m4/virt-curl.m4
@@ -0,0 +1,34 @@
+dnl The libcurl.so library
+dnl
+dnl Copyright (C) 2012-2013 Red Hat, Inc.
+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_CHECK_CURL],[
+ LIBVIRT_CHECK_PKG([CURL], [libcurl], [7.18.0])
+
+ # XXX as of libcurl-devel-7.20.1-3.fc13.x86_64, curl ships a version
+ # of <curl/curl.h> that #defines several wrapper macros around underlying
+ # functions to add type safety for gcc only. However, these macros
+ # spuriously trip gcc's -Wlogical-op warning. Avoid the warning by
+ # disabling the wrappers; even if it removes some type-check safety.
+ CURL_CFLAGS="-DCURL_DISABLE_TYPECHECK $CURL_CFLAGS"
+ AC_SUBST(CURL_CFLAGS)
+])
+
+AC_DEFUN([LIBVIRT_RESULT_CURL],[
+ LIBVIRT_RESULT_LIB([CURL])
+])
diff --git a/m4/virt-dbus.m4 b/m4/virt-dbus.m4
new file mode 100644
index 000000000..16cb864c9
--- /dev/null
+++ b/m4/virt-dbus.m4
@@ -0,0 +1,36 @@
+dnl The libdbus.so library
+dnl
+dnl Copyright (C) 2012-2013 Red Hat, Inc.
+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_CHECK_DBUS],[
+ LIBVIRT_CHECK_PKG([DBUS], [dbus-1], [1.0.0])
+
+ if test "$with_dbus" = "yes" ; then
+ old_CFLAGS="$CFLAGS"
+ old_LIBS="$CFLAGS"
+ CFLAGS="$CFLAGS $DBUS_CFLAGS"
+ LIBS="$LIBS $DBUS_LIBS"
+ AC_CHECK_FUNCS([dbus_watch_get_unix_fd])
+ CFLAGS="$old_CFLAGS"
+ LIBS="$old_LIBS"
+ fi
+])
+
+AC_DEFUN([LIBVIRT_RESULT_DBUS],[
+ LIBVIRT_RESULT_LIB([DBUS])
+])
diff --git a/m4/virt-fuse.m4 b/m4/virt-fuse.m4
new file mode 100644
index 000000000..0e723f258
--- /dev/null
+++ b/m4/virt-fuse.m4
@@ -0,0 +1,26 @@
+dnl The libfuse.so library
+dnl
+dnl Copyright (C) 2012-2013 Red Hat, Inc.
+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_CHECK_FUSE],[
+ LIBVIRT_CHECK_PKG([FUSE], [fuse], [2.8.6])
+])
+
+AC_DEFUN([LIBVIRT_RESULT_FUSE],[
+ LIBVIRT_RESULT_LIB([FUSE])
+])
diff --git a/m4/virt-hal.m4 b/m4/virt-hal.m4
new file mode 100644
index 000000000..49a843064
--- /dev/null
+++ b/m4/virt-hal.m4
@@ -0,0 +1,26 @@
+dnl The libhal.so library
+dnl
+dnl Copyright (C) 2012-2013 Red Hat, Inc.
+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_CHECK_HAL],[
+ LIBVIRT_CHECK_PKG([HAL], [hal], [0.5.0])
+])
+
+AC_DEFUN([LIBVIRT_RESULT_HAL],[
+ LIBVIRT_RESULT_LIB([HAL])
+])
diff --git a/m4/virt-lib.m4 b/m4/virt-lib.m4
new file mode 100644
index 000000000..778cd40a6
--- /dev/null
+++ b/m4/virt-lib.m4
@@ -0,0 +1,391 @@
+dnl
+dnl virt-lib.m4: Helper macros for checking for libraries
+dnl
+dnl Copyright (C) 2012-2013 Red Hat, Inc.
+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
+
+
+dnl Probe for existence of libXXXX and set WITH_XXX
+dnl config header var, WITH_XXXX make conditional and
+dnl with_XXX configure shell var.
+dnl
+dnl LIBVIRT_CHECK_LIB([CHECK_NAME], [LIBRARY_NAME],
+dnl [FUNCTION_NAME], [HEADER_NAME])
+dnl
+dnl CHECK_NAME: Suffix/prefix used for variables / flags, in uppercase.
+dnl Used to set
+dnl config.h: WITH_XXX macro
+dnl Makefile: WITH_XXX conditional
+dnl Makefile: XXX_CFLAGS, XXX_LIBS variables
+dnl configure: --with-xxx argument
+dnl configure: with_xxx variable
+dnl
+dnl LIBRARY_NAME: base name of library to check for eg libXXX.so
+dnl FUNCTION_NAME: function to check for in libXXX.so
+dnl HEADER_NAME: header file to check for
+dnl
+dnl e.g.
+dnl
+dnl LIBVIRT_CHECK_LIB([SELINUX], [selinux],
+dnl [getfilecon], [selinux/selinux.h])
+dnl LIBVIRT_CHECK_LIB([SANLOCK], [sanlock_client],
+dnl [sanlock_init], [sanlock.h])
+dnl LIBVIRT_CHECK_LIB([LIBATTR], [attr],
+dnl [getxattr], [attr/attr.h])
+dnl
+AC_DEFUN([LIBVIRT_CHECK_LIB],[
+ m4_pushdef([check_name], [$1])
+ m4_pushdef([library_name], [$2])
+ m4_pushdef([function_name], [$3])
+ m4_pushdef([header_name], [$4])
+
+ m4_pushdef([check_name_lc], m4_tolower(check_name))
+
+ m4_pushdef([config_var], [WITH_]check_name)
+ m4_pushdef([make_var], [WITH_]check_name)
+ m4_pushdef([cflags_var], check_name[_CFLAGS])
+ m4_pushdef([libs_var], check_name[_LIBS])
+ m4_pushdef([arg_var], [with-]check_name_lc)
+ m4_pushdef([with_var], [with_]check_name_lc)
+
+ AC_ARG_WITH(check_name_lc,
+ [AS_HELP_STRING([--arg_var],
+ [with lib]]m4_dquote(library_name)[[ support @<:@default=check@:>@])],
+ [],[with_var][=check])
+
+ old_LIBS=$LIBS
+ old_CFLAGS=$CFLAGS
+ cflags_var=
+ libs_var=
+
+ fail=0
+ if test "x$with_var" != "xno" ; then
+ if test "x$with_var" != "xyes" && test "x$with_var" != "xcheck" ; then
+ cflags_var="-I$with_var/include"
+ libs_var="-L$with_var/lib"
+ fi
+ CFLAGS="$CFLAGS $cflags_var"
+ LIBS="$LIBS $libs_var"
+ AC_CHECK_LIB(library_name, function_name, [],[
+ if test "x$with_var" != "xcheck"; then
+ fail=1
+ fi
+ with_var=no
+ ])
+ if test "$fail" = "0" && test "x$with_var" != "xno" ; then
+ AC_CHECK_HEADER([header_name], [
+ with_var=yes
+ ],[
+ if test "x$with_var" != "xcheck"; then
+ fail=1
+ fi
+ with_var=no
+ ])
+ fi
+ fi
+
+ LIBS=$old_LIBS
+ CFLAGS=$old_CFLAGS
+
+ if test $fail = 1; then
+ AC_MSG_ERROR([You must install the lib]library_name[ library & headers to compile libvirt])
+ else
+ if test "x$with_var" = "xyes" ; then
+ if test "x$libs_var" = 'x' ; then
+ libs_var="-l[]library_name"
+ else
+ libs_var="$libs_var -l[]library_name"
+ fi
+ AC_DEFINE_UNQUOTED(config_var, 1, [whether lib]library_name[ is available])
+ fi
+
+ AM_CONDITIONAL(make_var, [test "x$with_var" = "xyes"])
+
+ AC_SUBST(cflags_var)
+ AC_SUBST(libs_var)
+ fi
+
+ m4_popdef([with_var])
+ m4_popdef([arg_var])
+ m4_popdef([libs_var])
+ m4_popdef([cflags_var])
+ m4_popdef([make_var])
+ m4_popdef([config_var])
+
+ m4_popdef([check_name_lc])
+
+ m4_popdef([header_name])
+ m4_popdef([function_name])
+ m4_popdef([library_name])
+ m4_popdef([check_name])
+])
+
+dnl Probe for existence of libXXXX and set WITH_XXX
+dnl config header var, WITH_XXXX make conditional and
+dnl with_XXX configure shell var.
+dnl
+dnl LIBVIRT_CHECK_LIB_ALT([CHECK_NAME], [LIBRARY_NAME],
+dnl [FUNCTION_NAME], [HEADER_NAME],
+dnl [CHECK_NAME_ALT, [LIBRARY_NAME_ALT],
+dnl [FUNCTION_NAME_ALT], [HEADER_NAME_ALT])
+dnl
+dnl CHECK_NAME: Suffix/prefix used for variables / flags, in uppercase.
+dnl Used to set
+dnl config.h: WITH_XXX macro
+dnl Makefile: WITH_XXX conditional
+dnl Makefile: XXX_CFLAGS, XXX_LIBS variables
+dnl configure: --with-xxx argument
+dnl configure: with_xxx variable
+dnl
+dnl LIBRARY_NAME: base name of library to check for eg libXXX.so
+dnl FUNCTION_NAME: function to check for in libXXX.so
+dnl HEADER_NAME: header file to check for
+dnl
+dnl CHECK_NAME_ALT: Suffix/prefix used to set additional
+dnl variables if alternative check succeeds
+dnl config.h: WITH_XXX macro
+dnl Makefile: WITH_XXX conditional
+dnl NB all vars for CHECK_NAME are also set
+dnl LIBRARY_NAME_ALT: alternative library name to check for
+dnl FUNCTION_NAME_ALT: alternative function name to check for
+dnl HEADER_NAME_ALT: alternative header file to check for
+dnl
+dnl e.g.
+dnl
+dnl LIBVIRT_CHECK_LIB([YAJL], [yajl],
+dnl [yajl_parse_complete], [yajl/yajl_common.h],
+dnl [YAJL2], [yajl],
+dnl [yajl_tree_parse], [yajl/yajl_common.h])
+dnl
+AC_DEFUN([LIBVIRT_CHECK_LIB_ALT],[
+ m4_pushdef([check_name], [$1])
+ m4_pushdef([library_name], [$2])
+ m4_pushdef([function_name], [$3])
+ m4_pushdef([header_name], [$4])
+ m4_pushdef([check_name_alt], [$5])
+ m4_pushdef([library_name_alt], [$6])
+ m4_pushdef([function_name_alt], [$7])
+ m4_pushdef([header_name_alt], [$8])
+
+ m4_pushdef([check_name_lc], m4_tolower(check_name))
+
+ m4_pushdef([config_var], [WITH_]check_name)
+ m4_pushdef([make_var], [WITH_]check_name)
+ m4_pushdef([cflags_var], check_name[_CFLAGS])
+ m4_pushdef([libs_var], check_name[_LIBS])
+ m4_pushdef([arg_var], [with-]check_name_lc)
+ m4_pushdef([with_var], [with_]check_name_lc)
+ m4_pushdef([config_var_alt], [WITH_]check_name_alt)
+ m4_pushdef([make_var_alt], [WITH_]check_name_alt)
+
+ AC_ARG_WITH(check_name_lc,
+ [AS_HELP_STRING([--arg_var],
+ [with lib]]m4_dquote(library_name)[[ support @<:@default=check@:>@])],
+ [],[with_var][=check])
+
+ old_LIBS=$LIBS
+ old_CFLAGS=$CFLAGS
+ cflags_var=
+ libs_var=
+
+ fail=0
+ alt=0
+ if test "x$with_var" != "xno" ; then
+ if test "x$with_var" != "xyes" && test "x$with_var" != "xcheck" ; then
+ cflags_var="-I$with_var/include"
+ libs_var="-L$with_var/lib"
+ fi
+ CFLAGS="$CFLAGS $cflags_var"
+ LIBS="$LIBS $libs_var"
+ AC_CHECK_LIB(library_name, function_name, [],[
+ AC_CHECK_LIB(library_name_alt, function_name_alt, [
+ alt=1
+ ],[
+ if test "x$with_var" != "xcheck"; then
+ fail=1
+ fi
+ with_var=no
+ ])
+ ])
+ if test "$fail" = "0" && test "x$with_var" != "xno" ; then
+ AC_CHECK_HEADER([header_name], [
+ with_var=yes
+ ],[
+ AC_CHECK_HEADER([header_name_alt], [
+ with_var=yes
+ ],[
+ if test "x$with_var" != "xcheck"; then
+ fail=1
+ fi
+ with_var=no
+ ])
+ ])
+ fi
+ fi
+
+ LIBS=$old_LIBS
+ CFLAGS=$old_CFLAGS
+
+ if test $fail = 1; then
+ AC_MSG_ERROR([You must install the lib]library_name[ library & headers to compile libvirt])
+ else
+ if test "x$with_var" = "xyes" ; then
+ if test "x$libs_var" = 'x' ; then
+ libs_var="-l[]library_name"
+ else
+ libs_var="$libs_var -l[]library_name"
+ fi
+
+ AC_DEFINE_UNQUOTED(config_var, 1, [whether lib]library_name[ is available])
+ if test "$alt" = "1" ; then
+ AC_DEFINE_UNQUOTED(config_var_alt, 1, [whether lib]library_name[ is available])
+ fi
+ fi
+
+ AM_CONDITIONAL(make_var, [test "x$with_var" = "xyes"])
+ AM_CONDITIONAL(make_var_alt, [test "x$with_var" = "xyes" && test "$alt" = "1"])
+
+ AC_SUBST(cflags_var)
+ AC_SUBST(libs_var)
+ fi
+
+ m4_popdef([make_var_alt])
+ m4_popdef([config_var_alt])
+ m4_popdef([with_var])
+ m4_popdef([arg_var])
+ m4_popdef([libs_var])
+ m4_popdef([cflags_var])
+ m4_popdef([make_var])
+ m4_popdef([config_var])
+
+ m4_popdef([check_name_lc])
+
+ m4_popdef([header_name_alt])
+ m4_popdef([function_name_alt])
+ m4_popdef([library_name_alt])
+ m4_popdef([header_name])
+ m4_popdef([function_name])
+ m4_popdef([library_name])
+ m4_popdef([check_name])
+])
+
+dnl
+dnl Probe for existence of libXXXX and set WITH_XXX
+dnl config header var, WITH_XXXX make conditional and
+dnl with_XXX configure shell var.
+dnl
+dnl LIBVIRT_CHECK_PKG([CHECK_NAME], [PC_NAME], [PC_VERSION])
+dnl
+dnl CHECK_NAME: Suffix/prefix used for variables / flags, in uppercase.
+dnl Used to set
+dnl config.h: WITH_XXX macro
+dnl Makefile: WITH_XXX conditional
+dnl Makefile: XXX_CFLAGS, XXX_LIBS variables
+dnl configure: --with-xxx argument
+dnl configure: with_xxx variable
+dnl PC_NAME: Name of the pkg-config module
+dnl PC_VERSION: Version of the pkg-config module
+dnl
+dnl eg
+dnl
+dnl LIBVIRT_CHECK_PKG([NETCF], [netcf], [0.1.4])
+dnl
+AC_DEFUN([LIBVIRT_CHECK_PKG],[
+ m4_pushdef([check_name], [$1])
+ m4_pushdef([pc_name], [$2])
+ m4_pushdef([pc_version], [$3])
+
+ m4_pushdef([check_name_lc], m4_tolower(check_name))
+
+ m4_pushdef([config_var], [WITH_]check_name)
+ m4_pushdef([make_var], [WITH_]check_name)
+ m4_pushdef([cflags_var], check_name[_CFLAGS])
+ m4_pushdef([libs_var], check_name[_LIBS])
+ m4_pushdef([arg_var], [with-]check_name_lc)
+ m4_pushdef([with_var], [with_]check_name_lc)
+
+ AC_ARG_WITH(check_name_lc,
+ [AS_HELP_STRING([--arg_var],
+ [with ]]m4_dquote(pc_name)[[ (>= ]]m4_dquote(pc_version)[[) support @<:@default=check@:>@])],
+ [],[with_var][=check])
+
+ fail=0
+ if test "x$with_var" != "xno" ; then
+ PKG_CHECK_MODULES(check_name, pc_name[ >= ]pc_version, [
+ with_var=yes
+ ],[
+ if test "x$with_var" != "xcheck"; then
+ fail=1
+ fi
+ with_var=no
+ ])
+ fi
+
+ if test $fail = 1; then
+ AC_MSG_ERROR([You must install the ]pc_name[ >= ]pc_version[pkg-config module to compile libvirt])
+ fi
+
+ if test "x$with_var" = "xyes" ; then
+ AC_DEFINE_UNQUOTED(config_var, 1, [whether ]pc_name[ >= ]pc_version[ is available])
+ fi
+
+ AM_CONDITIONAL(make_var, [test "x$with_var" = "xyes"])
+
+ m4_popdef([with_var])
+ m4_popdef([arg_var])
+ m4_popdef([libs_var])
+ m4_popdef([cflags_var])
+ m4_popdef([make_var])
+ m4_popdef([config_var])
+
+ m4_popdef([check_name_lc])
+
+ m4_popdef([pc_version])
+ m4_popdef([pc_name])
+ m4_popdef([check_name])
+])
+
+dnl
+dnl To be used after a call to LIBVIRT_CHECK_LIB,
+dnl LIBVIRT_CHECK_LIB_ALT or LIBVIRT_CHECK_PKG
+dnl to print the result status
+dnl
+dnl LIBVIRT_RESULT_LIB([CHECK_NAME])
+dnl
+dnl CHECK_NAME: Suffix/prefix used for variables / flags, in uppercase.
+dnl
+dnl LIBVIRT_RESULT_LIB([SELINUX])
+dnl
+AC_DEFUN([LIBVIRT_RESULT_LIB],[
+ m4_pushdef([check_name], [$1])
+
+ m4_pushdef([check_name_lc], m4_tolower(check_name))
+
+ m4_pushdef([cflags_var], check_name[_CFLAGS])
+ m4_pushdef([libs_var], check_name[_LIBS])
+ m4_pushdef([with_var], [with_]check_name_lc)
+
+ LIBVIRT_RESULT(check_name_lc, [$with_var], [CFLAGS='$cflags_var' LIBS='$libs_var'])
+
+ m4_popdef([with_var])
+ m4_popdef([libs_var])
+ m4_popdef([cflags_var])
+
+ m4_popdef([check_name_lc])
+
+ m4_popdef([check_name])
+])
diff --git a/m4/virt-netcf.m4 b/m4/virt-netcf.m4
new file mode 100644
index 000000000..8d123c75a
--- /dev/null
+++ b/m4/virt-netcf.m4
@@ -0,0 +1,40 @@
+dnl The libnetcf.so library
+dnl
+dnl Copyright (C) 2012-2013 Red Hat, Inc.
+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_CHECK_NETCF],[
+ LIBVIRT_CHECK_PKG([NETCF], [netcf], [0.1.4])
+
+ if test "$with_netcf" = "yes" ; then
+ old_CFLAGS="$CFLAGS"
+ old_LIBS="$CFLAGS"
+ CFLAGS="$CFLAGS $NETCF_CFLAGS"
+ LIBS="$LIBS $NETCF_LIBS"
+ AC_CHECK_FUNC([ncf_change_begin], [netcf_transactions=1], [netcf_transactions=0])
+ if test "$netcf_transactions" = "1" ; then
+ AC_DEFINE_UNQUOTED([HAVE_NETCF_TRANSACTIONS], [1],
+ [we have sufficiently new version of netcf for transaction network API])
+ fi
+ CFLAGS="$old_CFLAGS"
+ LIBS="$old_LIBS"
+ fi
+])
+
+AC_DEFUN([LIBVIRT_RESULT_NETCF],[
+ LIBVIRT_RESULT_LIB([NETCF])
+])
diff --git a/m4/virt-numactl.m4 b/m4/virt-numactl.m4
new file mode 100644
index 000000000..1dcb029a4
--- /dev/null
+++ b/m4/virt-numactl.m4
@@ -0,0 +1,26 @@
+dnl The libnuma.so library
+dnl
+dnl Copyright (C) 2012-2013 Red Hat, Inc.
+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_CHECK_NUMACTL],[
+ LIBVIRT_CHECK_LIB([NUMACTL], [numa], [numa_available], [numa.h])
+])
+
+AC_DEFUN([LIBVIRT_RESULT_NUMACTL],[
+ LIBVIRT_RESULT_LIB([NUMACTL])
+])
diff --git a/m4/virt-openwsman.m4 b/m4/virt-openwsman.m4
new file mode 100644
index 000000000..8ab18c6aa
--- /dev/null
+++ b/m4/virt-openwsman.m4
@@ -0,0 +1,26 @@
+dnl The libopenwsman.so library
+dnl
+dnl Copyright (C) 2012-2013 Red Hat, Inc.
+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_CHECK_OPENWSMAN],[
+ LIBVIRT_CHECK_PKG([OPENWSMAN], [openwsman], [2.2.3])
+])
+
+AC_DEFUN([LIBVIRT_RESULT_OPENWSMAN],[
+ LIBVIRT_RESULT_LIB([OPENWSMAN])
+])
diff --git a/m4/virt-pciaccess.m4 b/m4/virt-pciaccess.m4
new file mode 100644
index 000000000..2f5c95812
--- /dev/null
+++ b/m4/virt-pciaccess.m4
@@ -0,0 +1,26 @@
+dnl The libpciaccess.so library
+dnl
+dnl Copyright (C) 2012-2013 Red Hat, Inc.
+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_CHECK_PCIACCESS],[
+ LIBVIRT_CHECK_PKG([PCIACCESS], [pciaccess], [0.10.0])
+])
+
+AC_DEFUN([LIBVIRT_RESULT_PCIACCESS],[
+ LIBVIRT_RESULT_LIB([PCIACCESS])
+])
diff --git a/m4/virt-result.m4 b/m4/virt-result.m4
new file mode 100644
index 000000000..cc622fe35
--- /dev/null
+++ b/m4/virt-result.m4
@@ -0,0 +1,42 @@
+dnl
+dnl virt-result.m4: Helper macros for checking for libraries
+dnl
+dnl Copyright (C) 2012-2013 Red Hat, Inc.
+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
+
+dnl
+dnl To be used to print the results of a conditional test
+dnl
+dnl LIBVIRT_RESULT(CHECK_NAME, STATUS, DETAILS)
+dnl
+dnl CHECK_NAME: Name of the item being checked
+dnl STATUS: 'yes' or 'no' result of check
+dnl DETAILS: Details of result eg compiler flags
+dnl
+dnl eg
+dnl
+dnl LIBVIRT_RESULT([yajl], [yes], [-I/opt/yajl/include -lyajl])
+dnl
+AC_DEFUN([LIBVIRT_RESULT], [
+ if test "$2" = "no" || test -z "$3" ; then
+ STR=`printf "%10s: %-3s" "$1" "$2"`
+ else
+ STR=`printf "%10s: %-3s (%s)" "$1" "$2" "$3"`
+ fi
+
+ AC_MSG_NOTICE([$STR])
+])
diff --git a/m4/virt-sanlock.m4 b/m4/virt-sanlock.m4
new file mode 100644
index 000000000..c7c0186f8
--- /dev/null
+++ b/m4/virt-sanlock.m4
@@ -0,0 +1,56 @@
+dnl The libsanlock_client.so library
+dnl
+dnl Copyright (C) 2012-2013 Red Hat, Inc.
+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_CHECK_SANLOCK],[
+ LIBVIRT_CHECK_LIB([SANLOCK], [sanlock_client], [sanlock_init], [sanlock.h])
+
+ if test "x$with_sanlock" = "xyes" ; then
+ AC_CHECK_DECLS([SANLK_INQ_WAIT], [sanlock_inq_wait=1], [sanlock_inq_wait=0], [[
+ #include <stdint.h>
+ #include <sanlock_admin.h>
+ ]])
+
+ old_cppflags="$CPPFLAGS"
+ old_libs="$LIBS"
+ CPPFLAGS="$CPPFLAGS $SANLOCK_CFLAGS"
+ LIBS="$LIBS $SANLOCK_LIBS"
+
+ AC_CHECK_LIB([sanlock_client], [sanlock_killpath],
+ [sanlock_killpath=yes], [sanlock_killpath=no])
+ if test "x$sanlock_killpath" = "xyes" ; then
+ AC_DEFINE_UNQUOTED([HAVE_SANLOCK_KILLPATH], 1,
+ [whether Sanlock supports sanlock_killpath])
+ fi
+
+ AC_CHECK_LIB([sanlock_client], [sanlock_inq_lockspace],
+ [sanlock_inq_lockspace=yes], [sanlock_inq_lockspace=no])
+ if test "x$sanlock_inq_lockspace" = "xyes" && \
+ test $sanlock_inq_wait = 1; then
+ AC_DEFINE_UNQUOTED([HAVE_SANLOCK_INQ_LOCKSPACE], 1,
+ [whether sanlock supports sanlock_inq_lockspace])
+ fi
+
+ CPPFLAGS="$old_cppflags"
+ LIBS="$old_libs"
+ fi
+])
+
+AC_DEFUN([LIBVIRT_RESULT_SANLOCK],[
+ LIBVIRT_RESULT_LIB([SANLOCK])
+])
diff --git a/m4/virt-sasl.m4 b/m4/virt-sasl.m4
new file mode 100644
index 000000000..8fb5d7f4f
--- /dev/null
+++ b/m4/virt-sasl.m4
@@ -0,0 +1,29 @@
+dnl The libsasl2.so or libsasl.so library
+dnl
+dnl Copyright (C) 2012-2013 Red Hat, Inc.
+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_CHECK_SASL],[
+ LIBVIRT_CHECK_LIB_ALT([SASL], [sasl2],
+ [sasl_client_init], [sasl/sasl.h],
+ [SASL1], [sasl],
+ [sasl_client_init], [sasl/sasl.h])
+])
+
+AC_DEFUN([LIBVIRT_RESULT_SASL],[
+ LIBVIRT_RESULT_LIB([SASL])
+])
diff --git a/m4/virt-selinux.m4 b/m4/virt-selinux.m4
new file mode 100644
index 000000000..abb0d1284
--- /dev/null
+++ b/m4/virt-selinux.m4
@@ -0,0 +1,51 @@
+dnl The libselinux.so library
+dnl
+dnl Copyright (C) 2012-2013 Red Hat, Inc.
+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_CHECK_SELINUX],[
+ LIBVIRT_CHECK_LIB([SELINUX], [selinux],
+ [fgetfilecon_raw], [selinux/selinux.h])
+
+ AC_ARG_WITH([selinux_mount],
+ AC_HELP_STRING([--with-selinux-mount], [set SELinux mount point @<:@default=check@:>@]),
+ [],
+ [with_selinux_mount=check])
+
+ if test "$with_selinux" = "yes"; then
+ AC_MSG_CHECKING([SELinux mount point])
+ if test "$with_selinux_mount" = "check" || test -z "$with_selinux_mount"; then
+ if test -d /sys/fs/selinux ; then
+ SELINUX_MOUNT=/sys/fs/selinux
+ else
+ SELINUX_MOUNT=/selinux
+ fi
+ else
+ SELINUX_MOUNT=$with_selinux_mount
+ fi
+ AC_MSG_RESULT([$SELINUX_MOUNT])
+ AC_DEFINE_UNQUOTED([SELINUX_MOUNT], ["$SELINUX_MOUNT"], [SELinux mount point])
+
+ dnl We prefer to use <selinux/label.h> and selabel_open, but can fall
+ dnl back to matchpathcon for the sake of RHEL 5's version of libselinux.
+ AC_CHECK_HEADERS([selinux/label.h])
+ fi
+])
+
+AC_DEFUN([LIBVIRT_RESULT_SELINUX],[
+ LIBVIRT_RESULT_LIB([SELINUX])
+])
diff --git a/m4/virt-ssh2.m4 b/m4/virt-ssh2.m4
new file mode 100644
index 000000000..4479fbaea
--- /dev/null
+++ b/m4/virt-ssh2.m4
@@ -0,0 +1,26 @@
+dnl The libssh2.so library
+dnl
+dnl Copyright (C) 2012-2013 Red Hat, Inc.
+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_CHECK_SSH2],[
+ LIBVIRT_CHECK_PKG([SSH2], [libssh2], [1.3])
+])
+
+AC_DEFUN([LIBVIRT_RESULT_SSH2],[
+ LIBVIRT_RESULT_LIB([SSH2])
+])
diff --git a/m4/virt-udev.m4 b/m4/virt-udev.m4
new file mode 100644
index 000000000..55673bf20
--- /dev/null
+++ b/m4/virt-udev.m4
@@ -0,0 +1,32 @@
+dnl The libudev.so library
+dnl
+dnl Copyright (C) 2012-2013 Red Hat, Inc.
+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_CHECK_UDEV],[
+ AC_REQUIRE([LIBVIRT_CHECK_PCIACCESS])
+ LIBVIRT_CHECK_PKG([UDEV], [libudev], [145])
+
+ if test "$with_udev" = "yes" && test "$with_pciaccess" != "yes" ; then
+ AC_MSG_ERROR([You must install the pciaccess module to build with udev])
+ fi
+])
+
+AC_DEFUN([LIBVIRT_RESULT_UDEV],[
+ AC_REQUIRE([LIBVIRT_RESULT_PCIACCESS])
+ LIBVIRT_RESULT_LIB([UDEV])
+])
diff --git a/m4/virt-yajl.m4 b/m4/virt-yajl.m4
new file mode 100644
index 000000000..adf2819ee
--- /dev/null
+++ b/m4/virt-yajl.m4
@@ -0,0 +1,51 @@
+dnl The libyajl.so library
+dnl
+dnl Copyright (C) 2012-2013 Red Hat, Inc.
+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_CHECK_YAJL],[
+ dnl YAJL JSON library http://lloyd.github.com/yajl/
+ if test "$with_qemu:$with_yajl" = yes:check; then
+ dnl Some versions of qemu require the use of yajl; try to detect them
+ dnl here, although we do not require qemu to exist in order to compile.
+ dnl This check mirrors src/qemu/qemu_capabilities.c
+ AC_PATH_PROGS([QEMU], [qemu-kvm qemu kvm qemu-system-x86_64],
+ [], [$PATH:/usr/bin:/usr/libexec])
+ if test -x "$QEMU"; then
+ if `$QEMU -help | grep libvirt` >/dev/null; then
+ with_yajl=yes
+ else
+ [qemu_version_sed='s/.*ersion \([0-9.,]*\).*/\1/']
+ qemu_version=`$QEMU -version | sed "$qemu_version_sed"`
+ case $qemu_version in
+ [[1-9]].* | 0.15.* ) with_yajl=yes ;;
+ 0.* | '' ) ;;
+ *) AC_MSG_ERROR([Unexpected qemu version string]) ;;
+ esac
+ fi
+ fi
+ fi
+
+ LIBVIRT_CHECK_LIB_ALT([YAJL], [yajl],
+ [yajl_parse_complete], [yajl/yajl_common.h],
+ [YAJL2], [yajl],
+ [yajl_tree_parse], [yajl/yajl_common.h])
+])
+
+AC_DEFUN([LIBVIRT_RESULT_YAJL],[
+ LIBVIRT_RESULT_LIB([YAJL])
+])