2015-01-06 23:08:00

by Yann E. MORIN

[permalink] [raw]
Subject: [pull request] nfs-utils: fixup detection of libtirpc

Hello All!

This series is an ateempt to fix up the detection of libtirpc.

Since commit 8534063 (configure: use pkg-config to find libtirpc) (by me),
some users are reporting that they can no longer build nfs-utils on older
libtirpc versions.

Furthermore, after inspecting my own change, I saw thatI borked some of
the tests: incorrect test when libtirpc is not required, and dropped
check for authgss_free_private_data.

This series attempts to fix all those issues. Sorry for the mishap...

Regards,
Yann E. MORIN.


The following changes since commit fac4b7d30aafb6a02f66f29f0680db7b4894db79:

mountstats: Updated the mountstats(8) man page. (2014-12-13 10:40:28 -0500)

are available in the git repository at:

https://github.com/yann-morin-1998/nfs-utils.git yem/libtirpc-pkg-config

for you to fetch changes up to f3aaa3c4f47cd75629b60b913d97ef9d7dfd19ea:

configure: restore checking for authgss_free_private_data in libtirpc (2015-01-06 23:58:22 +0100)

----------------------------------------------------------------
Yann E. MORIN (4):
configure: do not fail if libtirpc is missing but not requested
configure: be more laxist on the required libtirpc version
configure:restore the old way of checking for libtirpc
configure: restore checking for authgss_free_private_data in libtirpc

aclocal/libtirpc.m4 | 44 +++++++++++++++++++++++++++++++++++++++++---
1 file changed, 41 insertions(+), 3 deletions(-)

--
.-----------------.--------------------.------------------.--------------------.
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ |
| +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. |
'------------------------------^-------^------------------^--------------------'


2015-01-06 23:08:04

by Yann E. MORIN

[permalink] [raw]
Subject: [PATCH 1/4] configure: do not fail if libtirpc is missing but not requested

The current code bails out if libtirpc is not found, making it a
mandatory dependency of nfs-utils, which it is not: it is only an
optional dependency.

The culprit (introduced by me) is the action-if-not-found in
PKG_CHECK_MODULES, that improerly checks the value of the --enable-tirpc
flag.

Fix that by checking against a 'yes'. Any other value means either
'auto' (in which case we do not want to fail), or 'no' (in which case we
do not even run the test to start with).

Signed-off-by: "Yann E. MORIN" <[email protected]>
Cc: Chuck Lever <[email protected]>
Cc: Steve Dickson <[email protected]>
---
aclocal/libtirpc.m4 | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/aclocal/libtirpc.m4 b/aclocal/libtirpc.m4
index ebc1bea..c46f16a 100644
--- a/aclocal/libtirpc.m4
+++ b/aclocal/libtirpc.m4
@@ -10,7 +10,7 @@ AC_DEFUN([AC_LIBTIRPC], [
AM_CPPFLAGS="${AM_CPPFLAGS} ${TIRPC_CFLAGS}"
AC_DEFINE([HAVE_LIBTIRPC], [1],
[Define to 1 if you have and wish to use libtirpc.])],
- [AS_IF([test "$enable_tirpc" != "no"], [AC_MSG_ERROR([libtirpc not found.])],
+ [AS_IF([test "$enable_tirpc" = "yes"], [AC_MSG_ERROR([libtirpc not found.])],
[LIBTIRPC=""])])])

AC_SUBST([AM_CPPFLAGS])
--
1.9.1


2015-01-06 23:08:05

by Yann E. MORIN

[permalink] [raw]
Subject: [PATCH 2/4] configure: be more laxist on the required libtirpc version

Currently, we check for libtirpc >= 0.2.4 with pkg-config, because that
is the one version I had to test against.

As reported on the list, however, older versions are also supported.

Relax the check to not require a version at all, and accept any version
of libtirpc.

