wireshark: Strip prefix correctly

Even when we're building $plugindir ourselves because we can't
retrieve it using pkg-config, we still want to strip the prefix,
except in that case it would be the same prefix we're using for
building libvirt.

The fact that $plugindir is missing also doesn't tell us
anything about $ws_prefix, so we have to handle the two variables
separately.
This commit is contained in:
Andrea Bolognani 2016-10-26 13:52:08 +02:00
parent c64a0a8e32
commit debf2f0b8a

View File

@ -35,12 +35,14 @@ AC_DEFUN([LIBVIRT_CHECK_WIRESHARK],[
dnl On some systems the plugindir variable may not be stored within pkg config. 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. dnl Fall back to older style of constructing the plugin dir path.
plugindir="$libdir/wireshark/plugins/$ws_modversion" plugindir="$libdir/wireshark/plugins/$ws_modversion"
else ws_prefix="$prefix"
if test "x$ws_prefix" = "x" ; then
ws_prefix="/usr";
fi
plugindir="${plugindir#$ws_prefix}"
fi fi
if test "x$ws_prefix" = "x" ; then
dnl If the wireshark prefix cannot be retrieved from pkg-config,
dnl /usr is our best bet
ws_prefix="/usr"
fi
plugindir="${plugindir#$ws_prefix}"
elif test "x$with_ws_plugindir" = "xno" || test "x$with_ws_plugindir" = "xyes"; then 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]) AC_MSG_ERROR([ws-plugindir must be used only with valid path])
else else