* [Qemu-devel] [RFC] allow special paths for libusbx
@ 2013-11-27 10:09 Erik Rull
2013-11-27 10:14 ` Paolo Bonzini
2013-11-27 10:25 ` Daniel P. Berrange
0 siblings, 2 replies; 7+ messages in thread
From: Erik Rull @ 2013-11-27 10:09 UTC (permalink / raw)
To: qemu-devel@nongnu.org; +Cc: Paolo Bonzini, Gerd Hoffmann
Hi all,
I don't have libusbx installed on my system but the source package is available
and compiled for development.
This may also help other users to enable the libusbx support without having it
actually installed on the compile machine.
It's a first attempt, feel free to optimize it. I would be happy if someone
could commit a patch like that for the next release - this would make it
possible to use the next qemu release instead of the git version with own
patches.
The call parameters would be filled like:
--enable-libusb-special-headers=-I/home/erik/libusbx/libusb
--enable-libusb-special-libs="-L/home/erik/libusbx/libusb/.libs -lusb-1.0"
Thanks.
Erik
---
diff --git a/configure b/configure
index 0666228..98cc72b 100755
--- a/configure
+++ b/configure
@@ -935,6 +935,10 @@ for opt do
;;
--enable-libusb) libusb="yes"
;;
+ --enable-libusb-special-headers=*) libusb="yes"; libusb_cflags="$optarg"
+ ;;
+ --enable-libusb-special-libs=*) libusb="yes"; libusb_libs="$optarg"
+ ;;
--disable-usb-redir) usb_redir="no"
;;
--enable-usb-redir) usb_redir="yes"
@@ -3155,6 +3159,11 @@ fi
# check for libusb
if test "$libusb" != "no" ; then
+ if test -n "$libusb_cflags" && test -n "$libusb_libs"; then
+ libusb="yes"
+ QEMU_CFLAGS="$QEMU_CFLAGS $libusb_cflags"
+ libs_softmmu="$libs_softmmu $libusb_libs"
+ else
if $pkg_config --atleast-version=1.0.13 libusb-1.0; then
libusb="yes"
libusb_cflags=$($pkg_config --cflags libusb-1.0)
@@ -3167,6 +3176,7 @@ if test "$libusb" != "no" ; then
fi
libusb="no"
fi
+ fi
fi
# check for usbredirparser for usb network redirection support
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [Qemu-devel] [RFC] allow special paths for libusbx
2013-11-27 10:09 [Qemu-devel] [RFC] allow special paths for libusbx Erik Rull
@ 2013-11-27 10:14 ` Paolo Bonzini
2013-11-27 10:24 ` Erik Rull
2013-11-27 10:25 ` Daniel P. Berrange
1 sibling, 1 reply; 7+ messages in thread
From: Paolo Bonzini @ 2013-11-27 10:14 UTC (permalink / raw)
To: Erik Rull; +Cc: qemu-devel@nongnu.org, Gerd Hoffmann
Il 27/11/2013 11:09, Erik Rull ha scritto:
> I don't have libusbx installed on my system but the source package is available
> and compiled for development.
> This may also help other users to enable the libusbx support without having it
> actually installed on the compile machine.
>
> It's a first attempt, feel free to optimize it. I would be happy if someone
> could commit a patch like that for the next release - this would make it
> possible to use the next qemu release instead of the git version with own
> patches.
>
> The call parameters would be filled like:
>
> --enable-libusb-special-headers=-I/home/erik/libusbx/libusb
> --enable-libusb-special-libs="-L/home/erik/libusbx/libusb/.libs -lusb-1.0"
I believe you just have a misconfigured pkg-config.
Paolo
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Qemu-devel] [RFC] allow special paths for libusbx
2013-11-27 10:14 ` Paolo Bonzini
@ 2013-11-27 10:24 ` Erik Rull
2013-11-27 10:38 ` Paolo Bonzini
0 siblings, 1 reply; 7+ messages in thread
From: Erik Rull @ 2013-11-27 10:24 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: qemu-devel@nongnu.org, Gerd Hoffmann
> On November 27, 2013 at 11:14 AM Paolo Bonzini <pbonzini@redhat.com> wrote:
>
>
> Il 27/11/2013 11:09, Erik Rull ha scritto:
> > I don't have libusbx installed on my system but the source package is
> > available
> > and compiled for development.
> > This may also help other users to enable the libusbx support without having
> > it
> > actually installed on the compile machine.
> >
> > It's a first attempt, feel free to optimize it. I would be happy if someone
> > could commit a patch like that for the next release - this would make it
> > possible to use the next qemu release instead of the git version with own
> > patches.
> >
> > The call parameters would be filled like:
> >
> > --enable-libusb-special-headers=-I/home/erik/libusbx/libusb
> > --enable-libusb-special-libs="-L/home/erik/libusbx/libusb/.libs -lusb-1.0"
>
> I believe you just have a misconfigured pkg-config.
>
> Paolo
>
Hi Paolo,
no I have no libusbx installed. I just downloaded the tar.bz2, unpacked it,
configure'd it and called make.
Best regards,
Erik
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Qemu-devel] [RFC] allow special paths for libusbx
2013-11-27 10:09 [Qemu-devel] [RFC] allow special paths for libusbx Erik Rull
2013-11-27 10:14 ` Paolo Bonzini
@ 2013-11-27 10:25 ` Daniel P. Berrange
1 sibling, 0 replies; 7+ messages in thread
From: Daniel P. Berrange @ 2013-11-27 10:25 UTC (permalink / raw)
To: Erik Rull; +Cc: Paolo Bonzini, qemu-devel@nongnu.org, Gerd Hoffmann
On Wed, Nov 27, 2013 at 11:09:19AM +0100, Erik Rull wrote:
> Hi all,
>
> I don't have libusbx installed on my system but the source package is available
> and compiled for development.
> This may also help other users to enable the libusbx support without having it
> actually installed on the compile machine.
>
> It's a first attempt, feel free to optimize it. I would be happy if someone
> could commit a patch like that for the next release - this would make it
> possible to use the next qemu release instead of the git version with own
> patches.
>
> The call parameters would be filled like:
>
> --enable-libusb-special-headers=-I/home/erik/libusbx/libusb
> --enable-libusb-special-libs="-L/home/erik/libusbx/libusb/.libs -lusb-1.0"
libusbx provides a pkg-config file so you should merely need todo
export PKG_CONFIG_PATH=${path-to-libusbx-install-root-prefix}/lib/pkgconfig
Daniel
--
|: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org -o- http://virt-manager.org :|
|: http://autobuild.org -o- http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Qemu-devel] [RFC] allow special paths for libusbx
2013-11-27 10:24 ` Erik Rull
@ 2013-11-27 10:38 ` Paolo Bonzini
2013-11-27 11:33 ` Erik Rull
2013-11-27 13:19 ` Erik Rull
0 siblings, 2 replies; 7+ messages in thread
From: Paolo Bonzini @ 2013-11-27 10:38 UTC (permalink / raw)
To: Erik Rull; +Cc: qemu-devel@nongnu.org, Gerd Hoffmann
Il 27/11/2013 11:24, Erik Rull ha scritto:
> no I have no libusbx installed. I just downloaded the tar.bz2, unpacked it,
> configure'd it and called make.
I think your patch wouldn't be enough to actually run QEMU, because the
path to libusbx.so is not in LD_LIBRARY_PATH (and if you can change
LD_LIBRARY_PATH, you can also change PKG_CONFIG_PATH).
The right way to do it is:
* add --prefix=$HOME to your configure command line.
* call "make install" after "make"
* add $HOME/lib to your LD_LIBRARY_PATH
* add the right subdirectory of $HOME/lib to your PKG_CONFIG_PATH
* test that it works with "pkg-config --cflags libusb-1.0"
* configure QEMU with no extra options
Paolo
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Qemu-devel] [RFC] allow special paths for libusbx
2013-11-27 10:38 ` Paolo Bonzini
@ 2013-11-27 11:33 ` Erik Rull
2013-11-27 13:19 ` Erik Rull
1 sibling, 0 replies; 7+ messages in thread
From: Erik Rull @ 2013-11-27 11:33 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: qemu-devel@nongnu.org, Gerd Hoffmann
> On November 27, 2013 at 11:38 AM Paolo Bonzini <pbonzini@redhat.com> wrote:
>
>
> Il 27/11/2013 11:24, Erik Rull ha scritto:
> > no I have no libusbx installed. I just downloaded the tar.bz2, unpacked it,
> > configure'd it and called make.
>
> I think your patch wouldn't be enough to actually run QEMU, because the
> path to libusbx.so is not in LD_LIBRARY_PATH (and if you can change
> LD_LIBRARY_PATH, you can also change PKG_CONFIG_PATH).
>
> The right way to do it is:
>
> * add --prefix=$HOME to your configure command line.
>
> * call "make install" after "make"
>
> * add $HOME/lib to your LD_LIBRARY_PATH
>
> * add the right subdirectory of $HOME/lib to your PKG_CONFIG_PATH
>
> * test that it works with "pkg-config --cflags libusb-1.0"
>
> * configure QEMU with no extra options
>
> Paolo
Hi Paolo,
hm, sounds reasonable. I will try that and let you know if it worked.
Best regards,
Erik
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Qemu-devel] [RFC] allow special paths for libusbx
2013-11-27 10:38 ` Paolo Bonzini
2013-11-27 11:33 ` Erik Rull
@ 2013-11-27 13:19 ` Erik Rull
1 sibling, 0 replies; 7+ messages in thread
From: Erik Rull @ 2013-11-27 13:19 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: qemu-devel@nongnu.org, Gerd Hoffmann
> On November 27, 2013 at 11:38 AM Paolo Bonzini <pbonzini@redhat.com> wrote:
>
>
> Il 27/11/2013 11:24, Erik Rull ha scritto:
> > no I have no libusbx installed. I just downloaded the tar.bz2, unpacked it,
> > configure'd it and called make.
>
> I think your patch wouldn't be enough to actually run QEMU, because the
> path to libusbx.so is not in LD_LIBRARY_PATH (and if you can change
> LD_LIBRARY_PATH, you can also change PKG_CONFIG_PATH).
>
> The right way to do it is:
>
> * add --prefix=$HOME to your configure command line.
>
> * call "make install" after "make"
>
> * add $HOME/lib to your LD_LIBRARY_PATH
>
> * add the right subdirectory of $HOME/lib to your PKG_CONFIG_PATH
>
> * test that it works with "pkg-config --cflags libusb-1.0"
>
> * configure QEMU with no extra options
>
> Paolo
Even easier - a temporary change of the PKG_CONFIG_PATH is sufficient, configure
does everything that is needed later on:
erik@debian:~/qemu-test/qemu$ env
PKG_CONFIG_PATH=/home/erik/libusbx/.install/lib/pkgconfig:$PKG_CONFIG_PATH
./configure [...]
where the .install directory was created by a manual call of make install from
libusbx.
Works fine for me.
Best regards,
Erik
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2013-11-27 13:19 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-27 10:09 [Qemu-devel] [RFC] allow special paths for libusbx Erik Rull
2013-11-27 10:14 ` Paolo Bonzini
2013-11-27 10:24 ` Erik Rull
2013-11-27 10:38 ` Paolo Bonzini
2013-11-27 11:33 ` Erik Rull
2013-11-27 13:19 ` Erik Rull
2013-11-27 10:25 ` Daniel P. Berrange
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).