[libvirt] [PATCH] Report an error if no XDR library can be found

--- configure.in | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/configure.in b/configure.in index 3be11f2..81548b8 100644 --- a/configure.in +++ b/configure.in @@ -116,7 +116,8 @@ dnl If portablexdr is installed, prefer that. dnl Otherwise try -lrpc (Cygwin) -lxdr (some MinGW), -lnsl (Solaris) dnl or none (most Unix) AC_CHECK_LIB([portablexdr],[xdrmem_create],[],[ - AC_SEARCH_LIBS([xdrmem_create],[rpc xdr nsl]) + AC_SEARCH_LIBS([xdrmem_create],[rpc xdr nsl],[], + [AC_MSG_ERROR([Cannot find a XDR library])]) ]) AC_CHECK_LIB([intl],[gettext],[]) -- 1.6.0.4

On Tue, Dec 22, 2009 at 02:12:51AM +0100, Matthias Bolte wrote:
--- configure.in | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/configure.in b/configure.in index 3be11f2..81548b8 100644 --- a/configure.in +++ b/configure.in @@ -116,7 +116,8 @@ dnl If portablexdr is installed, prefer that. dnl Otherwise try -lrpc (Cygwin) -lxdr (some MinGW), -lnsl (Solaris) dnl or none (most Unix) AC_CHECK_LIB([portablexdr],[xdrmem_create],[],[ - AC_SEARCH_LIBS([xdrmem_create],[rpc xdr nsl]) + AC_SEARCH_LIBS([xdrmem_create],[rpc xdr nsl],[], + [AC_MSG_ERROR([Cannot find a XDR library])]) ])
AC_CHECK_LIB([intl],[gettext],[])
ACK Daniel -- Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/ daniel@veillard.com | Rpmfind RPM search engine http://rpmfind.net/ http://veillard.com/ | virtualization library http://libvirt.org/

On Tue, Dec 22, 2009 at 02:12:51AM +0100, Matthias Bolte wrote:
--- configure.in | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/configure.in b/configure.in index 3be11f2..81548b8 100644 --- a/configure.in +++ b/configure.in @@ -116,7 +116,8 @@ dnl If portablexdr is installed, prefer that. dnl Otherwise try -lrpc (Cygwin) -lxdr (some MinGW), -lnsl (Solaris) dnl or none (most Unix) AC_CHECK_LIB([portablexdr],[xdrmem_create],[],[ - AC_SEARCH_LIBS([xdrmem_create],[rpc xdr nsl]) + AC_SEARCH_LIBS([xdrmem_create],[rpc xdr nsl],[], + [AC_MSG_ERROR([Cannot find a XDR library])]) ])
AC_CHECK_LIB([intl],[gettext],[])
Hmm, there is no xdr library required on Linux, so we don't want to throw an error in case. Its just part of glibc Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

On Tue, Dec 22, 2009 at 10:21:16AM +0000, Daniel P. Berrange wrote:
On Tue, Dec 22, 2009 at 02:12:51AM +0100, Matthias Bolte wrote:
--- configure.in | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/configure.in b/configure.in index 3be11f2..81548b8 100644 --- a/configure.in +++ b/configure.in @@ -116,7 +116,8 @@ dnl If portablexdr is installed, prefer that. dnl Otherwise try -lrpc (Cygwin) -lxdr (some MinGW), -lnsl (Solaris) dnl or none (most Unix) AC_CHECK_LIB([portablexdr],[xdrmem_create],[],[ - AC_SEARCH_LIBS([xdrmem_create],[rpc xdr nsl]) + AC_SEARCH_LIBS([xdrmem_create],[rpc xdr nsl],[], + [AC_MSG_ERROR([Cannot find a XDR library])]) ])
AC_CHECK_LIB([intl],[gettext],[])
Hmm, there is no xdr library required on Linux, so we don't want to throw an error in case. Its just part of glibc
Hum, I didn't see an error by applying this patch and autogen'ing on Fedora 12 ... Daniel -- Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/ daniel@veillard.com | Rpmfind RPM search engine http://rpmfind.net/ http://veillard.com/ | virtualization library http://libvirt.org/

