Thu Sep 20 19:37:00 BST 2007 Richard W.M. Jones <rjones@redhat.com>

* src/bridge.c, src/qemu_driver.c, configure.in: Try to detect
        the paths of dnsmasq and brctl at compile time.  If found
        then compile them in, otherwise search $PATH at runtime.

        * libvirt.spec.in: BR dnsmasq and bridge-utils so we have their
        paths at compile time.
This commit is contained in:
Richard W.M. Jones 2007-09-20 18:40:36 +00:00
parent 9a79baba76
commit 0caf0d767c
5 changed files with 28 additions and 4 deletions

View File

@ -1,3 +1,12 @@
Thu Sep 20 19:37:00 BST 2007 Richard W.M. Jones <rjones@redhat.com>
* src/bridge.c, src/qemu_driver.c, configure.in: Try to detect
the paths of dnsmasq and brctl at compile time. If found
then compile them in, otherwise search $PATH at runtime.
* libvirt.spec.in: BR dnsmasq and bridge-utils so we have their
paths at compile time.
Thu Sep 20 18:10:00 BST 2007 Richard W.M. Jones <rjones@redhat.com>
* src/qemu_driver.c, docs/libvir.html: Support virConnectGetHostname

View File

@ -36,6 +36,20 @@ AC_PATH_PROG(TAR, tar, /bin/tar)
AC_PATH_PROG(XMLLINT, xmllint, /usr/bin/xmllint)
AC_PATH_PROG(XSLTPROC, xsltproc, /usr/bin/xsltproc)
dnl External programs that we can use if they are available.
dnl We will hard-code paths to these programs unless we cannot
dnl detect them, in which case we'll search for the program
dnl along the $PATH at runtime and fail if it's not there.
AC_PATH_PROG(DNSMASQ, dnsmasq, dnsmasq,
[/sbin:/usr/sbin:/usr/local/sbin:$PATH])
AC_PATH_PROG(BRCTL, brctl, brctl,
[/sbin:/usr/sbin:/usr/local/sbin:$PATH])
AC_DEFINE_UNQUOTED([DNSMASQ],["$DNSMASQ"],
[Location or name of the dnsmasq program])
AC_DEFINE_UNQUOTED([BRCTL],["$BRCTL"],
[Location or name of the brctl program (see bridge-utils)])
dnl Make sure we have an ANSI compiler
AM_C_PROTOTYPES
test "x$U" != "x" && AC_MSG_ERROR(Compiler not ANSI compliant)

View File

@ -23,6 +23,8 @@ BuildRequires: ncurses-devel
BuildRequires: gettext
BuildRequires: gnutls-devel
BuildRequires: avahi-devel
BuildRequires: dnsmasq
BuildRequires: bridge-utils
Obsoletes: libvir
ExclusiveArch: i386 x86_64 ia64

View File

@ -45,7 +45,6 @@
#define MAX_BRIDGE_ID 256
#define BRCTL_PATH "/usr/sbin/brctl"
#define JIFFIES_TO_MS(j) (((j)*1000)/HZ)
#define MS_TO_JIFFIES(ms) (((ms)*HZ)/1000)
@ -684,7 +683,7 @@ brSetForwardDelay(brControl *ctl ATTRIBUTE_UNUSED,
n = 0;
if (!(argv[n++] = strdup(BRCTL_PATH)))
if (!(argv[n++] = strdup(BRCTL)))
goto error;
if (!(argv[n++] = strdup("setfd")))
@ -741,7 +740,7 @@ brSetEnableSTP(brControl *ctl ATTRIBUTE_UNUSED,
n = 0;
if (!(argv[n++] = strdup(BRCTL_PATH)))
if (!(argv[n++] = strdup(BRCTL)))
goto error;
if (!(argv[n++] = strdup("stp")))

View File

@ -830,7 +830,7 @@ qemudBuildDnsmasqArgv(virConnectPtr conn,
i = 0;
APPEND_ARG(*argv, i++, "dnsmasq");
APPEND_ARG(*argv, i++, DNSMASQ);
APPEND_ARG(*argv, i++, "--keep-in-foreground");
/*