Linux NFS development
 help / color / mirror / Atom feed
From: Steve Dickson <SteveD@redhat.com>
To: "Yann E. MORIN" <yann.morin.1998@free.fr>,
	libtirpc-devel@lists.sourceforge.net
Cc: linux-nfs@vger.kernel.org
Subject: Re: [PATCH nfs-utils v2] configure: use pkg-config to find libtirpc
Date: Sat, 13 Dec 2014 10:17:44 -0500	[thread overview]
Message-ID: <548C5898.6060407@RedHat.com> (raw)
In-Reply-To: <1416764619-6211-1-git-send-email-yann.morin.1998@free.fr>



On 11/23/2014 12:43 PM, Yann E. MORIN wrote:
> Currently, we use a custom function to find libtirpc's headers and
> libraries. This works fine for shared linking.
> 
> But for static linking, this forgets to link with -lpthread, which is
> required by libtirpc.
> 
> A recent patch was sent to libtirpc to add that missing -lpthread in its
> Libs.private section of its .pc file. Thus, pkg-config will soon be able
> to return the appropriate libraries.
> 
> So, use pkg-config to find libtirpc.
> 
> And for older libtirpc versions, there is no change in behaviour: we're
> still missing the -lpthread. But once libtirpc has been fixed, we'll
> automatically get that missing library for free! :-)
> 
> Remove the --with-libirpc flag as it is no longer needed: pkg-config
> will provide us with the -I and -L flags, now.
> 
> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
> Cc: Steve Dickson <steved@redhat.com>
Committed... 

steved.

> 
> ---
> Changes v1 -> v2:
>   - posted to the appropriate locations  (thanks Steve)
>   - do not do the check if libtirpc is disabled from command line
>     with --disable-libtirpc
> ---
>  aclocal/libtirpc.m4 | 67 ++++++++++-------------------------------------------
>  1 file changed, 12 insertions(+), 55 deletions(-)
> 
> diff --git a/aclocal/libtirpc.m4 b/aclocal/libtirpc.m4
> index b823364..ebc1bea 100644
> --- a/aclocal/libtirpc.m4
> +++ b/aclocal/libtirpc.m4
> @@ -2,61 +2,18 @@ dnl Checks for TI-RPC library and headers
>  dnl
>  AC_DEFUN([AC_LIBTIRPC], [
>  
> -  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 if --enable-tirpc was specifed, the following components
> -  dnl must be present, and we set up HAVE_ macros for them.
> -
> -  if test "$enable_tirpc" != "no"; then
> -
> -    dnl look for the library
> -    AC_CHECK_LIB([tirpc], [clnt_tli_create], [:],
> -                 [if test "$enable_tirpc" = "yes"; then
> -			AC_MSG_ERROR([libtirpc not found.])
> -		  else
> -			AC_MSG_WARN([libtirpc not found. TIRPC disabled!])
> -			enable_tirpc="no"
> -		  fi])
> -  fi
> -
> -  if test "$enable_tirpc" != "no"; then
> -
> -    dnl Check if library contains authgss_free_private_data
> -    AC_CHECK_LIB([tirpc], [authgss_free_private_data], [have_free_private_data=yes],
> -			[have_free_private_data=no])
> -  fi
> -
> -  if test "$enable_tirpc" != "no"; then
> -    dnl also must have the headers installed where we expect
> -    dnl look for headers; add -I compiler option if found
> -    AC_CHECK_HEADERS([${tirpc_header_dir}/netconfig.h],
> -    		      AC_SUBST([AM_CPPFLAGS], ["-I${tirpc_header_dir}"]),
> -		      [if test "$enable_tirpc" = "yes"; then
> -			 AC_MSG_ERROR([libtirpc headers not found.])
> -		       else
> -			 AC_MSG_WARN([libtirpc headers not found. TIRPC disabled!])
> -			 enable_tirpc="no"
> -		       fi])
> -
> -  fi
> -
> -  dnl now set $LIBTIRPC accordingly
> -  if test "$enable_tirpc" != "no"; then
> -    AC_DEFINE([HAVE_LIBTIRPC], 1,
> -              [Define to 1 if you have and wish to use libtirpc.])
> -    LIBTIRPC="-ltirpc"
> -    if test "$have_free_private_data" = "yes"; then
> -      AC_DEFINE([HAVE_AUTHGSS_FREE_PRIVATE_DATA], 1,
> -	      [Define to 1 if your rpcsec library provides authgss_free_private_data,])
> -    fi
> -  else
> -    LIBTIRPC=""
> -  fi
> -
> +  PKG_PROG_PKG_CONFIG([0.9.0])
> +  AS_IF(
> +    [test "$enable_tirpc" != "no"],
> +    [PKG_CHECK_MODULES([TIRPC], [libtirpc >= 0.2.4],
> +                      [LIBTIRPC="${TIRPC_LIBS}"
> +                       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.])],
> +                             [LIBTIRPC=""])])])
> +
> +  AC_SUBST([AM_CPPFLAGS])
>    AC_SUBST(LIBTIRPC)
>  
>  ])dnl
> 

      reply	other threads:[~2014-12-13 15:17 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-23 17:43 [PATCH nfs-utils v2] configure: use pkg-config to find libtirpc Yann E. MORIN
2014-12-13 15:17 ` Steve Dickson [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=548C5898.6060407@RedHat.com \
    --to=steved@redhat.com \
    --cc=libtirpc-devel@lists.sourceforge.net \
    --cc=linux-nfs@vger.kernel.org \
    --cc=yann.morin.1998@free.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox