nfs-utils: fixup detection of libtirpc
Subsystems (2)
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(-)
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------. | 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. | '------------------------------^-------^------------------^--------------------'
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).
--- aclocal/libtirpc.m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
aclocal/libtirpc.m4 +1 -1
@@ -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])
Signature · 1 line
1.9.1
PATCH 2/4 configure: be more laxist on the required libtirpc version
In reply to Yann E. MORINCurrently, 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.
--- aclocal/libtirpc.m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
aclocal/libtirpc.m4 +1 -1
@@ -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],
Signature · 1 line
1.9.1
PATCH 3/4 configure:restore the old way of checking for libtirpc
In reply to Yann E. MORINSince 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).
--- aclocal/libtirpc.m4 | 36 ++++++++++++++++++++++++++++++++++-- 1 file changed, 34 insertions(+), 2 deletions(-)
aclocal/libtirpc.m4 +34 -2
@@ -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
Signature · 1 line
1.9.1
PATCH 4/4 configure: restore checking for authgss_free_private_data in libtirpc
In reply to Yann E. MORINSince 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.
--- aclocal/libtirpc.m4 | 6 ++++++ 1 file changed, 6 insertions(+)
aclocal/libtirpc.m4 +6 -0
@@ -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)
Signature · 1 line
1.9.1
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:
Quoted 37 lines
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_datain 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 forauthgss_free_private_datain libtirpc
Quoted 2 lines
aclocal/libtirpc.m4 | 44 +++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 41 insertions(+), 3 deletions(-)
Regards,
Yann E. MORIN.
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------. | 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. | '------------------------------^-------^------------------^--------------------'
Quoted 37 lines · Yann E. MORIN
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_datain 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 forauthgss_free_private_datain libtirpc
Quoted 3 lines
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.