]> git.ipfire.org Git - thirdparty/glibc.git/blame - nscd/Makefile
Update.
[thirdparty/glibc.git] / nscd / Makefile
CommitLineData
a12ce44f 1# Copyright (C) 1998, 2000, 2002, 2003 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
67479a70 24routines := nscd_getpw_r nscd_getgr_r nscd_gethst_r
d67281a7 25
da2d1bc5
UD
26include ../Makeconfig
27
8802f4bf
UD
28# To find xmalloc.c
29vpath %.c ../locale/programs
30
9afc8a59 31nscd-modules := nscd connections pwdcache getpwnam_r getpwuid_r grpcache \
67479a70 32 getgrnam_r getgrgid_r hstcache gethstbyad_r gethstbynm2_r \
a12ce44f 33 dbg_log nscd_conf nscd_stat cache xmalloc xstrdup
9afc8a59 34
f649c201 35ifeq ($(have-thread-library),yes)
d67281a7 36
df244a7b 37others := nscd_nischeck
397d46fd 38install-sbin := nscd nscd_nischeck
d67281a7 39
397d46fd 40extra-objs := $(nscd-modules:=.o) nscd_nischeck.o
d67281a7 41
da2d1bc5
UD
42endif
43
ce85d65b
UD
44ifeq (yes,$(build-static-nss))
45otherlibs += $(nssobjdir)/libnss_files.a $(resolvobjdir)/libnss_dns.a \
46 $(resolvobjdir)/libresolv.a
47endif
48
4f6bfa80 49distribute := nscd.h nscd-client.h dbg_log.h \
fbee8a1e
UD
50 $(addsuffix .c, $(filter-out xmalloc, $(nscd-modules))) \
51 nscd_nischeck.c TODO nscd.conf nscd.init nscd_proto.h \
52 nscd-types.h
d67281a7
UD
53
54include ../Rules
55
9b995718
UD
56CFLAGS-nscd_getpw_r.c = -fexceptions
57CFLAGS-nscd_getgr_r.c = -fexceptions
58CFLAGS-nscd_gethst_r.c = -fexceptions
59
df244a7b
UD
60ifeq (yesyes,$(have-fpie)$(build-shared))
61CFLAGS-nscd.c = -fpie
62CFLAGS-connections.c = -fpie
63CFLAGS-pwdcache.c = -fpie
64CFLAGS-getpwnam_r.c = -fpie
65CFLAGS-getpwuid_r.c = -fpie
66CFLAGS-grpcache.c = -fpie
67CFLAGS-getgrnam_r.c = -fpie
68CFLAGS-getgrgid_r.c = -fpie
69CFLAGS-hstcache.c = -fpie
70CFLAGS-gethstbyad_r.c = -fpie
71CFLAGS-gethstbynm2_r.c = -fpie
72CFLAGS-dbg_log.c = -fpie
73CFLAGS-nscd_conf.c = -fpie
74CFLAGS-nscd_stat.c = -fpie
75CFLAGS-cache.c = -fpie
76CFLAGS-xmalloc.c = -fpie
77CFLAGS-xstrdup.c = -fpie
78
79$(objpfx)nscd: $(addprefix $(objpfx),$(nscd-modules:=.o))
80 $(LINK.o) -pie -Wl,-O1 \
81 $(sysdep-LDFLAGS) $(config-LDFLAGS) \
82 $(extra-B-$(@F:lib%.so=%).so) -B$(csu-objpfx) \
83 $(extra-B-$(@F:lib%.so=%).so) $(load-map-file) \
84 $(LDFLAGS) $(LDFLAGS-$(@F)) \
85 -L$(subst :, -L,$(rpath-link)) -Wl,-rpath-link=$(rpath-link) \
86 -o $@ $^ $(common-objpfx)libc_nonshared.a
87else
88others += nscd
89endif
90
0d35c242
RM
91# This makes sure -DNOT_IN_libc is passed for all these modules.
92cpp-srcs-left := $(nscd-modules:=.c)
0a951d0e 93lib := nonlib
0d35c242 94include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
51d46f73 95
f649c201 96$(objpfx)nscd: $(nscd-modules:%=$(objpfx)%.o)
397d46fd 97$(objpfx)nscd_nischeck: $(objpfx)nscd_nischeck.o
f649c201 98
d67281a7 99ifeq ($(build-shared),yes)
f649c201 100$(objpfx)nscd: $(shared-thread-library) $(common-objpfx)nis/libnsl.so
397d46fd 101$(objpfx)nscd_nischeck: $(common-objpfx)nis/libnsl.so
d67281a7 102else
f649c201 103$(objpfx)nscd: $(static-thread-library) $(common-objpfx)nis/libnsl.a
397d46fd 104$(objpfx)nscd_nischeck: $(common-objpfx)nis/libnsl.a
d67281a7 105endif