]>
Commit | Line | Data |
---|---|---|
da62f81b | 1 | # Copyright (C) 1998,2000,2002-2009,2011 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 | ||
b21fa963 | 24 | routines := nscd_getpw_r nscd_getgr_r nscd_gethst_r nscd_getai \ |
684ae515 | 25 | nscd_initgroups nscd_getserv_r nscd_netgroup |
c207f23b | 26 | aux := nscd_helper |
d67281a7 | 27 | |
da2d1bc5 UD |
28 | include ../Makeconfig |
29 | ||
8802f4bf UD |
30 | # To find xmalloc.c |
31 | vpath %.c ../locale/programs | |
32 | ||
9afc8a59 | 33 | nscd-modules := nscd connections pwdcache getpwnam_r getpwuid_r grpcache \ |
384ca551 | 34 | getgrnam_r getgrgid_r hstcache gethstbyad_r gethstbynm3_r \ |
b21fa963 | 35 | getsrvbynm_r getsrvbypt_r servicescache \ |
081fc592 | 36 | dbg_log nscd_conf nscd_stat cache mem nscd_setup_thread \ |
684ae515 UD |
37 | xmalloc xstrdup aicache initgrcache gai res_hconf \ |
38 | netgroupcache | |
9afc8a59 | 39 | |
f649c201 | 40 | ifeq ($(have-thread-library),yes) |
d67281a7 | 41 | |
0f124303 | 42 | others += nscd |
da62f81b | 43 | others-pie += nscd |
c7d11829 | 44 | install-sbin := nscd |
d67281a7 | 45 | |
45b96dd6 | 46 | extra-objs = $(nscd-modules:=.o) |
d67281a7 | 47 | |
da2d1bc5 UD |
48 | endif |
49 | ||
ce85d65b UD |
50 | ifeq (yes,$(build-static-nss)) |
51 | otherlibs += $(nssobjdir)/libnss_files.a $(resolvobjdir)/libnss_dns.a \ | |
52 | $(resolvobjdir)/libresolv.a | |
53 | endif | |
54 | ||
c9e16947 | 55 | all-nscd-modules := $(nscd-modules) selinux |
74a30a58 | 56 | ifeq (yes,$(have-selinux)) |
ec23b9be UD |
57 | ifeq (yes,$(have-libaudit)) |
58 | libaudit = -laudit | |
1f063dca UD |
59 | ifeq (yes,$(have-libcap)) |
60 | libcap = -lcap | |
61 | endif | |
ec23b9be UD |
62 | endif |
63 | ||
74a30a58 | 64 | nscd-modules += selinux |
1f063dca | 65 | selinux-LIBS := -lselinux $(libaudit) $(libcap) |
24e86032 | 66 | |
9393da46 UD |
67 | # The configure.in check for libselinux and its headers did not use |
68 | # $SYSINCLUDES. The directory specified by --with-headers usually | |
69 | # contains only the basic kernel interface headers, not something like | |
70 | # libselinux. So the simplest thing is to presume that the standard | |
71 | # system headers will be ok for this file. | |
72 | $(objpfx)nscd_stat.o: sysincludes = # nothing | |
73 | $(objpfx)selinux.o: sysincludes = # nothing | |
729f7b28 RM |
74 | endif |
75 | ||
76 | LDLIBS-nscd = $(selinux-LIBS) | |
9393da46 | 77 | |
4f6bfa80 | 78 | distribute := nscd.h nscd-client.h dbg_log.h \ |
c9e16947 | 79 | $(addsuffix .c, $(filter-out xmalloc,$(all-nscd-modules))) \ |
c7d11829 | 80 | nscd.conf nscd.init nscd_proto.h nscd-types.h |
d67281a7 UD |
81 | |
82 | include ../Rules | |
83 | ||
9b995718 UD |
84 | CFLAGS-nscd_getpw_r.c = -fexceptions |
85 | CFLAGS-nscd_getgr_r.c = -fexceptions | |
86 | CFLAGS-nscd_gethst_r.c = -fexceptions | |
74fef3bb UD |
87 | CFLAGS-nscd_getai.c = -fexceptions |
88 | CFLAGS-nscd_initgroups.c = -fexceptions | |
9b995718 | 89 | |
233399bc | 90 | nscd-cflags = -DIS_IN_nscd=1 -D_FORTIFY_SOURCE=2 |
df244a7b | 91 | ifeq (yesyes,$(have-fpie)$(build-shared)) |
7b91359b | 92 | nscd-cflags += $(pie-ccflag) |
6ab5f50d | 93 | endif |
401a9ec9 UD |
94 | ifeq (yes,$(have-ssp)) |
95 | nscd-cflags += -fstack-protector | |
96 | endif | |
6ab5f50d UD |
97 | |
98 | CFLAGS-nscd.c += $(nscd-cflags) | |
99 | CFLAGS-connections.c += $(nscd-cflags) | |
100 | CFLAGS-pwdcache.c += $(nscd-cflags) | |
101 | CFLAGS-getpwnam_r.c += $(nscd-cflags) | |
102 | CFLAGS-getpwuid_r.c += $(nscd-cflags) | |
103 | CFLAGS-grpcache.c += $(nscd-cflags) | |
104 | CFLAGS-getgrnam_r.c += $(nscd-cflags) | |
105 | CFLAGS-getgrgid_r.c += $(nscd-cflags) | |
106 | CFLAGS-hstcache.c += $(nscd-cflags) | |
107 | CFLAGS-gethstbyad_r.c += $(nscd-cflags) | |
384ca551 | 108 | CFLAGS-gethstbynm3_r.c += $(nscd-cflags) |
6ab5f50d UD |
109 | CFLAGS-dbg_log.c += $(nscd-cflags) |
110 | CFLAGS-nscd_conf.c += $(nscd-cflags) | |
111 | CFLAGS-nscd_stat.c += $(nscd-cflags) | |
112 | CFLAGS-cache.c += $(nscd-cflags) | |
113 | CFLAGS-xmalloc.c += $(nscd-cflags) | |
114 | CFLAGS-xstrdup.c += $(nscd-cflags) | |
115 | CFLAGS-mem.c += $(nscd-cflags) | |
116 | CFLAGS-nscd_setup_thread.c += $(nscd-cflags) | |
117 | CFLAGS-aicache.c += $(nscd-cflags) | |
118 | CFLAGS-selinux.c += $(nscd-cflags) | |
119 | CFLAGS-initgrcache.c += $(nscd-cflags) | |
120 | CFLAGS-gai.c += $(nscd-cflags) | |
b21fa963 UD |
121 | CFLAGS-servicescache.c += $(nscd-cflags) |
122 | CFLAGS-getsrvbynm_r.c += $(nscd-cflags) | |
123 | CFLAGS-getsrvbypt_r.c += $(nscd-cflags) | |
1ce7d80d | 124 | CFLAGS-res_hconf.c += $(nscd-cflags) |
684ae515 | 125 | CFLAGS-netgroupcache.c += $(nscd-cflags) |
6ab5f50d UD |
126 | |
127 | ifeq (yesyes,$(have-fpie)$(build-shared)) | |
da62f81b | 128 | LDFLAGS-nscd = -Wl,-z,now |
df244a7b UD |
129 | endif |
130 | ||
0d35c242 RM |
131 | # This makes sure -DNOT_IN_libc is passed for all these modules. |
132 | cpp-srcs-left := $(nscd-modules:=.c) | |
0a951d0e | 133 | lib := nonlib |
0d35c242 | 134 | include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left)) |
51d46f73 | 135 | |
f649c201 UD |
136 | $(objpfx)nscd: $(nscd-modules:%=$(objpfx)%.o) |
137 | ||
d67281a7 | 138 | ifeq ($(build-shared),yes) |
1945c96f | 139 | $(objpfx)nscd: $(common-objpfx)rt/librt.so $(shared-thread-library) \ |
fe81a1a0 | 140 | $(common-objpfx)nis/libnsl.so |
d67281a7 | 141 | else |
1945c96f | 142 | $(objpfx)nscd: $(common-objpfx)rt/librt.a $(static-thread-library) \ |
fe81a1a0 | 143 | $(common-objpfx)nis/libnsl.a |
d67281a7 | 144 | endif |