From patchwork Sun Nov 23 15:09:17 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yann E. MORIN" X-Patchwork-Id: 5361761 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id B81529F39D for ; Sun, 23 Nov 2014 15:09:31 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 89C4420253 for ; Sun, 23 Nov 2014 15:09:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2407F20251 for ; Sun, 23 Nov 2014 15:09:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751253AbaKWPJZ (ORCPT ); Sun, 23 Nov 2014 10:09:25 -0500 Received: from mail-wi0-f177.google.com ([209.85.212.177]:47686 "EHLO mail-wi0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751237AbaKWPJY (ORCPT ); Sun, 23 Nov 2014 10:09:24 -0500 Received: by mail-wi0-f177.google.com with SMTP id l15so3484454wiw.4 for ; Sun, 23 Nov 2014 07:09:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id; bh=w0qk+VTvgqa3E1OQ36biL5hBoTJMAyWes9AxGyIjmNA=; b=C3AT543oCgDE8mv20IEWLKbLC852zKHzp4oCltW3kVu4I9uvoZzHzeFzsWSaZJYPtH lZYm2DicQFqIAoFxpAWlJVKJ/Df0yFcVdG20YBTmYAawRGw5G9NM6brnJJmRqWqkPZ1W kDXN9GPdVid3QYvmfODPvsuYqqL23dRlhIr6fzZjxJPT+6IseM2fU0nVux7Plgz7ATic YbBfkBbThiv184G27BcxghEXjTgBnj2omjsL0mT42o9T9OwleRQg6GInsFTns/28Kx4D Zh9k9DO0W1LV0yZPQ3V3/BJ1/pE5SwLLYkz6XLFLETKRu75Rwj0qveSvhEWzDEm/4FbI uCQQ== X-Received: by 10.194.119.99 with SMTP id kt3mr15077290wjb.14.1416755363151; Sun, 23 Nov 2014 07:09:23 -0800 (PST) Received: from gourin.bzh.lan (ks3095497.kimsufi.com. [94.23.60.27]) by mx.google.com with ESMTPSA id vm8sm16730275wjc.6.2014.11.23.07.09.21 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 23 Nov 2014 07:09:22 -0800 (PST) From: "Yann E. MORIN" To: linux-nfs@vger.kernel.org Cc: "Yann E. MORIN" , Steve Dickson Subject: [PATCH nfs-utils] configure: use pkg-config to find libtirpc Date: Sun, 23 Nov 2014 16:09:17 +0100 Message-Id: <1416755357-12228-1-git-send-email-yann.morin.1998@free.fr> X-Mailer: git-send-email 1.9.1 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, FREEMAIL_FROM,RCVD_IN_DNSWL_HI,T_DKIM_INVALID,T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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" Cc: Steve Dickson --- Steve, This is related to the libtirpc patch I sent just mere hours ago. I was pretty amused to see, when looking who to send this patch to, that you were taking care of applying patches for both libtirpc and nfs-utils. :-) At least, now you've seen both patches, all should make sense! ;-) Regards, Yann E. MORIN. --- aclocal/libtirpc.m4 | 64 ++++++++--------------------------------------------- 1 file changed, 9 insertions(+), 55 deletions(-) diff --git a/aclocal/libtirpc.m4 b/aclocal/libtirpc.m4 index b823364..dc74638 100644 --- a/aclocal/libtirpc.m4 +++ b/aclocal/libtirpc.m4 @@ -2,61 +2,15 @@ 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_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