Reported-by: Chuck Lever <[email protected]>
Signed-off-by: "Yann E. MORIN" <[email protected]>
Cc: Steve Dickson <[email protected]>
---
aclocal/libtirpc.m4 | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/aclocal/libtirpc.m4 b/aclocal/libtirpc.m4
index c46f16a..9ea17c5 100644
--- a/aclocal/libtirpc.m4
+++ b/aclocal/libtirpc.m4
@@ -5,7 +5,7 @@ AC_DEFUN([AC_LIBTIRPC], [
PKG_PROG_PKG_CONFIG([0.9.0])
AS_IF(
[test "$enable_tirpc" != "no"],
- [PKG_CHECK_MODULES([TIRPC], [libtirpc >= 0.2.4],
+ [PKG_CHECK_MODULES([TIRPC], [libtirpc],
[LIBTIRPC="${TIRPC_LIBS}"
AM_CPPFLAGS="${AM_CPPFLAGS} ${TIRPC_CFLAGS}"
AC_DEFINE([HAVE_LIBTIRPC], [1],
--
1.9.1


2015-01-06 23:08:07

by Yann E. MORIN

[permalink] [raw]
Subject: [PATCH 3/4] configure:restore the old way of checking for libtirpc

Since 8534063 (configure: use pkg-config to find libtirpc), we use
pkg-config to check for libtirpc (he!).

As reported on the list, some user do not have the libtirpc registered
with pkg-config (even though it has been since at least 0.1.8).

So, partially restore the old checking code, as it was before 8534063,
but adapted to work with the pkg-config check, and also adapted to only
use proper macros (AS_IF) instead of shell constructs.

Re-introduce that old code in a separate function, so it is easy to get
rid of when we only want to support pkg-config in the future (i.e. when
virtually all libtirpc versions in the wild have been properly
installed).

Reported-by: Chuck Lever <[email protected]>
Signed-off-by: "Yann E. MORIN" <[email protected]>
Cc: Steve Dickson <[email protected]>
---
aclocal/libtirpc.m4 | 36 ++++++++++++++++++++++++++++++++++--
1 file changed, 34 insertions(+), 2 deletions(-)

diff --git a/aclocal/libtirpc.m4 b/aclocal/libtirpc.m4
index 9ea17c5..5e9d76e 100644
--- a/aclocal/libtirpc.m4
+++ b/aclocal/libtirpc.m4
@@ -10,10 +10,42 @@ AC_DEFUN([AC_LIBTIRPC], [
AM_CPPFLAGS="${AM_CPPFLAGS} ${TIRPC_CFLAGS}"
AC_DEFINE([HAVE_LIBTIRPC], [1],
[Define to 1 if you have and wish to use libtirpc.])],
- [AS_IF([test "$enable_tirpc" = "yes"], [AC_MSG_ERROR([libtirpc not found.])],
- [LIBTIRPC=""])])])
+ [AC_LIBTIRPC_OLD
+ AS_IF([test "$enable_tirpc" = "yes" -a -z "${LIBTIRPC}"],
+ [AC_MSG_ERROR([libtirpc not found.])])])])

AC_SUBST([AM_CPPFLAGS])
AC_SUBST(LIBTIRPC)

])dnl
+
+dnl Old way of checking libtirpc without pkg-config
+dnl This can go away when virtually all libtirpc provide a .pc file
+dnl
+AC_DEFUN([AC_LIBTIRPC_OLD], [
+
+ AC_ARG_WITH([tirpcinclude],
+ [AC_HELP_STRING([--with-tirpcinclude=DIR],
+ [use TI-RPC headers in DIR])],
+ [tirpc_header_dir=$withval],
+ [tirpc_header_dir=/usr/include/tirpc])
+
+ dnl Look for the library
+ AC_CHECK_LIB([tirpc], [clnt_tli_create],
+ [has_libtirpc="yes"],
+ [has_libtirpc="no"])
+
+ dnl Also must have the headers installed where we expect
+ dnl to look for headers; add -I compiler option if found
+ AS_IF([test "$has_libtirpc" = "yes"],
+ [AC_CHECK_HEADERS([${tirpc_header_dir}/netconfig.h],
+ [AC_SUBST([AM_CPPFLAGS], ["-I${tirpc_header_dir}"])],
+ [has_libtirpc="no"])])
+
+ dnl Now set $LIBTIRPC accordingly
+ AS_IF([test "$has_libtirpc" = "yes"],
+ [AC_DEFINE([HAVE_LIBTIRPC], [1],
+ [Define to 1 if you have and wish to use libtirpc.])
+ LIBTIRPC="-ltirpc"])
+
+])dnl
--
1.9.1


2015-01-06 23:08:08

by Yann E. MORIN

[permalink] [raw]
Subject: [PATCH 4/4] configure: restore checking for authgss_free_private_data in libtirpc

Since commit 8534063 (configure: use pkg-config to find libtirpc), we
are missing the check for authgss_free_private_data in libtirpc.

Restore this check, and adapt so that it works in both the pkg-config
case and in the "old code" case.

Signed-off-by: "Yann E. MORIN" <[email protected]>
Cc: Chuck Lever <[email protected]>
Cc: Steve Dickson <[email protected]>
---
aclocal/libtirpc.m4 | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/aclocal/libtirpc.m4 b/aclocal/libtirpc.m4
index 5e9d76e..b7de636 100644
--- a/aclocal/libtirpc.m4
+++ b/aclocal/libtirpc.m4
@@ -14,6 +14,12 @@ AC_DEFUN([AC_LIBTIRPC], [
AS_IF([test "$enable_tirpc" = "yes" -a -z "${LIBTIRPC}"],
[AC_MSG_ERROR([libtirpc not found.])])])])

