Print this page
687 rpcgen should not generate absolute #includes

@@ -17,10 +17,11 @@
 # information: Portions Copyright [yyyy] [name of copyright owner]
 #
 # CDDL HEADER END
 #
 #
+# Copyright 2015 Gary Mills
 # Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
 #
 #
 
 LIBRARY =       libidmap.a

@@ -54,20 +55,22 @@
 CPPFLAGS +=     -D_REENTRANT -I$(SRCDIR)
 
 CERRWARN +=     -_gcc=-Wno-unused-variable
 CERRWARN +=     -_gcc=-Wno-switch
 
-CLOBBERFILES += idmap_xdr.c
+CLEANFILES +=   idmap_xdr.c
 
 lint := OBJECTS = $(LINT_OBJECTS)
 
 .KEEP_STATE:
 
 all: $(LIBS)
 
+# Replace absolute include path with a relative path
 idmap_xdr.c:    $(IDMAP_PROT_X)
-        $(RM) $@; $(RPCGEN) -CMNc -o $@ $(IDMAP_PROT_X)
+        $(RPCGEN) -CMNc $(IDMAP_PROT_X) | \
+        $(SED) '/^#include.*idmap_prot.h/s|"[^"]*"|<rpcsvc/idmap_prot.h>|' > $@
 
 lint: lintcheck
 
 LINTFLAGS += -erroff=E_CONSTANT_CONDITION
 LINTFLAGS64 += -erroff=E_CONSTANT_CONDITION