From c587c73549e5fc06782059b2a9a1bb508729a930 Mon Sep 17 00:00:00 2001 From: Andrea Bolognani Date: Wed, 26 Oct 2016 13:56:52 +0200 Subject: [PATCH] wireshark: Inject $(prefix) at the right time Adding $(prefix) in Makefile.am, as we were doing, means that it would be prepended even when using --with-ws-plugindir, which is something we don't want to happen. Instead, we add it beforehand but take care that it doesn't get expanded until make is called. --- m4/virt-wireshark.m4 | 6 +++++- tools/Makefile.am | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/m4/virt-wireshark.m4 b/m4/virt-wireshark.m4 index 90d731e2e3..c949f8a780 100644 --- a/m4/virt-wireshark.m4 +++ b/m4/virt-wireshark.m4 @@ -42,7 +42,11 @@ AC_DEFUN([LIBVIRT_CHECK_WIRESHARK],[ dnl /usr is our best bet ws_prefix="/usr" fi - plugindir="${plugindir#$ws_prefix}" + 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 + plugindir='$(prefix)'"${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 diff --git a/tools/Makefile.am b/tools/Makefile.am index 08e1680cf5..981be31b34 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -398,7 +398,7 @@ EXTRA_DIST += \ if WITH_WIRESHARK_DISSECTOR -ws_plugindir = $(prefix)$(plugindir) +ws_plugindir = @plugindir@ ws_plugin_LTLIBRARIES = wireshark/src/libvirt.la wireshark_src_libvirt_la_CPPFLAGS = \ -I wireshark/src $(WIRESHARK_DISSECTOR_CFLAGS)