]>
Commit | Line | Data |
---|---|---|
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 | # | |
22 | subdir := nscd | |
23 | ||
67479a70 | 24 | routines := nscd_getpw_r nscd_getgr_r nscd_gethst_r |
d67281a7 | 25 | |
da2d1bc5 UD |
26 | include ../Makeconfig |
27 | ||
8802f4bf UD |
28 | # To find xmalloc.c |
29 | vpath %.c ../locale/programs | |
30 | ||
9afc8a59 | 31 | nscd-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 | 35 | ifeq ($(have-thread-library),yes) |
d67281a7 | 36 | |
df244a7b | 37 | others := nscd_nischeck |
397d46fd | 38 | install-sbin := nscd nscd_nischeck |
d67281a7 | 39 | |
397d46fd | 40 | extra-objs := $(nscd-modules:=.o) nscd_nischeck.o |
d67281a7 | 41 | |
da2d1bc5 UD |
42 | endif |
43 | ||
ce85d65b UD |
44 | ifeq (yes,$(build-static-nss)) |
45 | otherlibs += $(nssobjdir)/libnss_files.a $(resolvobjdir)/libnss_dns.a \ | |
46 | $(resolvobjdir)/libresolv.a | |
47 | endif | |
48 | ||
4f6bfa80 | 49 | distribute := 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 | |
54 | include ../Rules | |
55 | ||
9b995718 UD |
56 | CFLAGS-nscd_getpw_r.c = -fexceptions |
57 | CFLAGS-nscd_getgr_r.c = -fexceptions | |
58 | CFLAGS-nscd_gethst_r.c = -fexceptions | |
59 | ||
df244a7b UD |
60 | ifeq (yesyes,$(have-fpie)$(build-shared)) |
61 | CFLAGS-nscd.c = -fpie | |
62 | CFLAGS-connections.c = -fpie | |
63 | CFLAGS-pwdcache.c = -fpie | |
64 | CFLAGS-getpwnam_r.c = -fpie | |
65 | CFLAGS-getpwuid_r.c = -fpie | |
66 | CFLAGS-grpcache.c = -fpie | |
67 | CFLAGS-getgrnam_r.c = -fpie | |
68 | CFLAGS-getgrgid_r.c = -fpie | |
69 | CFLAGS-hstcache.c = -fpie | |
70 | CFLAGS-gethstbyad_r.c = -fpie | |
71 | CFLAGS-gethstbynm2_r.c = -fpie | |
72 | CFLAGS-dbg_log.c = -fpie | |
73 | CFLAGS-nscd_conf.c = -fpie | |
74 | CFLAGS-nscd_stat.c = -fpie | |
75 | CFLAGS-cache.c = -fpie | |
76 | CFLAGS-xmalloc.c = -fpie | |
77 | CFLAGS-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 | |
87 | else | |
88 | others += nscd | |
89 | endif | |
90 | ||
0d35c242 RM |
91 | # This makes sure -DNOT_IN_libc is passed for all these modules. |
92 | cpp-srcs-left := $(nscd-modules:=.c) | |
0a951d0e | 93 | lib := nonlib |
0d35c242 | 94 | include $(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 | 99 | ifeq ($(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 | 102 | else |
f649c201 | 103 | $(objpfx)nscd: $(static-thread-library) $(common-objpfx)nis/libnsl.a |
397d46fd | 104 | $(objpfx)nscd_nischeck: $(common-objpfx)nis/libnsl.a |
d67281a7 | 105 | endif |