Linux NFS development
 help / color / mirror / Atom feed
From: "David Härdeman" <david@hardeman.nu>
To: linux-nfs@vger.kernel.org
Subject: [PATCH 2/3] [RFC] nfs-utils: change internal rpcgen to support separate builddir
Date: Tue, 02 Dec 2014 13:39:59 +0100	[thread overview]
Message-ID: <20141202123959.13015.26461.stgit@zeus.muc.hardeman.nu> (raw)
In-Reply-To: <20141202123805.13015.25151.stgit@zeus.muc.hardeman.nu>

rpcgen uses absolute paths (based on the input) when generating the
output files, thus breaking builds using a separate build directory.
I'm not sure this is the best (or even an acceptable) approach, but
it works for me...consider it an RFC :)
---
 tools/rpcgen/rpc_main.c |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/tools/rpcgen/rpc_main.c b/tools/rpcgen/rpc_main.c
index 28aa60c..f81da47 100644
--- a/tools/rpcgen/rpc_main.c
+++ b/tools/rpcgen/rpc_main.c
@@ -44,6 +44,7 @@ static char sccsid[] = "@(#)rpc_main.c 1.30 89/03/30 (C) 1987 SMI";
 #include <unistd.h>
 #include <ctype.h>
 #include <errno.h>
+#include <libgen.h>
 #include "rpc_parse.h"
 #include "rpc_util.h"
 #include "rpc_scan.h"
@@ -389,7 +390,7 @@ c_output(char *infile, char *define, int extend, char *outfile)
 	open_output(infile, outfilename);
 	add_warning();
 	if (infile && (include = extendfile(infile, ".h"))) {
-		f_print(fout, "#include \"%s\"\n", include);
+		f_print(fout, "#include \"%s\"\n", basename(include));
 		free(include);
 		/* .h file already contains rpc/rpc.h */
 	} else
@@ -523,7 +524,7 @@ s_output(int argc, char **argv, char *infile, char *define, int extend,
 	open_output(infile, outfilename);
 	add_warning();
 	if (infile && (include = extendfile(infile, ".h"))) {
-		f_print(fout, "#include \"%s\"\n", include);
+		f_print(fout, "#include \"%s\"\n", basename(include));
 		free(include);
 	} else
 	  f_print(fout, "#include <rpc/rpc.h>\n");
@@ -630,7 +631,7 @@ l_output(char *infile, char *define, int extend, char *outfile)
 	if (Cflag)
 	  f_print (fout, "#include <memory.h> /* for memset */\n");
 	if (infile && (include = extendfile(infile, ".h"))) {
-		f_print(fout, "#include \"%s\"\n", include);
+		f_print(fout, "#include \"%s\"\n", basename(include));
 		free(include);
 	} else
 	  f_print(fout, "#include <rpc/rpc.h>\n");


  parent reply	other threads:[~2014-12-02 12:47 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-02 12:39 [PATCH 0/3] nfs-utils build fixes David Härdeman
2014-12-02 12:39 ` [PATCH 1/3] nfs-utils: fix gssd build flags David Härdeman
2014-12-08 17:33   ` Steve Dickson
2014-12-02 12:39 ` David Härdeman [this message]
2014-12-08 17:36   ` [PATCH 2/3] [RFC] nfs-utils: change internal rpcgen to support separate builddir Steve Dickson
2014-12-02 12:40 ` [PATCH 3/3] [RFC] nfs-utils: include headers from srcdir David Härdeman
2014-12-08 18:04   ` Steve Dickson
2014-12-08 20:45     ` David Härdeman

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=20141202123959.13015.26461.stgit@zeus.muc.hardeman.nu \
    --to=david@hardeman.nu \
    --cc=linux-nfs@vger.kernel.org \
    /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