2009/12/22 Daniel P. Berrange <berrange@redhat.com>:
On Tue, Dec 22, 2009 at 02:12:51AM +0100, Matthias Bolte wrote:
--- configure.in | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/configure.in b/configure.in index 3be11f2..81548b8 100644 --- a/configure.in +++ b/configure.in @@ -116,7 +116,8 @@ dnl If portablexdr is installed, prefer that. dnl Otherwise try -lrpc (Cygwin) -lxdr (some MinGW), -lnsl (Solaris) dnl or none (most Unix) AC_CHECK_LIB([portablexdr],[xdrmem_create],[],[ - AC_SEARCH_LIBS([xdrmem_create],[rpc xdr nsl]) + AC_SEARCH_LIBS([xdrmem_create],[rpc xdr nsl],[], + [AC_MSG_ERROR([Cannot find a XDR library])]) ])
AC_CHECK_LIB([intl],[gettext],[])
Hmm, there is no xdr library required on Linux, so we don't want to throw an error in case. Its just part of glibc
When trying to compile libvirt on Windows libportablexdr for example is necessary. On Linux I get this output in config log: configure:41995: checking for xdrmem_create in -lportablexdr configure:42030: gcc -o conftest -g -O2 conftest.c -lportablexdr >&5 /usr/bin/ld: cannot find -lportablexdr collect2: ld returned 1 exit status [...] configure:42069: checking for library containing xdrmem_create configure:42110: gcc -o conftest -g -O2 conftest.c >&5 configure:42117: $? = 0 configure:42148: result: none required The first explicit check for libportablexdr fails, but the second test succeeds and finds xdrmem_create from glibc. Matthias

On Tue, Dec 22, 2009 at 12:15:33PM +0100, Matthias Bolte wrote:
2009/12/22 Daniel P. Berrange <berrange@redhat.com>:
On Tue, Dec 22, 2009 at 02:12:51AM +0100, Matthias Bolte wrote:
--- configure.in | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/configure.in b/configure.in index 3be11f2..81548b8 100644 --- a/configure.in +++ b/configure.in @@ -116,7 +116,8 @@ dnl If portablexdr is installed, prefer that. dnl Otherwise try -lrpc (Cygwin) -lxdr (some MinGW), -lnsl (Solaris) dnl or none (most Unix) AC_CHECK_LIB([portablexdr],[xdrmem_create],[],[ - AC_SEARCH_LIBS([xdrmem_create],[rpc xdr nsl]) + AC_SEARCH_LIBS([xdrmem_create],[rpc xdr nsl],[], + [AC_MSG_ERROR([Cannot find a XDR library])]) ])
AC_CHECK_LIB([intl],[gettext],[])
Hmm, there is no xdr library required on Linux, so we don't want to throw an error in case. Its just part of glibc
When trying to compile libvirt on Windows libportablexdr for example is necessary. On Linux I get this output in config log:
configure:41995: checking for xdrmem_create in -lportablexdr configure:42030: gcc -o conftest -g -O2 conftest.c -lportablexdr >&5 /usr/bin/ld: cannot find -lportablexdr collect2: ld returned 1 exit status [...] configure:42069: checking for library containing xdrmem_create configure:42110: gcc -o conftest -g -O2 conftest.c >&5 configure:42117: $? = 0 configure:42148: result: none required
The first explicit check for libportablexdr fails, but the second test succeeds and finds xdrmem_create from glibc.
Ok, so AC_SEARCH_LIBS() is doing a test with no library at all first, before then trying librpc, libxdr and libnsl in turn. ACK Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

2009/12/22 Daniel P. Berrange <berrange@redhat.com>:
On Tue, Dec 22, 2009 at 12:15:33PM +0100, Matthias Bolte wrote:
2009/12/22 Daniel P. Berrange <berrange@redhat.com>:
On Tue, Dec 22, 2009 at 02:12:51AM +0100, Matthias Bolte wrote:
--- configure.in | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/configure.in b/configure.in index 3be11f2..81548b8 100644 --- a/configure.in +++ b/configure.in @@ -116,7 +116,8 @@ dnl If portablexdr is installed, prefer that. dnl Otherwise try -lrpc (Cygwin) -lxdr (some MinGW), -lnsl (Solaris) dnl or none (most Unix) AC_CHECK_LIB([portablexdr],[xdrmem_create],[],[ - AC_SEARCH_LIBS([xdrmem_create],[rpc xdr nsl]) + AC_SEARCH_LIBS([xdrmem_create],[rpc xdr nsl],[], + [AC_MSG_ERROR([Cannot find a XDR library])]) ])
AC_CHECK_LIB([intl],[gettext],[])
Hmm, there is no xdr library required on Linux, so we don't want to throw an error in case. Its just part of glibc
When trying to compile libvirt on Windows libportablexdr for example is necessary. On Linux I get this output in config log:
configure:41995: checking for xdrmem_create in -lportablexdr configure:42030: gcc -o conftest -g -O2 conftest.c -lportablexdr >&5 /usr/bin/ld: cannot find -lportablexdr collect2: ld returned 1 exit status [...] configure:42069: checking for library containing xdrmem_create configure:42110: gcc -o conftest -g -O2 conftest.c >&5 configure:42117: $? = 0 configure:42148: result: none required
The first explicit check for libportablexdr fails, but the second test succeeds and finds xdrmem_create from glibc.
Ok, so AC_SEARCH_LIBS() is doing a test with no library at all first, before then trying librpc, libxdr and libnsl in turn. ACK
Daniel
Okay, pushed the 8 patches. Matthias
participants (3)
-
Daniel P. Berrange
-
Daniel Veillard
-
Matthias Bolte