--- eglibc-2_9/sunrpc/Makefile.org 2011-02-08 01:02:15.000000000 +0100 +++ eglibc-2_9/sunrpc/Makefile 2011-02-08 01:21:03.000000000 +0100 @@ -138,6 +138,22 @@ include ../Rules +OS?= $(shell uname) +ifeq ($(OS),Darwin) +CROSSRPCLDFLAGS=-L/opt/local/lib -lintl +endif +ifneq (,$(findstring Windows_NT,$(OS))) +# cygwin! +CROSSRPCLDFLAGS=-L/usr/lib -lintl +endif +ifneq (,$(findstring CYGWIN_NT,$(OS))) +# cygwin! +CROSSRPCLDFLAGS=-L/usr/lib -lintl +endif +ifeq ($(OS),FreeBSD) +CROSSRPCLDFLAGS=-L/usr/local/lib -lintl +endif + $(objpfx)rpcgen: $(addprefix $(objpfx),$(rpcgen-objs)) \ $(sort $(filter $(common-objpfx)libc%,$(link-libc))) \ $(addprefix $(csu-objpfx),start.o) $(+preinit) $(+postinit) @@ -148,7 +156,7 @@ $(OUTPUT_OPTION) $(compile-mkdep-flags) $(objpfx)cross-rpcgen: $(addprefix $(objpfx)cross-,$(rpcgen-objs)) - gcc $^ -o $@ + gcc $^ $(CROSSRPCLDFLAGS) -o $@ # This makes sure -DNOT_IN_libc is passed for all these modules. cpp-srcs-left := $(rpcgen-objs:.o=.c)