Change in vdsm[master]: configure: replace AC_PATH_PROG to AC_CHECK_PROG

dougsland at redhat.com dougsland at redhat.com
Tue Jan 17 18:05:08 UTC 2012


Douglas Schilling Landgraf has uploaded a new change for review.

Change subject: configure: replace AC_PATH_PROG to AC_CHECK_PROG
......................................................................

configure: replace AC_PATH_PROG to AC_CHECK_PROG

This patch replace the macro AC_PATH_PROG to AC_CHECK_PROG.
Currently, the AC_PATH_PROG doesn't check if the program really exists, for example:

$ nice
bash: nice: command not found...

If you run:
$ ./autogen.sh --system

<snip>
checking for nice... /bin/nice
</snip>

This is because the AC_PATH_PROG parameters are:
AC_PATH_PROG(variable, prog-to-check-for, [value-if-not-found], [path = ‘$PATH’])
                                                 ^^ here
Our macro is;
AC_PATH_PROG([NICE_PATH], [nice], [/bin/nice])

The second point, if you are compiling your own packages and your
programs are located in a different directory AC_PATH_PROG will find it and
return the full path and break the rpm, example:

$ mkdir -p /usr/local/qemu/bin
$ mv /usr/bin/qemu-img /usr/local/qemu/bin/
$ export PATH=$PATH:/usr/local/qemu/bin
(including the new directory into the path)

$ ./autogen.sh --system
<snip>
checking for qemu-img...
/usr/local/qemu/bin/qemu-img
<snip>
Then, vdsm/constants.py will assume:
EXT_QEMUIMG = '/usr/local/qemu/bin/qemu-img' instead of /usr/bin/qemu-img

AC_CHECK_PROG can resolv that because if it find the program into the path,
we can provide the correct path.

AC_CHECK_PROG (variable, prog-to-check-for, value-if-found, [value-if-not-found], [path = ‘$PATH’], [reject])

Change-Id: I13b870c3e656dba2d840a341a5d6789a11036e40
---
M configure.ac
1 file changed, 266 insertions(+), 56 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/14/1114/1
--
To view, visit http://gerrit.ovirt.org/1114
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I13b870c3e656dba2d840a341a5d6789a11036e40
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Douglas Schilling Landgraf <dougsland at redhat.com>


More information about the vdsm-patches mailing list