]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Thu Sep 20 19:37:00 BST 2007 Richard W.M. Jones <rjones@redhat.com>
authorRichard W.M. Jones <rjones@redhat.com>
Thu, 20 Sep 2007 18:40:36 +0000 (18:40 +0000)
committerRichard W.M. Jones <rjones@redhat.com>
Thu, 20 Sep 2007 18:40:36 +0000 (18:40 +0000)
        * 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.

ChangeLog
configure.in
libvirt.spec.in
src/bridge.c
src/qemu_driver.c

index 12024549a179b1bf524afefe5c6684d36835b167..a25c0ef7d4e6553408585b66605462e652e944e5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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
index 4b5590c06f0194b2afdbcdd8ac41a862712e627e..4bb2eee3aafb1911ad592e771644c75488351649 100644 (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)
index 4ecf0b646c92020119021910c0ab104c10dace4d..bc18a7392459852cc32e3eb818bbe96401cdc270 100644 (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
 
index d728c2684c07234fd8fd6868bf03c2781145ac67..457b5d72adb3a0c82b34c88566a330ce3e26b573 100644 (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")))
index 0dac4b388f2a4ef8bad295094af604b75f387e85..6482e0a10679456ce6dcfd6148d4d038a000738c 100644 (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");
     /*