]> git.ipfire.org Git - thirdparty/glibc.git/blame - nscd/Makefile
Update copyright dates with scripts/update-copyrights.
[thirdparty/glibc.git] / nscd / Makefile
CommitLineData
04277e02 1# Copyright (C) 1998-2019 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#
21subdir := nscd
22
3cc3ef96
RM
23include ../Makeconfig
24
25ifneq ($(use-nscd),no)
b21fa963 26routines := nscd_getpw_r nscd_getgr_r nscd_gethst_r nscd_getai \
684ae515 27 nscd_initgroups nscd_getserv_r nscd_netgroup
67f36c79 28aux := nscd_helper
3cc3ef96 29endif
da2d1bc5 30
8802f4bf
UD
31# To find xmalloc.c
32vpath %.c ../locale/programs
33
9afc8a59 34nscd-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 38 xmalloc xstrdup aicache initgrcache gai res_hconf \
67f36c79 39 netgroupcache
9afc8a59 40
c53d909c 41ifeq ($(build-nscd)$(have-thread-library),yesyes)
d67281a7 42
0f124303 43others += nscd
da62f81b 44others-pie += nscd
c7d11829 45install-sbin := nscd
d67281a7 46
45b96dd6 47extra-objs = $(nscd-modules:=.o)
d67281a7 48
da2d1bc5
UD
49endif
50
c9e16947 51all-nscd-modules := $(nscd-modules) selinux
74a30a58 52ifeq (yes,$(have-selinux))
ec23b9be
UD
53ifeq (yes,$(have-libaudit))
54libaudit = -laudit
1f063dca
UD
55ifeq (yes,$(have-libcap))
56libcap = -lcap
57endif
ec23b9be
UD
58endif
59
74a30a58 60nscd-modules += selinux
1f063dca 61selinux-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
70endif
71
72LDLIBS-nscd = $(selinux-LIBS)
9393da46 73
d67281a7
UD
74include ../Rules
75
36975e8e
L
76CFLAGS-nscd_getpw_r.c += -fexceptions
77CFLAGS-nscd_getgr_r.c += -fexceptions
78CFLAGS-nscd_gethst_r.c += -fexceptions
79CFLAGS-nscd_getai.c += -fexceptions
80CFLAGS-nscd_initgroups.c += -fexceptions
9b995718 81
4f41c682 82CPPFLAGS-nscd += -D_FORTIFY_SOURCE=2
fc997c6e 83
df244a7b 84ifeq (yesyes,$(have-fpie)$(build-shared))
9cd47470 85CFLAGS-nscd += $(pie-ccflag)
6ab5f50d
UD
86endif
87
6ab5f50d 88ifeq (yesyes,$(have-fpie)$(build-shared))
da62f81b 89LDFLAGS-nscd = -Wl,-z,now
df244a7b
UD
90endif
91
9cd47470
SP
92# Set libof-nscd.
93cpp-srcs-left := $(nscd-modules)
94lib := nscd
2bfdaedd 95include $(patsubst %,$(..)libof-iterator.mk,$(cpp-srcs-left))
51d46f73 96
f649c201
UD
97$(objpfx)nscd: $(nscd-modules:%=$(objpfx)%.o)
98
d67281a7 99ifeq ($(build-shared),yes)
2faa42da 100$(objpfx)nscd: $(shared-thread-library)
d67281a7 101else
2faa42da 102$(objpfx)nscd: $(static-thread-library)
d67281a7 103endif