[libvirt] [PATCH] Use AC_LINK_IFELSE

instead of the deprecated AC_TRY_LINK --- configure.ac | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index 5d5c8de..0f0b265 100644 --- a/configure.ac +++ b/configure.ac @@ -893,13 +893,14 @@ if test "$with_libvirtd" = "no" ; then with_lxc=no fi if test "$with_lxc" = "yes" || test "$with_lxc" = "check"; then - AC_TRY_LINK([ + AC_LINK_IFELSE([AC_LANG_PROGRAM( + [[ #include <sched.h> #include <linux/loop.h> #include <sys/epoll.h> - ], [ + ]], [[ unshare (!(LO_FLAGS_AUTOCLEAR + EPOLL_CLOEXEC)); - ], [ + ]])], [ with_lxc=yes AC_DEFINE([HAVE_DECL_LO_FLAGS_AUTOCLEAR], [1], [Define to 1 if you have the declaration of `LO_FLAGS_AUTOCLEAR', -- 1.8.3.2

On Thu, Jul 18, 2013 at 06:44:03PM +0200, Guido Günther wrote:
instead of the deprecated AC_TRY_LINK --- configure.ac | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/configure.ac b/configure.ac index 5d5c8de..0f0b265 100644 --- a/configure.ac +++ b/configure.ac @@ -893,13 +893,14 @@ if test "$with_libvirtd" = "no" ; then with_lxc=no fi if test "$with_lxc" = "yes" || test "$with_lxc" = "check"; then - AC_TRY_LINK([ + AC_LINK_IFELSE([AC_LANG_PROGRAM( + [[ #include <sched.h> #include <linux/loop.h> #include <sys/epoll.h> - ], [ + ]], [[ unshare (!(LO_FLAGS_AUTOCLEAR + EPOLL_CLOEXEC)); - ], [ + ]])], [ with_lxc=yes AC_DEFINE([HAVE_DECL_LO_FLAGS_AUTOCLEAR], [1], [Define to 1 if you have the declaration of `LO_FLAGS_AUTOCLEAR',
When was AC_LINK_IFELSE first introduced to autoconf ? Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|

On Thu, Jul 18, 2013 at 05:50:58PM +0100, Daniel P. Berrange wrote:
On Thu, Jul 18, 2013 at 06:44:03PM +0200, Guido Günther wrote:
instead of the deprecated AC_TRY_LINK --- configure.ac | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/configure.ac b/configure.ac index 5d5c8de..0f0b265 100644 --- a/configure.ac +++ b/configure.ac @@ -893,13 +893,14 @@ if test "$with_libvirtd" = "no" ; then with_lxc=no fi if test "$with_lxc" = "yes" || test "$with_lxc" = "check"; then - AC_TRY_LINK([ + AC_LINK_IFELSE([AC_LANG_PROGRAM( + [[ #include <sched.h> #include <linux/loop.h> #include <sys/epoll.h> - ], [ + ]], [[ unshare (!(LO_FLAGS_AUTOCLEAR + EPOLL_CLOEXEC)); - ], [ + ]])], [ with_lxc=yes AC_DEFINE([HAVE_DECL_LO_FLAGS_AUTOCLEAR], [1], [Define to 1 if you have the declaration of `LO_FLAGS_AUTOCLEAR',
When was AC_LINK_IFELSE first introduced to autoconf ?
Actually doesn't matter. We're already relying on it existing via gnulib. ACK Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|

On Thu, Jul 18, 2013 at 05:50:58PM +0100, Daniel P. Berrange wrote:
On Thu, Jul 18, 2013 at 06:44:03PM +0200, Guido Günther wrote:
instead of the deprecated AC_TRY_LINK --- configure.ac | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/configure.ac b/configure.ac index 5d5c8de..0f0b265 100644 --- a/configure.ac +++ b/configure.ac @@ -893,13 +893,14 @@ if test "$with_libvirtd" = "no" ; then with_lxc=no fi if test "$with_lxc" = "yes" || test "$with_lxc" = "check"; then - AC_TRY_LINK([ + AC_LINK_IFELSE([AC_LANG_PROGRAM( + [[ #include <sched.h> #include <linux/loop.h> #include <sys/epoll.h> - ], [ + ]], [[ unshare (!(LO_FLAGS_AUTOCLEAR + EPOLL_CLOEXEC)); - ], [ + ]])], [ with_lxc=yes AC_DEFINE([HAVE_DECL_LO_FLAGS_AUTOCLEAR], [1], [Define to 1 if you have the declaration of `LO_FLAGS_AUTOCLEAR',
When was AC_LINK_IFELSE first introduced to autoconf ? At least 2.64 has it:
http://www.flameeyes.eu/autotools-mythbuster/forwardporting/autoconf.html Cheers, -- Guido

On 07/18/2013 11:05 AM, Guido Günther wrote:
When was AC_LINK_IFELSE first introduced to autoconf ?
At least 2.64 has it:
http://www.flameeyes.eu/autotools-mythbuster/forwardporting/autoconf.html
We require support back to 2.59 + gnulib, for use on RHEL 5. Thankfully: $ cd autoconf.git $ git grep AC_LINK_IFELSE AUTOCONF-2.59 | wc 75 289 6300 this is one of those macros that works without needing any gnulib help. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

On 07/18/2013 10:44 AM, Guido Günther wrote:
instead of the deprecated AC_TRY_LINK --- configure.ac | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
ACK.
diff --git a/configure.ac b/configure.ac index 5d5c8de..0f0b265 100644 --- a/configure.ac +++ b/configure.ac @@ -893,13 +893,14 @@ if test "$with_libvirtd" = "no" ; then with_lxc=no fi if test "$with_lxc" = "yes" || test "$with_lxc" = "check"; then - AC_TRY_LINK([ + AC_LINK_IFELSE([AC_LANG_PROGRAM( + [[ #include <sched.h> #include <linux/loop.h> #include <sys/epoll.h> - ], [ + ]], [[ unshare (!(LO_FLAGS_AUTOCLEAR + EPOLL_CLOEXEC));
As long as you're touching this, remove the space before '('.
- ], [ + ]])], [ with_lxc=yes AC_DEFINE([HAVE_DECL_LO_FLAGS_AUTOCLEAR], [1], [Define to 1 if you have the declaration of `LO_FLAGS_AUTOCLEAR',
-- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

On Thu, Jul 18, 2013 at 10:59:06AM -0600, Eric Blake wrote:
On 07/18/2013 10:44 AM, Guido Günther wrote:
instead of the deprecated AC_TRY_LINK --- configure.ac | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
ACK.
diff --git a/configure.ac b/configure.ac index 5d5c8de..0f0b265 100644 --- a/configure.ac +++ b/configure.ac @@ -893,13 +893,14 @@ if test "$with_libvirtd" = "no" ; then with_lxc=no fi if test "$with_lxc" = "yes" || test "$with_lxc" = "check"; then - AC_TRY_LINK([ + AC_LINK_IFELSE([AC_LANG_PROGRAM( + [[ #include <sched.h> #include <linux/loop.h> #include <sys/epoll.h> - ], [ + ]], [[ unshare (!(LO_FLAGS_AUTOCLEAR + EPOLL_CLOEXEC));
As long as you're touching this, remove the space before '('.
Pushed with that change. Thanks, -- Guido
- ], [ + ]])], [ with_lxc=yes AC_DEFINE([HAVE_DECL_LO_FLAGS_AUTOCLEAR], [1], [Define to 1 if you have the declaration of `LO_FLAGS_AUTOCLEAR',
-- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
participants (3)
-
Daniel P. Berrange
-
Eric Blake
-
Guido Günther