From patchwork Wed Aug 10 21:45:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Giulio Benetti X-Patchwork-Id: 12940975 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 14DC8C00140 for ; Wed, 10 Aug 2022 21:46:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231533AbiHJVqE (ORCPT ); Wed, 10 Aug 2022 17:46:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51530 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231508AbiHJVqD (ORCPT ); Wed, 10 Aug 2022 17:46:03 -0400 Received: from smtpcmd01-ws.aruba.it (smtpcmd01-ws.aruba.it [62.149.158.241]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 561A450185 for ; Wed, 10 Aug 2022 14:45:57 -0700 (PDT) Received: from localhost.localdomain ([86.32.63.136]) by Aruba Outgoing Smtp with ESMTPSA id LtWVonv9or8wyLtWWoBOdr; Wed, 10 Aug 2022 23:45:56 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=aruba.it; s=a1; t=1660167956; bh=UAoNYouwoS+1+8VIqxJalEPvbD9bakxlPHxlUdkDve0=; h=From:To:Subject:Date:MIME-Version; b=jgCP+R3s1XKbifA4Bs6B6N75dYhot5Ebqg45D8bYZZOqG5oN3p34pRzMUAgmOtosy GYIizS9Y4yN1nevgAmHZ3u3wZPlX9YXqm2E6N1mKn3f3HCNsOUIldD9XHZy+CYX6TH XFxuuUMeCnks24L+AQWXoY+hy1iQH2NIeniXJexAU9oPb7wy3MLkAAjPMZIJWJt6Sa 8AMcaeCCTOsQ3wbrQtZSUBbKyF3I26sxuFK+V8hNCTvnWKKn3oZiLw1auMTngPOCSv qy7refLb6xsqbrvl0rpf5dIAcvxV9H6lRSe0L4xGQ6G+jOfl6d8qQBqfRO7u2sClsD QYrv1/SzfJvTw== From: Giulio Benetti To: linux-nfs@vger.kernel.org Cc: Giulio Benetti Subject: [PATCH v3] nfsrahead: fix linking while static linking Date: Wed, 10 Aug 2022 23:45:54 +0200 Message-Id: <20220810214554.107094-1-giulio.benetti@benettiengineering.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220809223308.1421081-1-giulio.benetti@benettiengineering.com> References: <20220809223308.1421081-1-giulio.benetti@benettiengineering.com> MIME-Version: 1.0 X-CMAE-Envelope: MS4xfMVFUVYZ0/KjKbP/g72z2BJcG4NtHsn2/LCkviEoNDFgu4e1waj+nJAstJkO8HvBa3Snm6qz3tcWwSbUd79J9uH+F+3FN/DhznaCkPLvROvQTq7jdHBy 0Q47HvEzN4fWcZesIRAYAiXRQrPh7siJD0TuT2Kz/+ax9xdxwweaDJ0LPqVz3YFlLo0adXCM10mRjNTIn9lRJj5X3KCmiDwxbewP47YPj+0lvUAGTdR9oLYs NZygUXJQdx9JWgVgrEmwfDfHUC8ybiZMjCPEENUk0PpGAt9IZmzWFPiYLVaJyB4Z Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org -lmount must preceed -lblkid and to obtain this let's add in configure.ac: PKG_CHECK_MODULES([LIBMOUNT], [mount]) and in tools/nfsrahead/Makefile.am let's substitute explicit `-lmount` with: $(LIBMOUNT_LIBS) This way all the required libraries will be present and in the right order when static linking. Signed-off-by: Giulio Benetti Reviewed-by: Petr Vorel --- V1->V2: * modify pkg-conf to pkg-config V2->V3: * use the correct way for using pkg-config with Autotools --- configure.ac | 3 +++ tools/nfsrahead/Makefile.am | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index f1c46c5c..ff85200b 100644 --- a/configure.ac +++ b/configure.ac @@ -273,6 +273,9 @@ AC_LIBCAP dnl Check for -lxml2 AC_LIBXML2 +dnl Check for -lmount +PKG_CHECK_MODULES([LIBMOUNT], [mount]) + # Check whether user wants TCP wrappers support AC_TCP_WRAPPERS diff --git a/tools/nfsrahead/Makefile.am b/tools/nfsrahead/Makefile.am index 845ea0d5..7e08233a 100644 --- a/tools/nfsrahead/Makefile.am +++ b/tools/nfsrahead/Makefile.am @@ -1,6 +1,6 @@ libexec_PROGRAMS = nfsrahead nfsrahead_SOURCES = main.c -nfsrahead_LDFLAGS= -lmount +nfsrahead_LDFLAGS= $(LIBMOUNT_LIBS) nfsrahead_LDADD = ../../support/nfs/libnfsconf.la man5_MANS = nfsrahead.man