Bug #687
closedrpcgen should not generate absolute #includes
100%
Description
Every so often (not often enough to remember about this) I move a workspace around, or otherwise build it when its prior location was inaccessible.
It turns out this fails, because libidmap's idmap_xdr.c is generated with an absolute path to idmap_xdr.h within it. It should use workspace-relative paths.
Updated by Rich Lowe over 11 years ago
The problem is anything generated by rpcgen(1).
Updated by Rich Lowe over 11 years ago
- Subject changed from idmap_xdr.c is generated with full workspace paths to rpcgen should not generate absolute #includes
Updated by Gordon Ross over 11 years ago
In the past, I've dealt with this using sed in the Makefile like this:
RPCGENFLAGS = -C -M -i 0
SED_INCL='/^.include/s:\.\..*/rpcsvc:rpcsvc:'
foo_xdr.c : $(FOO_X)
$(RPCGEN) $(RPCGENFLAGS) -c -o $.tmp $(FOO_X)
.tmp > $
sed -e $(SED_INCL) < $
.tmp
$(RM) -f $
Would be nice if rpcgen gave you a little more control instead...
Updated by Gary Mills almost 7 years ago
I tried to reproduce this problem, but was unable to do so. It's true that idmap_xdr.c contains an absolute path to the idmap_prot.h header, but the idmap_xdr.c file is also deleted and recreated at the beginning of every build. This happens because the file is added to the CLOBBERFILES macro in Makefile.com .
I don't see any problem here. It's true that rpcgen could be modified to generate a relative path, but that won't provide an immediate solution because the build uses rpcgen from the build host, not the one from illumos.
Makefile.com could also be modified to produce a relative include path.
What should be fixed here? Maybe the bug report should simply be closed.
Updated by Igor Kozhukhov almost 7 years ago
i have made some change for using rpcgen from workspace(it built with tools) instead of build host.
i have found that if we have updated rpcgen it will be using only after install it to build host - it is a problem.
my changes works such as: build rpcgen with tools or by 'dmake setup' and use it from tools proto instead of build host.
Updated by Gary Mills almost 7 years ago
I'll look after this bug. I have a simple solution that solves the problem.
Updated by Electric Monk almost 7 years ago
- Status changed from New to Closed
- % Done changed from 0 to 100
git commit 77eb9dd4fa1a2a4b00af3d1973a84b60fbf40cdf
commit 77eb9dd4fa1a2a4b00af3d1973a84b60fbf40cdf Author: Gary Mills <gary_mills@fastmail.fm> Date: 2015-07-02T17:53:15.000Z 687 rpcgen should not generate absolute #includes Reviewed by: Marcel Telka <marcel@telka.sk> Approved by: Dan McDonald <danmcd@omniti.com>