summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Hardeman <david@hardeman.nu>2014-12-08 11:18:32 -0500
committerSteve Dickson <steved@redhat.com>2014-12-08 11:18:32 -0500
commite48c7e878f1ada4603fe7a144c20643ce705b9f2 (patch)
treee8dd11b6918d63fa231c572822028fe7f4cfaf2c
parenta66af8a4b35a0dee81cd47dbc7d25f4694447ffb (diff)
downloadnfs-utils-e48c7e878f1ada4603fe7a144c20643ce705b9f2.tar.gz
nfs-utils-e48c7e878f1ada4603fe7a144c20643ce705b9f2.tar.xz
nfs-utils-e48c7e878f1ada4603fe7a144c20643ce705b9f2.zip
rpcgen: change internal rpcgen to support separate builddir
rpcgen uses absolute paths (based on the input) when generating the output files, thus breaking builds using a separate build directory. Signed-off-by: David Hardeman <david@hardeman.nu> Signed-off-by: Steve Dickson <steved@redhat.com>
-rw-r--r--tools/rpcgen/rpc_main.c7
1 files 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");