]>
Commit | Line | Data |
---|---|---|
a95a08b4 | 1 | # Copyright (C) 1998, 2000, 2002, 2003, 2004 Free Software Foundation, Inc. |
d67281a7 UD |
2 | # This file is part of the GNU C Library. |
3 | ||
4 | # The GNU C Library is free software; you can redistribute it and/or | |
41bdb6e2 AJ |
5 | # modify it under the terms of the GNU Lesser General Public |
6 | # License as published by the Free Software Foundation; either | |
7 | # version 2.1 of the License, or (at your option) any later version. | |
d67281a7 UD |
8 | |
9 | # The GNU C Library is distributed in the hope that it will be useful, | |
10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
41bdb6e2 | 12 | # Lesser General Public License for more details. |
d67281a7 | 13 | |
41bdb6e2 AJ |
14 | # You should have received a copy of the GNU Lesser General Public |
15 | # License along with the GNU C Library; if not, write to the Free | |
16 | # Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA | |
17 | # 02111-1307 USA. | |
d67281a7 UD |
18 | |
19 | # | |
20 | # Sub-makefile for nscd portion of the library. | |
21 | # | |
22 | subdir := nscd | |
23 | ||
f7e7a396 | 24 | routines := nscd_getpw_r nscd_getgr_r nscd_gethst_r nscd_getai nscd_initgroups |
c207f23b | 25 | aux := nscd_helper |
d67281a7 | 26 | |
da2d1bc5 UD |
27 | include ../Makeconfig |
28 | ||
8802f4bf UD |
29 | # To find xmalloc.c |
30 | vpath %.c ../locale/programs | |
31 | ||
9afc8a59 | 32 | nscd-modules := nscd connections pwdcache getpwnam_r getpwuid_r grpcache \ |
67479a70 | 33 | getgrnam_r getgrgid_r hstcache gethstbyad_r gethstbynm2_r \ |
081fc592 | 34 | dbg_log nscd_conf nscd_stat cache mem nscd_setup_thread \ |
91a3b2ad | 35 | xmalloc xstrdup aicache initgrcache gai |
9afc8a59 | 36 | |
f649c201 | 37 | ifeq ($(have-thread-library),yes) |
d67281a7 | 38 | |
df244a7b | 39 | others := nscd_nischeck |
0f124303 UD |
40 | ifneq (yesyes,$(have-fpie)$(build-shared)) |
41 | others += nscd | |
42 | endif | |
397d46fd | 43 | install-sbin := nscd nscd_nischeck |
d67281a7 | 44 | |
397d46fd | 45 | extra-objs := $(nscd-modules:=.o) nscd_nischeck.o |
d67281a7 | 46 | |
da2d1bc5 UD |
47 | endif |
48 | ||
ce85d65b UD |
49 | ifeq (yes,$(build-static-nss)) |
50 | otherlibs += $(nssobjdir)/libnss_files.a $(resolvobjdir)/libnss_dns.a \ | |
51 | $(resolvobjdir)/libresolv.a | |
52 | endif | |
53 | ||
74a30a58 UD |
54 | ifeq (yes,$(have-selinux)) |
55 | nscd-modules += selinux | |
56 | selinux-LIBS := -lselinux | |
57 | endif | |
58 | ||
4f6bfa80 | 59 | distribute := nscd.h nscd-client.h dbg_log.h \ |
fbee8a1e UD |
60 | $(addsuffix .c, $(filter-out xmalloc, $(nscd-modules))) \ |
61 | nscd_nischeck.c TODO nscd.conf nscd.init nscd_proto.h \ | |
62 | nscd-types.h | |
d67281a7 UD |
63 | |
64 | include ../Rules | |
65 | ||
9b995718 UD |
66 | CFLAGS-nscd_getpw_r.c = -fexceptions |
67 | CFLAGS-nscd_getgr_r.c = -fexceptions | |
68 | CFLAGS-nscd_gethst_r.c = -fexceptions | |
74fef3bb UD |
69 | CFLAGS-nscd_getai.c = -fexceptions |
70 | CFLAGS-nscd_initgroups.c = -fexceptions | |
9b995718 | 71 | |
df244a7b | 72 | ifeq (yesyes,$(have-fpie)$(build-shared)) |
fc03df7a UD |
73 | CFLAGS-nscd.c += -fpie |
74 | CFLAGS-connections.c += -fpie | |
75 | CFLAGS-pwdcache.c += -fpie | |
76 | CFLAGS-getpwnam_r.c += -fpie | |
77 | CFLAGS-getpwuid_r.c += -fpie | |
78 | CFLAGS-grpcache.c += -fpie | |
79 | CFLAGS-getgrnam_r.c += -fpie | |
80 | CFLAGS-getgrgid_r.c += -fpie | |
81 | CFLAGS-hstcache.c += -fpie | |
82 | CFLAGS-gethstbyad_r.c += -fpie | |
83 | CFLAGS-gethstbynm2_r.c += -fpie | |
84 | CFLAGS-dbg_log.c += -fpie | |
85 | CFLAGS-nscd_conf.c += -fpie | |
86 | CFLAGS-nscd_stat.c += -fpie | |
87 | CFLAGS-cache.c += -fpie | |
88 | CFLAGS-xmalloc.c += -fpie | |
89 | CFLAGS-xstrdup.c += -fpie | |
90 | CFLAGS-mem.c += -fpie | |
91 | CFLAGS-nscd_setup_thread.c += -fpie | |
92 | CFLAGS-aicache.c += -fpie | |
93 | CFLAGS-selinux.c += -fpie | |
94 | CFLAGS-initgrcache.c += -fpie | |
e582c5ed | 95 | CFLAGS-gai.c += -fpie |
df244a7b UD |
96 | |
97 | $(objpfx)nscd: $(addprefix $(objpfx),$(nscd-modules:=.o)) | |
98 | $(LINK.o) -pie -Wl,-O1 \ | |
99 | $(sysdep-LDFLAGS) $(config-LDFLAGS) \ | |
100 | $(extra-B-$(@F:lib%.so=%).so) -B$(csu-objpfx) \ | |
101 | $(extra-B-$(@F:lib%.so=%).so) $(load-map-file) \ | |
102 | $(LDFLAGS) $(LDFLAGS-$(@F)) \ | |
103 | -L$(subst :, -L,$(rpath-link)) -Wl,-rpath-link=$(rpath-link) \ | |
74a30a58 | 104 | -o $@ $^ $(selinux-LIBS) $(common-objpfx)libc_nonshared.a |
df244a7b UD |
105 | endif |
106 | ||
0d35c242 RM |
107 | # This makes sure -DNOT_IN_libc is passed for all these modules. |
108 | cpp-srcs-left := $(nscd-modules:=.c) | |
0a951d0e | 109 | lib := nonlib |
0d35c242 | 110 | include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left)) |
51d46f73 | 111 | |
f649c201 | 112 | $(objpfx)nscd: $(nscd-modules:%=$(objpfx)%.o) |
397d46fd | 113 | $(objpfx)nscd_nischeck: $(objpfx)nscd_nischeck.o |
f649c201 | 114 | |
d67281a7 | 115 | ifeq ($(build-shared),yes) |
1945c96f UD |
116 | $(objpfx)nscd: $(common-objpfx)rt/librt.so $(shared-thread-library) \ |
117 | $(common-objpfx)nis/libnsl.so | |
397d46fd | 118 | $(objpfx)nscd_nischeck: $(common-objpfx)nis/libnsl.so |
d67281a7 | 119 | else |
1945c96f UD |
120 | $(objpfx)nscd: $(common-objpfx)rt/librt.a $(static-thread-library) \ |
121 | $(common-objpfx)nis/libnsl.a | |
397d46fd | 122 | $(objpfx)nscd_nischeck: $(common-objpfx)nis/libnsl.a |
d67281a7 | 123 | endif |