(__get_myaddress): Fix test for failing getifaddrs call.
[kopensolaris-gnu/glibc.git] / sunrpc / Makefile
index b7858d6..6431324 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 1994,95,96,97,98,99,2000,2001 Free Software Foundation, Inc.
+# Copyright (C) 1994-2001, 2002, 2003 Free Software Foundation, Inc.
 # This file is part of the GNU C Library.
 
 # The GNU C Library is free software; you can redistribute it and/or
@@ -54,7 +54,8 @@ headers = $(addprefix rpc/,auth.h auth_unix.h clnt.h netdb.h pmap_clnt.h \
          $(rpcsvc:%=rpcsvc/%) rpcsvc/bootparam.h
 install-others = $(inst_sysconfdir)/rpc
 generated = $(rpcsvc:%.x=rpcsvc/%.h) $(rpcsvc:%.x=x%.c) $(rpcsvc:%.x=x%.stmp) \
-           $(rpcsvc:%.x=rpcsvc/%.stmp) rpc-proto.c rpc-proto.d rpcgen
+           $(rpcsvc:%.x=rpcsvc/%.stmp) rpcgen
+generated-dirs := rpcsvc
 
 routines := auth_none auth_unix authuxprot bindrsvprt \
            clnt_gen clnt_perr clnt_raw clnt_simp clnt_tcp \
@@ -84,6 +85,11 @@ all: # Make this the default target; it will be defined in Rules.
 
 include ../Makeconfig
 
+ifeq ($(have-thread-library),yes)
+xtests += thrsvc
+endif
+distribute += thrsvc.c
+
 ifeq (yes,$(build-static-nss))
 otherlibs += $(nssobjdir)/libnss_files.a $(resolvobjdir)/libnss_dns.a \
             $(resolvobjdir)/libresolv.a
@@ -112,6 +118,11 @@ CFLAGS-xspray.c = -Wno-unused
 CFLAGS-xnfs_prot.c = -Wno-unused
 CFLAGS-xrquota.c = -Wno-unused
 CFLAGS-xkey_prot.c = -Wno-unused
+CFLAGS-auth_unix.c = -fexceptions
+CFLAGS-key_call.c = -fexceptions
+CFLAGS-pmap_rmt.c = -fexceptions
+CFLAGS-clnt_perr.c = -fexceptions
+CFLAGS-openchild.c = -fexceptions
 
 ifeq (yes,$(have_doors))
 CPPFLAGS-key_call.c += -DHAVE_DOORS=1
@@ -125,8 +136,13 @@ $(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 := nonlib
+include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
+
 # Tell rpcgen where to find the C preprocessor.
-rpcgen-cmd = $(built-program-cmd) -Y ../scripts
+rpcgen-cmd = CPP='$(CC) -E -x c-header' $(built-program-cmd) -Y ../scripts
 
 # Install the rpc data base file.
 $(inst_sysconfdir)/rpc: etc.rpc $(+force)
@@ -157,24 +173,20 @@ $(objpfx)x%.stmp: rpcsvc/%.x $(objpfx)rpcgen
 # Gratuitous dependency on generated .c file here just gets it mentioned to
 # avoid being an intermediate file and getting removed.
 define o-iterator-doit
-$(rpcsvc:%.x=$(objpfx)x%$o): $(objpfx)x%$o: $(objpfx)x%.c $(objpfx)rpcsvc/%.h \
-                                           $(objpfx)rpc-proto.d
+$(rpcsvc:%.x=$(objpfx)x%$o): $(objpfx)x%$o: $(objpfx)x%.c $(objpfx)rpcsvc/%.h
 endef
 object-suffixes-left = $(filter-out $(librpcsvc-inhibit-o),$(object-suffixes))
 include $(o-iterator)
 
-ifndef no_deps
--include $(objpfx)rpc-proto.d
+rpcsvc-dt-files := $(foreach o,$(filter-out $(librpcsvc-inhibit-o),\
+                                           $(object-suffixes)),\
+                            $(rpcsvc:%.x=$(objpfx)x%$o.dt))
+rpcsvc-depfiles := $(patsubst %.dt,%.d,$(wildcard $(rpcsvc-dt-files))) \
+                  $(wildcard $(rpcsvc-dt-files:.dt=.d))
+ifdef rpcsvc-depfiles
+ifneq ($(no_deps),t)
+-include $(rpcsvc-depfiles)
+endif
 endif
 
-$(objpfx)rpc-proto.d: $(objpfx)%.d: $(objpfx)%.c
-       $(+make-deps)
-# Special file to generate dependencies for the RPC service objects.
-# Collect all include directives from the source files.
-$(objpfx)rpc-proto.c: $(rpcsvc:%=rpcsvc/%)
-       $(make-target-directory)
-       { echo '#include <rpc/types.h>'; \
-         echo '#include <rpc/xdr.h>'; \
-         echo '#include <rpc/rpc.h>'; \
-         sed -n '/^%#include/s/%//p' $^; } > $@T
-       mv -f $@T $@
+$(objpfx)thrsvc: $(shared-thread-library)