>From 50ce169ed1c2fa30d2b8f13d6b1dbbd126a9b496 Mon Sep 17 00:00:00 2001
From: Viktor Mihajlovski <mihajlov@linux.vnet.ibm.com>
Date: Wed, 26 Oct 2016 17:16:32 +0200
Subject: [PATCH] wireshark: minor improvements for plugin directory
detecion/guessing
1. If libvirt's and wiresharks' libdirs are different (they
were on my system) the plugin install can fail. Fixed by evaluating
the pkg-config libdir variable.
2. May seem pedantic, but the default for libdir is ${exec_prefix}/lib
and - while uncommon - exec_prefix might be different from prefix.
So use exec_prefix instead of prefix.
3. AC_SUBST will take care of inserting ws_plugindir = @ws_plugindir@ into
Makefile.in, so that line can be removed.
Signed-off-by: Viktor Mihajlovski <mihajlov@linux.vnet.ibm.com>
---
m4/virt-wireshark.m4 | 20 ++++++++++----------
tools/Makefile.am | 1 -
2 files changed, 10 insertions(+), 11 deletions(-)
@@ -29,24 +29,24 @@ AC_DEFUN([LIBVIRT_CHECK_WIRESHARK],[
if test "x$with_wireshark_dissector" != "xno" ; then
if test "x$with_ws_plugindir" = "xcheck" ; then
ws_plugindir="$($PKG_CONFIG --variable plugindir wireshark)"
- ws_prefix="$($PKG_CONFIG --variable prefix wireshark)"
+ ws_libdir="$($PKG_CONFIG --variable libdir wireshark)"
+ ws_exec_prefix="$($PKG_CONFIG --variable exec_prefix wireshark)"
ws_modversion="$($PKG_CONFIG --modversion wireshark)"
if test "x$ws_plugindir" = "x" ; then
dnl On some systems the plugindir variable may not be stored within pkg config.
dnl Fall back to older style of constructing the plugin dir path.
- ws_plugindir="$libdir/wireshark/plugins/$ws_modversion"
- ws_prefix="$prefix"
+ ws_plugindir="$ws_libdir/wireshark/plugins/$ws_modversion"
fi
- if test "x$ws_prefix" = "x" ; then
- dnl If the wireshark prefix cannot be retrieved from pkg-config,
+ if test "x$ws_exec_prefix" = "x" ; then
+ dnl If the wireshark exec_prefix cannot be retrieved from pkg-config,
dnl /usr is our best bet
- ws_prefix="/usr"
+ ws_exec_prefix="/usr"
fi
- dnl Replace the wireshark prefix with our own.
- dnl Note that $(prefix) is kept verbatim at this point in time, and will
+ dnl Replace the wireshark exec_prefix with our own.
+ dnl Note that $(exec_prefix) is kept verbatim at this point in time, and will
dnl only be expanded later, when make is called: this makes it possible
- dnl to override the prefix at compilation or installation time
- ws_plugindir='$(prefix)'"${ws_plugindir#$ws_prefix}"
+ dnl to override the exec_prefix at compilation or installation time
+ ws_plugindir='$(exec_prefix)'"${ws_plugindir#$ws_exec_prefix}"
elif test "x$with_ws_plugindir" = "xno" || test "x$with_ws_plugindir" = "xyes"; then
AC_MSG_ERROR([ws-plugindir must be used only with valid path])
else
@@ -398,7 +398,6 @@ EXTRA_DIST += \
if WITH_WIRESHARK_DISSECTOR
-ws_plugindir = @ws_plugindir@
ws_plugin_LTLIBRARIES = wireshark/src/libvirt.la
wireshark_src_libvirt_la_CPPFLAGS = \
-I wireshark/src $(WIRESHARK_DISSECTOR_CFLAGS)
--
1.9.1