]> git.ipfire.org Git - thirdparty/glibc.git/blame - nscd/Makefile
Use <> for include of kernel-features.h.
[thirdparty/glibc.git] / nscd / Makefile
CommitLineData
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#
22subdir := nscd
23
b21fa963 24routines := nscd_getpw_r nscd_getgr_r nscd_gethst_r nscd_getai \
684ae515 25 nscd_initgroups nscd_getserv_r nscd_netgroup
c207f23b 26aux := nscd_helper
d67281a7 27
da2d1bc5
UD
28include ../Makeconfig
29
8802f4bf
UD
30# To find xmalloc.c
31vpath %.c ../locale/programs
32
9afc8a59 33nscd-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 40ifeq ($(have-thread-library),yes)
d67281a7 41
0f124303 42others += nscd
da62f81b 43others-pie += nscd
c7d11829 44install-sbin := nscd
d67281a7 45
45b96dd6 46extra-objs = $(nscd-modules:=.o)
d67281a7 47
da2d1bc5
UD
48endif
49
ce85d65b
UD
50ifeq (yes,$(build-static-nss))
51otherlibs += $(nssobjdir)/libnss_files.a $(resolvobjdir)/libnss_dns.a \
52 $(resolvobjdir)/libresolv.a
53endif
54
c9e16947 55all-nscd-modules := $(nscd-modules) selinux
74a30a58 56ifeq (yes,$(have-selinux))
ec23b9be
UD
57ifeq (yes,$(have-libaudit))
58libaudit = -laudit
1f063dca
UD
59ifeq (yes,$(have-libcap))
60libcap = -lcap
61endif
ec23b9be
UD
62endif
63
74a30a58 64nscd-modules += selinux
1f063dca 65selinux-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
74endif
75
76LDLIBS-nscd = $(selinux-LIBS)
9393da46 77
4f6bfa80 78distribute := 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
82include ../Rules
83
9b995718
UD
84CFLAGS-nscd_getpw_r.c = -fexceptions
85CFLAGS-nscd_getgr_r.c = -fexceptions
86CFLAGS-nscd_gethst_r.c = -fexceptions
74fef3bb
UD
87CFLAGS-nscd_getai.c = -fexceptions
88CFLAGS-nscd_initgroups.c = -fexceptions
9b995718 89
233399bc 90nscd-cflags = -DIS_IN_nscd=1 -D_FORTIFY_SOURCE=2
df244a7b 91ifeq (yesyes,$(have-fpie)$(build-shared))
7b91359b 92nscd-cflags += $(pie-ccflag)
6ab5f50d 93endif
401a9ec9
UD
94ifeq (yes,$(have-ssp))
95nscd-cflags += -fstack-protector
96endif
6ab5f50d
UD
97
98CFLAGS-nscd.c += $(nscd-cflags)
99CFLAGS-connections.c += $(nscd-cflags)
100CFLAGS-pwdcache.c += $(nscd-cflags)
101CFLAGS-getpwnam_r.c += $(nscd-cflags)
102CFLAGS-getpwuid_r.c += $(nscd-cflags)
103CFLAGS-grpcache.c += $(nscd-cflags)
104CFLAGS-getgrnam_r.c += $(nscd-cflags)
105CFLAGS-getgrgid_r.c += $(nscd-cflags)
106CFLAGS-hstcache.c += $(nscd-cflags)
107CFLAGS-gethstbyad_r.c += $(nscd-cflags)
384ca551 108CFLAGS-gethstbynm3_r.c += $(nscd-cflags)
6ab5f50d
UD
109CFLAGS-dbg_log.c += $(nscd-cflags)
110CFLAGS-nscd_conf.c += $(nscd-cflags)
111CFLAGS-nscd_stat.c += $(nscd-cflags)
112CFLAGS-cache.c += $(nscd-cflags)
113CFLAGS-xmalloc.c += $(nscd-cflags)
114CFLAGS-xstrdup.c += $(nscd-cflags)
115CFLAGS-mem.c += $(nscd-cflags)
116CFLAGS-nscd_setup_thread.c += $(nscd-cflags)
117CFLAGS-aicache.c += $(nscd-cflags)
118CFLAGS-selinux.c += $(nscd-cflags)
119CFLAGS-initgrcache.c += $(nscd-cflags)
120CFLAGS-gai.c += $(nscd-cflags)
b21fa963
UD
121CFLAGS-servicescache.c += $(nscd-cflags)
122CFLAGS-getsrvbynm_r.c += $(nscd-cflags)
123CFLAGS-getsrvbypt_r.c += $(nscd-cflags)
1ce7d80d 124CFLAGS-res_hconf.c += $(nscd-cflags)
684ae515 125CFLAGS-netgroupcache.c += $(nscd-cflags)
6ab5f50d
UD
126
127ifeq (yesyes,$(have-fpie)$(build-shared))
da62f81b 128LDFLAGS-nscd = -Wl,-z,now
df244a7b
UD
129endif
130
0d35c242
RM
131# This makes sure -DNOT_IN_libc is passed for all these modules.
132cpp-srcs-left := $(nscd-modules:=.c)
0a951d0e 133lib := nonlib
0d35c242 134include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
51d46f73 135
f649c201
UD
136$(objpfx)nscd: $(nscd-modules:%=$(objpfx)%.o)
137
d67281a7 138ifeq ($(build-shared),yes)
1945c96f 139$(objpfx)nscd: $(common-objpfx)rt/librt.so $(shared-thread-library) \
fe81a1a0 140 $(common-objpfx)nis/libnsl.so
d67281a7 141else
1945c96f 142$(objpfx)nscd: $(common-objpfx)rt/librt.a $(static-thread-library) \
fe81a1a0 143 $(common-objpfx)nis/libnsl.a
d67281a7 144endif