[libvirt] [PATCH 1/2] set HAVE_LIBNL in config.h

Set HAVE_LIBNL to be able to conditionally compile libnl code. Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com> --- configure.ac | 3 +++ 1 file changed, 3 insertions(+) Index: libvirt-acl/configure.ac =================================================================== --- libvirt-acl.orig/configure.ac +++ libvirt-acl/configure.ac @@ -2377,7 +2377,10 @@ if test "$with_macvtap" = "yes"; then ], [ AC_MSG_ERROR([libnl-devel >= $LIBNL_REQUIRED is required for macvtap support]) ]) + have_libnl=yes + AC_DEFINE_UNQUOTED([HAVE_LIBNL], 1, [whether the netlink library is available]) fi +AM_CONDITIONAL([HAVE_LIBNL], [test "$have_libnl" = "yes"]) AC_SUBST([LIBNL_CFLAGS]) AC_SUBST([LIBNL_LIBS])

2011/6/23 Stefan Berger <stefanb@linux.vnet.ibm.com>:
Set HAVE_LIBNL to be able to conditionally compile libnl code.
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
--- configure.ac | 3 +++ 1 file changed, 3 insertions(+)
Index: libvirt-acl/configure.ac =================================================================== --- libvirt-acl.orig/configure.ac +++ libvirt-acl/configure.ac @@ -2377,7 +2377,10 @@ if test "$with_macvtap" = "yes"; then ], [ AC_MSG_ERROR([libnl-devel >= $LIBNL_REQUIRED is required for macvtap support]) ]) + have_libnl=yes + AC_DEFINE_UNQUOTED([HAVE_LIBNL], 1, [whether the netlink library is available]) fi +AM_CONDITIONAL([HAVE_LIBNL], [test "$have_libnl" = "yes"])
AC_SUBST([LIBNL_CFLAGS]) AC_SUBST([LIBNL_LIBS])
HAVE_LIBNL is just an alias for WITH_MACVTAP by this construct. So you could just use WITH_MACVTAP in the code instead of HAVE_LIBNL. Or do you plan to use libnl also for non-macvtap related code. -- Matthias Bolte http://photron.blogspot.com

On 06/23/2011 08:41 AM, Matthias Bolte wrote:
2011/6/23 Stefan Berger<stefanb@linux.vnet.ibm.com>:
Set HAVE_LIBNL to be able to conditionally compile libnl code.
Signed-off-by: Stefan Berger<stefanb@linux.vnet.ibm.com>
--- configure.ac | 3 +++ 1 file changed, 3 insertions(+)
Index: libvirt-acl/configure.ac =================================================================== --- libvirt-acl.orig/configure.ac +++ libvirt-acl/configure.ac @@ -2377,7 +2377,10 @@ if test "$with_macvtap" = "yes"; then ], [ AC_MSG_ERROR([libnl-devel>= $LIBNL_REQUIRED is required for macvtap support]) ]) + have_libnl=yes + AC_DEFINE_UNQUOTED([HAVE_LIBNL], 1, [whether the netlink library is available]) fi +AM_CONDITIONAL([HAVE_LIBNL], [test "$have_libnl" = "yes"])
AC_SUBST([LIBNL_CFLAGS]) AC_SUBST([LIBNL_LIBS])
HAVE_LIBNL is just an alias for WITH_MACVTAP by this construct. So you could just use WITH_MACVTAP in the code instead of HAVE_LIBNL. Or do you plan to use libnl also for non-macvtap related code.
Initially I was using WITH_MACVTAP for the conditional compilation in the 2nd patch, but this seems wrong since code dependent on -lnl should have a corresponding HAVE_LIBNL. I did obviously not go as far as making the above check for libnl independent of macvtap. I'd probably get it wrong. So really what should be done is check for libnl on a linux system and set HAVE_LIBNL if found if 'with_macvtap' is yes, check whether previously libnl was found. I guess one could check the 'have_libnl' for that. Stefan

