]> xenbits.xensource.com Git - libvirt.git/commitdiff
wireshark: Make fallback path construction more reliable
authorAndrea Bolognani <abologna@redhat.com>
Thu, 27 Oct 2016 12:43:00 +0000 (14:43 +0200)
committerAndrea Bolognani <abologna@redhat.com>
Mon, 7 Nov 2016 09:16:06 +0000 (10:16 +0100)
We only need to strip $ws_prefix from $ws_plugindir if we've
retrieved it from pkg-config: if we're building it ourselves
from $libdir, we can just use it without further processing.

m4/virt-wireshark.m4

index 556272ad8a54d106c398206ecbf973cd9880ebc3..f253c86b23f5a2eb16282232dc498bc3febd9d7b 100644 (file)
@@ -35,18 +35,18 @@ AC_DEFUN([LIBVIRT_CHECK_WIRESHARK],[
         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"
+      else
+        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
+        dnl Replace the wireshark prefix with our own.
+        dnl Note that $(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}"
       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
-      dnl Replace the wireshark prefix with our own.
-      dnl Note that $(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}"
     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