On Tue, Sep 18, 2012 at 10:12:39AM +0100, Daniel P. Berrange wrote:
On Fri, Sep 14, 2012 at 11:09:28AM +0100, Richard W.M. Jones wrote:
> +# Do we have libtool? If we have it then we can use it to make
> +# running valgrind simpler. However don't depend on it.
> +if libtool --help >/dev/null 2>&1; then
I'm not sure I see the point of this conditional. Even if running from a
tar.gz build, with no locally installed libtool, there is the script at
$top_srcdir/libtool isn't there ?
> + libtool="libtool --mode=execute"
> +fi
> +
> +# Run the program.
> +exec $libtool "$@"
This is directly copied from libguestfs.
The reason to use 'libtool --mode=execute' at all is so that you can
use gdb. Thus './run gdb ./program' is expanded to:
libtool --mode=execute gdb ./program
(Same reasoning applies to './run valgrind ./program').
The reason not to use ./libtool is because in libguestfs we replace
the top-level ./libtool script with something else for a variety of
complicated reasons.
The reason to check if libtool exists (running 'libtool --help') is so
that the whole thing works if the user didn't install (global) libtool.
So I agree that for libvirt it's better to run the toplevel ./libtool
program instead. Please see the attached updated patch which changes
this, and also doesn't set $PATH (wasn't required), but is otherwise
the same.
BTW this script is super-useful. For example to run the libguestfs
test suite using a local copy of libvirt you just have to do:
../libvirt/run make check
Rich.
--
Richard Jones, Virtualization Group, Red Hat
http://people.redhat.com/~rjones
Read my programming blog:
http://rwmj.wordpress.com
Fedora now supports 80 OCaml packages (the OPEN alternative to F#)
http://cocan.org/getting_started_with_ocaml_on_red_hat_and_fedora