This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Build rpcgen with standard build rules
On Fri, 9 Mar 2012, Roland McGrath wrote:
> I kind of think it's better to leave the Sun source file with its original
> name. You could just as well have an empty rpcgen.c, or one that does
> #include "rpc_main.c" and remove rpc_main.o from rpcgen-objs.
I'm testing this patch implementing the empty file approach.
2012-03-09 Joseph Myers <joseph@codesourcery.com>
* sunrpc/Makefile (others): Add rpcgen.
($(objpfx)rpcgen): Remove special build rule and dependency on
libc.
* sunrpc/rpcgen.c: New file.
diff --git a/sunrpc/Makefile b/sunrpc/Makefile
index 329d3f3..e0339ad 100644
--- a/sunrpc/Makefile
+++ b/sunrpc/Makefile
@@ -86,6 +86,7 @@ rpcgen-objs = rpc_main.o rpc_hout.o rpc_cout.o rpc_parse.o \
rpc_scan.o rpc_util.o rpc_svcout.o rpc_clntout.o \
rpc_tblout.o rpc_sample.o
extra-objs = $(rpcgen-objs)
+others += rpcgen
all: # Make this the default target; it will be defined in Rules.
@@ -149,10 +150,7 @@ $(objpfx)tst-getmyaddr: $(common-objpfx)linkobj/libc.so
$(objpfx)tst-xdrmem: $(common-objpfx)linkobj/libc.so
$(objpfx)tst-xdrmem2: $(common-objpfx)linkobj/libc.so
-$(objpfx)rpcgen: $(addprefix $(objpfx),$(rpcgen-objs)) \
- $(sort $(filter $(common-objpfx)libc%,$(link-libc))) \
- $(addprefix $(csu-objpfx),start.o) $(+preinit) $(+postinit)
- $(+link)
+$(objpfx)rpcgen: $(addprefix $(objpfx),$(rpcgen-objs))
# This makes sure -DNOT_IN_libc is passed for all these modules.
cpp-srcs-left := $(rpcgen-objs:.o=.c)
diff --git a/sunrpc/rpcgen.c b/sunrpc/rpcgen.c
new file mode 100644
index 0000000..1b455ba
--- /dev/null
+++ b/sunrpc/rpcgen.c
@@ -0,0 +1,2 @@
+/* Empty file expected by glibc's standard build rules for
+ executables. */
--
Joseph S. Myers
joseph@codesourcery.com