]>
Commit | Line | Data |
---|---|---|
f7a9f785 | 1 | # Copyright (C) 1998-2016 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 | 14 | # You should have received a copy of the GNU Lesser General Public |
59ba27a6 PE |
15 | # License along with the GNU C Library; if not, see |
16 | # <http://www.gnu.org/licenses/>. | |
d67281a7 UD |
17 | |
18 | # | |
19 | # Sub-makefile for nscd portion of the library. | |
20 | # | |
21 | subdir := nscd | |
22 | ||
3cc3ef96 RM |
23 | include ../Makeconfig |
24 | ||
25 | ifneq ($(use-nscd),no) | |
b21fa963 | 26 | routines := nscd_getpw_r nscd_getgr_r nscd_gethst_r nscd_getai \ |
684ae515 | 27 | nscd_initgroups nscd_getserv_r nscd_netgroup |
c207f23b | 28 | aux := nscd_helper |
3cc3ef96 | 29 | endif |
da2d1bc5 | 30 | |
8802f4bf UD |
31 | # To find xmalloc.c |
32 | vpath %.c ../locale/programs | |
33 | ||
9afc8a59 | 34 | nscd-modules := nscd connections pwdcache getpwnam_r getpwuid_r grpcache \ |
384ca551 | 35 | getgrnam_r getgrgid_r hstcache gethstbyad_r gethstbynm3_r \ |
b21fa963 | 36 | getsrvbynm_r getsrvbypt_r servicescache \ |
081fc592 | 37 | dbg_log nscd_conf nscd_stat cache mem nscd_setup_thread \ |
684ae515 UD |
38 | xmalloc xstrdup aicache initgrcache gai res_hconf \ |
39 | netgroupcache | |
9afc8a59 | 40 | |
c53d909c | 41 | ifeq ($(build-nscd)$(have-thread-library),yesyes) |
d67281a7 | 42 | |
0f124303 | 43 | others += nscd |
da62f81b | 44 | others-pie += nscd |
c7d11829 | 45 | install-sbin := nscd |
d67281a7 | 46 | |
45b96dd6 | 47 | extra-objs = $(nscd-modules:=.o) |
d67281a7 | 48 | |
da2d1bc5 UD |
49 | endif |
50 | ||
c9e16947 | 51 | all-nscd-modules := $(nscd-modules) selinux |
74a30a58 | 52 | ifeq (yes,$(have-selinux)) |
ec23b9be UD |
53 | ifeq (yes,$(have-libaudit)) |
54 | libaudit = -laudit | |
1f063dca UD |
55 | ifeq (yes,$(have-libcap)) |
56 | libcap = -lcap | |
57 | endif | |
ec23b9be UD |
58 | endif |
59 | ||
74a30a58 | 60 | nscd-modules += selinux |
1f063dca | 61 | selinux-LIBS := -lselinux $(libaudit) $(libcap) |
24e86032 | 62 | |
cb8a6dbd | 63 | # The configure.ac check for libselinux and its headers did not use |
9393da46 UD |
64 | # $SYSINCLUDES. The directory specified by --with-headers usually |
65 | # contains only the basic kernel interface headers, not something like | |
66 | # libselinux. So the simplest thing is to presume that the standard | |
67 | # system headers will be ok for this file. | |
68 | $(objpfx)nscd_stat.o: sysincludes = # nothing | |
69 | $(objpfx)selinux.o: sysincludes = # nothing | |
729f7b28 RM |
70 | endif |
71 | ||
72 | LDLIBS-nscd = $(selinux-LIBS) | |
9393da46 | 73 | |
d67281a7 UD |
74 | include ../Rules |
75 | ||
9b995718 UD |
76 | CFLAGS-nscd_getpw_r.c = -fexceptions |
77 | CFLAGS-nscd_getgr_r.c = -fexceptions | |
78 | CFLAGS-nscd_gethst_r.c = -fexceptions | |
74fef3bb UD |
79 | CFLAGS-nscd_getai.c = -fexceptions |
80 | CFLAGS-nscd_initgroups.c = -fexceptions | |
9b995718 | 81 | |
4f41c682 | 82 | CPPFLAGS-nscd += -D_FORTIFY_SOURCE=2 |
fc997c6e | 83 | |
df244a7b | 84 | ifeq (yesyes,$(have-fpie)$(build-shared)) |
9cd47470 | 85 | CFLAGS-nscd += $(pie-ccflag) |
6ab5f50d UD |
86 | endif |
87 | ||
6ab5f50d | 88 | ifeq (yesyes,$(have-fpie)$(build-shared)) |
da62f81b | 89 | LDFLAGS-nscd = -Wl,-z,now |
df244a7b UD |
90 | endif |
91 | ||
9cd47470 SP |
92 | # Set libof-nscd. |
93 | cpp-srcs-left := $(nscd-modules) | |
94 | lib := nscd | |
0d35c242 | 95 | include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left)) |
51d46f73 | 96 | |
f649c201 UD |
97 | $(objpfx)nscd: $(nscd-modules:%=$(objpfx)%.o) |
98 | ||
d67281a7 | 99 | ifeq ($(build-shared),yes) |
6e6249d0 | 100 | $(objpfx)nscd: $(shared-thread-library) $(common-objpfx)nis/libnsl.so |
d67281a7 | 101 | else |
6e6249d0 | 102 | $(objpfx)nscd: $(static-thread-library) $(common-objpfx)nis/libnsl.a |
d67281a7 | 103 | endif |