+ AS_IF([test -n "${LIBTIRPC}"],
+ [AC_CHECK_LIB([tirpc], [authgss_free_private_data],
+ [AC_DEFINE([HAVE_AUTHGSS_FREE_PRIVATE_DATA], [1],
+ [Define to 1 if your rpcsec library provides authgss_free_private_data])],,
+ [${LIBS}])])
+
AC_SUBST([AM_CPPFLAGS])
AC_SUBST(LIBTIRPC)

--
1.9.1


2015-01-06 23:21:22

by Yann E. MORIN

[permalink] [raw]
Subject: Re: [pull request] nfs-utils: fixup detection of libtirpc

Chuck, All,

Chuck, apologies: I mispelled your email when copying from the mail
archives. Sorry... :-(

Hopefuly, the committer can fix the 'Cc:' and 'Reported-by:' fields when
applying that series? If not, I'll respin...

On 2015-01-07 00:07 +0100, Yann E. MORIN spake thusly:
> Hello All!
>
> This series is an ateempt to fix up the detection of libtirpc.
>
> Since commit 8534063 (configure: use pkg-config to find libtirpc) (by me),
> some users are reporting that they can no longer build nfs-utils on older
> libtirpc versions.
>
> Furthermore, after inspecting my own change, I saw thatI borked some of
> the tests: incorrect test when libtirpc is not required, and dropped
> check for authgss_free_private_data.
>
> This series attempts to fix all those issues. Sorry for the mishap...
>
> Regards,
> Yann E. MORIN.
>
>
> The following changes since commit fac4b7d30aafb6a02f66f29f0680db7b4894db79:
>
> mountstats: Updated the mountstats(8) man page. (2014-12-13 10:40:28 -0500)
>
> are available in the git repository at:
>
> https://github.com/yann-morin-1998/nfs-utils.git yem/libtirpc-pkg-config
>
> for you to fetch changes up to f3aaa3c4f47cd75629b60b913d97ef9d7dfd19ea:
>
> configure: restore checking for authgss_free_private_data in libtirpc (2015-01-06 23:58:22 +0100)
>
> ----------------------------------------------------------------
> Yann E. MORIN (4):
> configure: do not fail if libtirpc is missing but not requested
> configure: be more laxist on the required libtirpc version
> configure:restore the old way of checking for libtirpc
> configure: restore checking for authgss_free_private_data in libtirpc
>
> aclocal/libtirpc.m4 | 44 +++++++++++++++++++++++++++++++++++++++++---
> 1 file changed, 41 insertions(+), 3 deletions(-)

Regards,
Yann E. MORIN.

--
.-----------------.--------------------.------------------.--------------------.
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ |
| +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. |
'------------------------------^-------^------------------^--------------------'

2015-01-23 15:11:58

by Steve Dickson

[permalink] [raw]
Subject: Re: [pull request] nfs-utils: fixup detection of libtirpc



On 01/06/2015 06:07 PM, Yann E. MORIN wrote:
> Hello All!
>
> This series is an ateempt to fix up the detection of libtirpc.
>
> Since commit 8534063 (configure: use pkg-config to find libtirpc) (by me),
> some users are reporting that they can no longer build nfs-utils on older
> libtirpc versions.
>
> Furthermore, after inspecting my own change, I saw thatI borked some of
> the tests: incorrect test when libtirpc is not required, and dropped
> check for authgss_free_private_data.
>
> This series attempts to fix all those issues. Sorry for the mishap...
>
> Regards,
> Yann E. MORIN.
>
>
> The following changes since commit fac4b7d30aafb6a02f66f29f0680db7b4894db79:
>
> mountstats: Updated the mountstats(8) man page. (2014-12-13 10:40:28 -0500)
>
> are available in the git repository at:
>
> https://github.com/yann-morin-1998/nfs-utils.git yem/libtirpc-pkg-config
>
> for you to fetch changes up to f3aaa3c4f47cd75629b60b913d97ef9d7dfd19ea:
>
> configure: restore checking for authgss_free_private_data in libtirpc (2015-01-06 23:58:22 +0100)
>
> ----------------------------------------------------------------
> Yann E. MORIN (4):
> configure: do not fail if libtirpc is missing but not requested
> configure: be more laxist on the required libtirpc version
> configure:restore the old way of checking for libtirpc
> configure: restore checking for authgss_free_private_data in libtirpc
>
> aclocal/libtirpc.m4 | 44 +++++++++++++++++++++++++++++++++++++++++---
> 1 file changed, 41 insertions(+), 3 deletions(-)
>
Committed... This restore the ability to compile the upstream nfs-utils
on legacy OSes by using the --disable-nfsv41 config flag

steved.