]> git.ipfire.org Git - thirdparty/glibc.git/blame - nscd/Makefile
Update.
[thirdparty/glibc.git] / nscd / Makefile
CommitLineData
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#
22subdir := nscd
23
f7e7a396 24routines := nscd_getpw_r nscd_getgr_r nscd_gethst_r nscd_getai nscd_initgroups
c207f23b 25aux := nscd_helper
d67281a7 26
da2d1bc5
UD
27include ../Makeconfig
28
8802f4bf
UD
29# To find xmalloc.c
30vpath %.c ../locale/programs
31
9afc8a59 32nscd-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 37ifeq ($(have-thread-library),yes)
d67281a7 38
df244a7b 39others := nscd_nischeck
0f124303
UD
40ifneq (yesyes,$(have-fpie)$(build-shared))
41others += nscd
42endif
397d46fd 43install-sbin := nscd nscd_nischeck
d67281a7 44
397d46fd 45extra-objs := $(nscd-modules:=.o) nscd_nischeck.o
d67281a7 46
da2d1bc5
UD
47endif
48
ce85d65b
UD
49ifeq (yes,$(build-static-nss))
50otherlibs += $(nssobjdir)/libnss_files.a $(resolvobjdir)/libnss_dns.a \
51 $(resolvobjdir)/libresolv.a
52endif
53
74a30a58
UD
54ifeq (yes,$(have-selinux))
55nscd-modules += selinux
56selinux-LIBS := -lselinux
57endif
58
4f6bfa80 59distribute := 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
64include ../Rules
65
9b995718
UD
66CFLAGS-nscd_getpw_r.c = -fexceptions
67CFLAGS-nscd_getgr_r.c = -fexceptions
68CFLAGS-nscd_gethst_r.c = -fexceptions
74fef3bb
UD
69CFLAGS-nscd_getai.c = -fexceptions
70CFLAGS-nscd_initgroups.c = -fexceptions
9b995718 71
df244a7b 72ifeq (yesyes,$(have-fpie)$(build-shared))
fc03df7a
UD
73CFLAGS-nscd.c += -fpie
74CFLAGS-connections.c += -fpie
75CFLAGS-pwdcache.c += -fpie
76CFLAGS-getpwnam_r.c += -fpie
77CFLAGS-getpwuid_r.c += -fpie
78CFLAGS-grpcache.c += -fpie
79CFLAGS-getgrnam_r.c += -fpie
80CFLAGS-getgrgid_r.c += -fpie
81CFLAGS-hstcache.c += -fpie
82CFLAGS-gethstbyad_r.c += -fpie
83CFLAGS-gethstbynm2_r.c += -fpie
84CFLAGS-dbg_log.c += -fpie
85CFLAGS-nscd_conf.c += -fpie
86CFLAGS-nscd_stat.c += -fpie
87CFLAGS-cache.c += -fpie
88CFLAGS-xmalloc.c += -fpie
89CFLAGS-xstrdup.c += -fpie
90CFLAGS-mem.c += -fpie
91CFLAGS-nscd_setup_thread.c += -fpie
92CFLAGS-aicache.c += -fpie
93CFLAGS-selinux.c += -fpie
94CFLAGS-initgrcache.c += -fpie
e582c5ed 95CFLAGS-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
105endif
106
0d35c242
RM
107# This makes sure -DNOT_IN_libc is passed for all these modules.
108cpp-srcs-left := $(nscd-modules:=.c)
0a951d0e 109lib := nonlib
0d35c242 110include $(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 115ifeq ($(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 119else
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 123endif