about summary refs log tree commit diff
path: root/sunrpc/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'sunrpc/Makefile')
-rw-r--r--sunrpc/Makefile6
1 files changed, 5 insertions, 1 deletions
diff --git a/sunrpc/Makefile b/sunrpc/Makefile
index f2c31c73a0..f80b190d14 100644
--- a/sunrpc/Makefile
+++ b/sunrpc/Makefile
@@ -122,7 +122,6 @@ ifeq (yes,$(have_doors))
 CPPFLAGS-key_call.c += -DHAVE_DOORS=1
 endif
 CPPFLAGS += -D_RPC_THREAD_SAFE_
-CPPFLAGS-rpc_main += -DNOT_IN_libc
 
 include ../Rules
 
@@ -131,6 +130,11 @@ $(objpfx)rpcgen: $(addprefix $(objpfx),$(rpcgen-objs)) \
   $(addprefix $(csu-objpfx),start.o) $(+preinit) $(+postinit)
 	$(+link)
 
+# This makes sure -DNOT_IN_libc is passed for all these modules.
+cpp-srcs-left := $(rpcgen-objs:.o=.c)
+lib := rpcgen
+include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
+
 # Tell rpcgen where to find the C preprocessor.
 rpcgen-cmd = CPP='$(CC) -E -x c-header' $(built-program-cmd) -Y ../scripts