From patchwork Tue Apr 14 06:00:29 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Calvin Walton X-Patchwork-Id: 6213811 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 D4CBE9F2EC for ; Tue, 14 Apr 2015 06:00:58 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0F50E201ED for ; Tue, 14 Apr 2015 06:00:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C0763201EC for ; Tue, 14 Apr 2015 06:00:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751492AbbDNGAv (ORCPT ); Tue, 14 Apr 2015 02:00:51 -0400 Received: from mail-ig0-f180.google.com ([209.85.213.180]:38769 "EHLO mail-ig0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750992AbbDNGAu (ORCPT ); Tue, 14 Apr 2015 02:00:50 -0400 Received: by igbqf9 with SMTP id qf9so6822516igb.1 for ; Mon, 13 Apr 2015 23:00:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kepstin.ca; s=google; h=from:to:cc:subject:date:message-id; bh=x9qFF95RpWY1LTx+UakldtreBFOXO4oTb+CZctFPWJU=; b=YBwAKsL4RUMzTQYqgsbwXM5lhP/jEE9P9s09M4xFfi51r9WU1N10FhVc4aEqiKckzD x8P/LaTjAkDw6dlVMA4xptoj6dXPmdp8A9roqB/WdgNRiYExvRhKmBCTPsdmPz0ncdGH HgUFe49bXAOJ1AIAiX5t1aVUSXDUYQIEeDzGg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=x9qFF95RpWY1LTx+UakldtreBFOXO4oTb+CZctFPWJU=; b=SoAmsV/nCPCSax6ILBs3hH6iWo0vT8mAKpwZrEeO+fsrIzQ80tq+AwfPyL9hMyUxSu ZvfW+29bWgceIun67ioheCaon/zi5c5/EklNDMhVaCtPTWJNDql8dl/1H8SbwpZ2HsN7 r734qZWzrFK0nVVQ3EE6uoZeSQMvGXH6OVZYw8iuuYM8OTjXzDwirMPmSSeYAF/AsK7o YgtSSM9KTfpf7spfGeCp647g6fWIbZnREVCsY2kgsRh5qVua3trcyGCmiSUX4Se7P9yq SLJirq8pHnpRSWXiGC88bH8RYX4yD3QMST6Bi5UKDjhokdlfpQbH1BsSMU7/iPXNyue9 wYpQ== X-Gm-Message-State: ALoCoQlrUEKwFi2x7QwIDRw8gOb4SYVM2tURYp20ictSlBtC8IWbZmuWi7yoA1SyGHKQbYza/p0c X-Received: by 10.50.30.202 with SMTP id u10mr21726686igh.28.1428991250199; Mon, 13 Apr 2015 23:00:50 -0700 (PDT) Received: from sasami.kepstin.ca (dhcp-108-168-126-208.cable.user.start.ca. [108.168.126.208]) by mx.google.com with ESMTPSA id 9sm6289249iom.29.2015.04.13.23.00.48 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 13 Apr 2015 23:00:49 -0700 (PDT) From: Calvin Walton To: linux-nfs@vger.kernel.org Cc: Steve Dickson , Calvin Walton Subject: [PATCH] nfs-utils: Run rpcgen using the cpp found by configure. Date: Tue, 14 Apr 2015 02:00:29 -0400 Message-Id: <1428991229-19835-1-git-send-email-calvin.walton@kepstin.ca> X-Mailer: git-send-email 2.3.3 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, 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 rpcgen normally runs with a hardcoded cpp path of e.g. /lib/cpp, but not all Linux distributions install a cpp there. Grab a trick from glibc, and run rpcgen with a cpp-path pointing at a script; the script then runs the cpp specified in the CPP environment variable - which was set by the configure script to something reasonable. Signed-off-by: Calvin Walton --- support/export/Makefile.am | 13 +++++++------ support/nsm/Makefile.am | 17 +++++++++-------- tests/nsm_client/Makefile.am | 17 +++++++++-------- tools/rpcgen/cpp | 6 ++++++ utils/statd/Makefile.am | 17 +++++++++-------- 5 files changed, 40 insertions(+), 30 deletions(-) create mode 100755 tools/rpcgen/cpp diff --git a/support/export/Makefile.am b/support/export/Makefile.am index 1ea1539..d33516d 100644 --- a/support/export/Makefile.am +++ b/support/export/Makefile.am @@ -22,22 +22,23 @@ dist-hook: done if CONFIG_RPCGEN -RPCGEN = $(top_builddir)/tools/rpcgen/rpcgen -$(RPCGEN): +RPCGEN_DEP = $(top_builddir)/tools/rpcgen/rpcgen +$(RPCGEN_DEP): make -C $(top_srcdir)/tools/rpcgen all +RPCGEN = $(RPCGEN_DEP) -Y $(top_srcdir)/tools/rpcgen else -RPCGEN = @RPCGEN_PATH@ +RPCGEN = @RPCGEN_PATH@ -Y $(top_srcdir)/tools/rpcgen endif -$(GENFILES_CLNT): %_clnt.c: %.x $(RPCGEN) +$(GENFILES_CLNT): %_clnt.c: %.x $(RPCGEN_DEP) test -f $@ && rm -rf $@ || true $(RPCGEN) -l -o $@ $< -$(GENFILES_XDR): %_xdr.c: %.x $(RPCGEN) +$(GENFILES_XDR): %_xdr.c: %.x $(RPCGEN_DEP) test -f $@ && rm -rf $@ || true $(RPCGEN) -c -o $@ $< -$(GENFILES_H): %.h: %.x $(RPCGEN) +$(GENFILES_H): %.h: %.x $(RPCGEN_DEP) test -f $@ && rm -rf $@ || true $(RPCGEN) -h -o $@ $< rm -f $(top_builddir)/support/include/mount.h diff --git a/support/nsm/Makefile.am b/support/nsm/Makefile.am index 2038e68..bbbc199 100644 --- a/support/nsm/Makefile.am +++ b/support/nsm/Makefile.am @@ -15,26 +15,27 @@ libnsm_a_SOURCES = $(GENFILES) file.c rpc.c BUILT_SOURCES = $(GENFILES) if CONFIG_RPCGEN -RPCGEN = $(top_builddir)/tools/rpcgen/rpcgen -$(RPCGEN): - make -C ../../tools/rpcgen all +RPCGEN_DEP = $(top_builddir)/tools/rpcgen/rpcgen +$(RPCGEN_DEP): + make -C $(top_srcdir)/tools/rpcgen all +RPCGEN = $(RPCGEN_DEP) -Y $(top_srcdir)/tools/rpcgen else -RPCGEN = @RPCGEN_PATH@ +RPCGEN = @RPCGEN_PATH@ -Y $(top_srcdir)/tools/rpcgen endif -$(GENFILES_CLNT): %_clnt.c: %.x $(RPCGEN) +$(GENFILES_CLNT): %_clnt.c: %.x $(RPCGEN_DEP) test -f $@ && rm -rf $@ || true $(RPCGEN) -l -o $@ $< -$(GENFILES_SVC): %_svc.c: %.x $(RPCGEN) +$(GENFILES_SVC): %_svc.c: %.x $(RPCGEN_DEP) test -f $@ && rm -rf $@ || true $(RPCGEN) -m -o $@ $< -$(GENFILES_XDR): %_xdr.c: %.x $(RPCGEN) +$(GENFILES_XDR): %_xdr.c: %.x $(RPCGEN_DEP) test -f $@ && rm -rf $@ || true $(RPCGEN) -c -o $@ $< -$(GENFILES_H): %.h: %.x $(RPCGEN) +$(GENFILES_H): %.h: %.x $(RPCGEN_DEP) test -f $@ && rm -rf $@ || true $(RPCGEN) -h -o $@ $< rm -f $(top_builddir)/support/include/sm_inter.h diff --git a/tests/nsm_client/Makefile.am b/tests/nsm_client/Makefile.am index a8fc131..aeaa05f 100644 --- a/tests/nsm_client/Makefile.am +++ b/tests/nsm_client/Makefile.am @@ -17,26 +17,27 @@ nsm_client_LDADD = ../../support/nfs/libnfs.a \ ../../support/nsm/libnsm.a $(LIBCAP) $(LIBTIRPC) if CONFIG_RPCGEN -RPCGEN = $(top_builddir)/tools/rpcgen/rpcgen -$(RPCGEN): - make -C ../../tools/rpcgen all +RPCGEN_DEP = $(top_builddir)/tools/rpcgen/rpcgen +$(RPCGEN_DEP): + make -C $(top_srcdir)/tools/rpcgen all +RPCGEN = $(RPCGEN_DEP) -Y $(top_srcdir)/tools/rpcgen else -RPCGEN = @RPCGEN_PATH@ +RPCGEN = @RPCGEN_PATH@ -Y $(top_srcdir)/tools/rpcgen endif -$(GENFILES_CLNT): %_clnt.c: %.x $(RPCGEN) +$(GENFILES_CLNT): %_clnt.c: %.x $(RPCGEN_DEP) test -f $@ && rm -rf $@ || true $(RPCGEN) -l -o $@ $< -$(GENFILES_SVC): %_svc.c: %.x $(RPCGEN) +$(GENFILES_SVC): %_svc.c: %.x $(RPCGEN_DEP) test -f $@ && rm -rf $@ || true $(RPCGEN) -m -o $@ $< -$(GENFILES_XDR): %_xdr.c: %.x $(RPCGEN) +$(GENFILES_XDR): %_xdr.c: %.x $(RPCGEN_DEP) test -f $@ && rm -rf $@ || true $(RPCGEN) -c -o $@ $< -$(GENFILES_H): %.h: %.x $(RPCGEN) +$(GENFILES_H): %.h: %.x $(RPCGEN_DEP) test -f $@ && rm -rf $@ || true $(RPCGEN) -h -o $@ $< diff --git a/tools/rpcgen/cpp b/tools/rpcgen/cpp new file mode 100755 index 0000000..73a5522 --- /dev/null +++ b/tools/rpcgen/cpp @@ -0,0 +1,6 @@ +#!/bin/sh + +# This script is use solely by rpcgen when run during the build. +# It allows using CPP from the environment rather than a hardcoded path. + +exec ${CPP} "$@" diff --git a/utils/statd/Makefile.am b/utils/statd/Makefile.am index 152b680..9c016ed 100644 --- a/utils/statd/Makefile.am +++ b/utils/statd/Makefile.am @@ -23,26 +23,27 @@ sm_notify_LDADD = ../../support/nsm/libnsm.a \ EXTRA_DIST = sim_sm_inter.x $(man8_MANS) simulate.c if CONFIG_RPCGEN -RPCGEN = $(top_builddir)/tools/rpcgen/rpcgen -$(RPCGEN): - make -C ../../tools/rpcgen all +RPCGEN_DEP = $(top_builddir)/tools/rpcgen/rpcgen +$(RPCGEN_DEP): + make -C $(top_srcdir)/tools/rpcgen all +RPCGEN = $(RPCGEN_DEP) -Y $(top_srcdir)/tools/rpcgen else -RPCGEN = @RPCGEN_PATH@ +RPCGEN = @RPCGEN_PATH@ -Y $(top_srcdir)/tools/rpcgen endif -$(GENFILES_CLNT): %_clnt.c: %.x $(RPCGEN) +$(GENFILES_CLNT): %_clnt.c: %.x $(RPCGEN_DEP) test -f $@ && rm -rf $@ || true $(RPCGEN) -l -o $@ $< -$(GENFILES_SVC): %_svc.c: %.x $(RPCGEN) +$(GENFILES_SVC): %_svc.c: %.x $(RPCGEN_DEP) test -f $@ && rm -rf $@ || true $(RPCGEN) -m -o $@ $< -$(GENFILES_XDR): %_xdr.c: %.x $(RPCGEN) +$(GENFILES_XDR): %_xdr.c: %.x $(RPCGEN_DEP) test -f $@ && rm -rf $@ || true $(RPCGEN) -c -o $@ $< -$(GENFILES_H): %.h: %.x $(RPCGEN) +$(GENFILES_H): %.h: %.x $(RPCGEN_DEP) test -f $@ && rm -rf $@ || true $(RPCGEN) -h -o $@ $<