From patchwork Tue Jan 6 23:07:59 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yann E. MORIN" X-Patchwork-Id: 5577991 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.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id D5D039F443 for ; Tue, 6 Jan 2015 23:08:10 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id ECBFE200F2 for ; Tue, 6 Jan 2015 23:08:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 100E92010C for ; Tue, 6 Jan 2015 23:08:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751827AbbAFXIH (ORCPT ); Tue, 6 Jan 2015 18:08:07 -0500 Received: from mail-we0-f177.google.com ([74.125.82.177]:57204 "EHLO mail-we0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751958AbbAFXIH (ORCPT ); Tue, 6 Jan 2015 18:08:07 -0500 Received: by mail-we0-f177.google.com with SMTP id q59so180995wes.36 for ; Tue, 06 Jan 2015 15:08:05 -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:in-reply-to:references; bh=/LaJm1v9DQ04eLEn86ih1/BkzThosikgL/v6SG5v3AQ=; b=ZFd97G7uYtUvmPJB4/+4iLJBULYnZ9Uh2TuhCINwncS0Pxs/F4IKsp2Is2nm1ivZ74 FKQZCly2pCuW2DEGw8RdM5TrdQF3CegiPDLymN2TFF5CfwfwXd5DKQONhYRAr6XcHlvp 4pEAu6+YULqFArkfI3NuF534d/1BZK/m1DgTSuOfuG6DvIoxw5g0SynkLk/wGDo05lIF 6Fs9lTjiLTO9exwQHtsnxyVukf+9IRVYreDKuWBbQvSnDk7qMp8FqecH3bnnX62mZs7u WL/+1N5yYP2Z8/zn3qXroxdhycHZDurePBBFhrYLRlOuPGTxF6snjE6YFCsCDuWmBTXM h7pQ== X-Received: by 10.180.97.106 with SMTP id dz10mr1335300wib.6.1420585685848; Tue, 06 Jan 2015 15:08:05 -0800 (PST) Received: from gourin.bzh.lan (ks3095497.kimsufi.com. [94.23.60.27]) by mx.google.com with ESMTPSA id pl1sm363089wic.16.2015.01.06.15.08.04 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 06 Jan 2015 15:08:05 -0800 (PST) From: "Yann E. MORIN" To: linux-nfs@vger.kernel.org Cc: "Yann E. MORIN" , Steve Dickson Subject: [PATCH 3/4] configure:restore the old way of checking for libtirpc Date: Wed, 7 Jan 2015 00:07:59 +0100 Message-Id: <9eef40dddd6c313a09150bffad4ff3b444a81cac.1420585444.git.yann.morin.1998@free.fr> X-Mailer: git-send-email 1.9.1 In-Reply-To: References: 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 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 Signed-off-by: "Yann E. MORIN" Cc: Steve Dickson --- 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