Re: [PATCH] virt-wireshark.m4: Defer $(prefix) substitution

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Oct 20, 2016 at 03:54:13PM +0800, Michal Privoznik wrote:
> The problem with evaluating $(prefix) in configure phase is that
> autoconf does a lot of magic with this variable. Firstly, if the
> --prefix argument is not set for the configure script, the
> variable will have value "NONE". Wait, wat? Secondly, even
> autoconf scripts then have special cases for when variable is
> "NONE". It's even worse - whenever they need to construct new
> path based on prefix, they save its current value, substitute it
> with proper value (like /usr/local/), do what they need and then
> restore the original value. Le sigh.
> This mad behaviour is, however, suppressed if there's --prefix on
> the configure command line.
> Now, the problem is that we tried to construct path for wireshark
> plugin in the m4 file. Based on the knowledge described above, we
> shouldn't do it and just construct the full path in Makefile
> later where prefix has proper value.
> 
> Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx>
> ---
>  m4/virt-wireshark.m4 | 2 +-
>  tools/Makefile.am    | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/m4/virt-wireshark.m4 b/m4/virt-wireshark.m4
> index f383e2b..e1e4a59 100644
> --- a/m4/virt-wireshark.m4
> +++ b/m4/virt-wireshark.m4
> @@ -38,7 +38,7 @@ AC_DEFUN([LIBVIRT_CHECK_WIRESHARK],[
>          if test "x$ws_prefix" = "x" ; then
>            ws_prefix="/usr";
>          fi
> -        plugindir="${prefix}${plugindir#$ws_prefix}"
> +        plugindir="${plugindir#$ws_prefix}"
>        fi
>      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])
> diff --git a/tools/Makefile.am b/tools/Makefile.am
> index e7e42c3..08e1680 100644
> --- a/tools/Makefile.am
> +++ b/tools/Makefile.am
> @@ -398,7 +398,7 @@ EXTRA_DIST += \
>  
>  if WITH_WIRESHARK_DISSECTOR
>  
> -ws_plugindir = $(plugindir)
> +ws_plugindir = $(prefix)$(plugindir)
>  ws_plugin_LTLIBRARIES = wireshark/src/libvirt.la
>  wireshark_src_libvirt_la_CPPFLAGS = \
>  	-I wireshark/src $(WIRESHARK_DISSECTOR_CFLAGS)

It looks like this patch has broken the RPM build

https://ci.centos.org/view/libvirt-project/job/libvirt-master-rpm/82/systems=libvirt-fedora-23/console

Notice at the make install phase:

 /usr/bin/mkdir -p '/home/jenkins/rpmbuild/BUILDROOT/libvirt-2.4.0-1.fc23.x86_64/usr/usr/lib64/wireshark/plugins/1.12.12'
 /bin/sh ../libtool   --mode=install /usr/bin/install -c   wireshark/src/libvirt.la '/home/jenkins/rpmbuild/BUILDROOT/libvirt-2.4.0-1.fc23.x86_64/usr/usr/lib64/wireshark/plugins/1.12.12'
libtool: install: /usr/bin/install -c wireshark/src/.libs/libvirt.so /home/jenkins/rpmbuild/BUILDROOT/libvirt-2.4.0-1.fc23.x86_64/usr/usr/lib64/wireshark/plugins/1.12.12/libvirt.so
libtool: install: /usr/bin/install -c wireshark/src/.libs/libvirt.lai /home/jenkins/rpmbuild/BUILDROOT/libvirt-2.4.0-1.fc23.x86_64/usr/usr/lib64/wireshark/plugins/1.12.12/libvirt.la
libtool: warning: remember to run 'libtool --finish /usr/usr/lib64/wireshark/plugins/1.12.12'


It is getting "/usr/usr" in the path which is very wrong.

Regards,
Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://entangle-photo.org       -o-    http://search.cpan.org/~danberr/ :|

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]