qemu: Move capability checks for IOMMU features
[libvirt/ericb.git] / m4 / virt-wireshark.m4
blob2eee8a6ce86d5f8432df3c22e3b8a18ef1a9ed8f
1 dnl The libvirt.so wireshark plugin
2 dnl
3 dnl Copyright (C) 2015 Red Hat, Inc.
4 dnl
5 dnl This library is free software; you can redistribute it and/or
6 dnl modify it under the terms of the GNU Lesser General Public
7 dnl License as published by the Free Software Foundation; either
8 dnl version 2.1 of the License, or (at your option) any later version.
9 dnl
10 dnl This library is distributed in the hope that it will be useful,
11 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
12 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13 dnl Lesser General Public License for more details.
14 dnl
15 dnl You should have received a copy of the GNU Lesser General Public
16 dnl License along with this library.  If not, see
17 dnl <http://www.gnu.org/licenses/>.
18 dnl
20 AC_DEFUN([LIBVIRT_ARG_WIRESHARK],[
21   LIBVIRT_ARG_WITH_FEATURE([WIRESHARK_DISSECTOR], [wireshark], [check], [2.4.0])
22   LIBVIRT_ARG_WITH([WS_PLUGINDIR],
23                    [wireshark plugins directory for use when installing
24                    wireshark plugin], [check])
27 AC_DEFUN([LIBVIRT_CHECK_WIRESHARK],[
28   LIBVIRT_CHECK_PKG([WIRESHARK_DISSECTOR], [wireshark], [2.4.0])
30   dnl Check for system location of wireshark plugins
31   if test "x$with_wireshark_dissector" != "xno" ; then
32     if test "x$with_ws_plugindir" = "xcheck" ; then
33       ws_plugindir="$($PKG_CONFIG --variable plugindir wireshark)"
34       ws_exec_prefix="$($PKG_CONFIG --variable exec_prefix wireshark)"
35       ws_modversion="$($PKG_CONFIG --modversion wireshark)"
36       if test "x$ws_plugindir" = "x" ; then
37         dnl On some systems the plugindir variable may not be stored within pkg config.
38         dnl Fall back to older style of constructing the plugin dir path.
39         ws_plugindir="$libdir/wireshark/plugins/$ws_modversion"
40       else
41         if test "x$ws_exec_prefix" = "x" ; then
42           dnl If wireshark's exec_prefix cannot be retrieved from pkg-config,
43           dnl this is our best bet
44           ws_exec_prefix="/usr"
45         fi
46         dnl Replace wireshark's exec_prefix with our own.
47         dnl Note that ${exec_prefix} is kept verbatim at this point in time,
48         dnl and will only be expanded later, when make is called: this makes
49         dnl it possible to override such prefix at compilation or installation
50         dnl time
51         ws_plugindir='${exec_prefix}'"${ws_plugindir#$ws_exec_prefix}"
52       fi
54       dnl Since wireshark 2.5.0 plugins can't live in top level
55       dnl plugindir but have to be under one of ["epan",
56       dnl "wiretap", "codecs"] subdir. The first one looks okay.
57       ws_plugindir="$ws_plugindir/epan"
59     elif test "x$with_ws_plugindir" = "xno" || test "x$with_ws_plugindir" = "xyes"; then
60       AC_MSG_ERROR([ws-plugindir must be used only with valid path])
61     else
62       ws_plugindir=$with_ws_plugindir
63     fi
64   fi
66   AC_SUBST([ws_plugindir])
69 AC_DEFUN([LIBVIRT_RESULT_WIRESHARK],[
70   LIBVIRT_RESULT_LIB([WIRESHARK_DISSECTOR])