2011/6/23 Stefan Berger <stefanb@linux.vnet.ibm.com>:
On 06/23/2011 08:41 AM, Matthias Bolte wrote:
2011/6/23 Stefan Berger<stefanb@linux.vnet.ibm.com>:
Set HAVE_LIBNL to be able to conditionally compile libnl code.
Signed-off-by: Stefan Berger<stefanb@linux.vnet.ibm.com>
--- configure.ac | 3 +++ 1 file changed, 3 insertions(+)
Index: libvirt-acl/configure.ac =================================================================== --- libvirt-acl.orig/configure.ac +++ libvirt-acl/configure.ac @@ -2377,7 +2377,10 @@ if test "$with_macvtap" = "yes"; then ], [ AC_MSG_ERROR([libnl-devel>= $LIBNL_REQUIRED is required for macvtap support]) ]) + have_libnl=yes + AC_DEFINE_UNQUOTED([HAVE_LIBNL], 1, [whether the netlink library is available]) fi +AM_CONDITIONAL([HAVE_LIBNL], [test "$have_libnl" = "yes"])
AC_SUBST([LIBNL_CFLAGS]) AC_SUBST([LIBNL_LIBS])
HAVE_LIBNL is just an alias for WITH_MACVTAP by this construct. So you could just use WITH_MACVTAP in the code instead of HAVE_LIBNL. Or do you plan to use libnl also for non-macvtap related code.
Initially I was using WITH_MACVTAP for the conditional compilation in the 2nd patch, but this seems wrong since code dependent on -lnl should have a corresponding HAVE_LIBNL. I did obviously not go as far as making the above check for libnl independent of macvtap. I'd probably get it wrong. So really what should be done is
check for libnl on a linux system and set HAVE_LIBNL if found if 'with_macvtap' is yes, check whether previously libnl was found. I guess one could check the 'have_libnl' for that.
Stefan
Okay, I just did that, here's a patch for that. -- Matthias Bolte http://photron.blogspot.com

On 06/23/2011 08:50 AM, Matthias Bolte wrote:
Okay, I just did that, here's a patch for that.
[PATCH] configure: Make libnl optional unless macvtap is required
If macvtap is required then libnl has to be available, otherwise libnl is optional. --- configure.ac | 12 +++++++++--- 1 files changed, 9 insertions(+), 3 deletions(-)
ACK. -- Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org

On 06/23/2011 08:41 AM, Matthias Bolte wrote:
2011/6/23 Stefan Berger<stefanb@linux.vnet.ibm.com>:
Set HAVE_LIBNL to be able to conditionally compile libnl code.
Signed-off-by: Stefan Berger<stefanb@linux.vnet.ibm.com>
--- configure.ac | 3 +++ 1 file changed, 3 insertions(+)
Index: libvirt-acl/configure.ac =================================================================== --- libvirt-acl.orig/configure.ac +++ libvirt-acl/configure.ac @@ -2377,7 +2377,10 @@ if test "$with_macvtap" = "yes"; then ], [ AC_MSG_ERROR([libnl-devel>= $LIBNL_REQUIRED is required for macvtap support]) ]) + have_libnl=yes + AC_DEFINE_UNQUOTED([HAVE_LIBNL], 1, [whether the netlink library is available]) fi +AM_CONDITIONAL([HAVE_LIBNL], [test "$have_libnl" = "yes"])
AC_SUBST([LIBNL_CFLAGS]) AC_SUBST([LIBNL_LIBS])
HAVE_LIBNL is just an alias for WITH_MACVTAP by this construct. So you could just use WITH_MACVTAP in the code instead of HAVE_LIBNL. Or do you plan to use libnl also for non-macvtap related code.
Correct. I fixed this and pushed yours as 1/2 and my 2/2. Thanks for the patience. ;-) Stefan
participants (3)
-
Eric Blake
-
Matthias Bolte
-
Stefan Berger