1 # Copyright (C) 1991,1992,1996-2000,2003,2004,2012
2 # Free Software Foundation, Inc.
3 # This file is part of the GNU C Library.
5 # The GNU C Library is free software; you can redistribute it and/or
6 # modify it under the terms of the GNU Lesser General Public
7 # License as published by the Free Software Foundation; either
8 # version 2.1 of the License, or (at your option) any later version.
10 # The GNU C Library is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 # Lesser General Public License for more details.
15 # You should have received a copy of the GNU Lesser General Public
16 # License along with the GNU C Library; if not, see
17 # <http://www.gnu.org/licenses/>.
20 # Sub-makefile for grp portion of the library.
25 routines := fgetgrent initgroups setgroups \
26 getgrent getgrgid getgrnam putgrent \
27 getgrent_r getgrgid_r getgrnam_r fgetgrent_r
33 ifeq (yes,$(build-shared))
34 test-srcs := tst_fgetgrent
40 ifeq (yes,$(build-static-nss))
41 otherlibs += $(nssobjdir)/libnss_files.a $(resolvobjdir)/libnss_dns.a \
42 $(resolvobjdir)/libresolv.a
46 ifeq ($(have-thread-library),yes)
48 CFLAGS-getgrgid_r.c = -DUSE_NSCD=1 -fexceptions
49 CFLAGS-getgrnam_r.c = -DUSE_NSCD=1 -fexceptions
50 CFLAGS-getgrent_r.c = -fexceptions
51 CFLAGS-getgrent.c = -fexceptions
52 CFLAGS-fgetgrent.c = -fexceptions
53 CFLAGS-fgetgrent_r.c = -fexceptions -D_IO_MTSAFE_IO
54 CFLAGS-putgrent.c = -fexceptions -D_IO_MTSAFE_IO
55 CFLAGS-initgroups.c = -DUSE_NSCD=1 -fexceptions
56 CFLAGS-getgrgid.c = -fexceptions
60 ifeq (no,$(cross-compiling))
61 # tst_fgetgrent currently only works with shared libraries
62 ifeq (yes,$(build-shared))
63 tests: $(objpfx)tst_fgetgrent.out
64 $(objpfx)tst_fgetgrent.out: tst_fgetgrent.sh $(objpfx)tst_fgetgrent
65 $(SHELL) -e tst_fgetgrent.sh $(common-objpfx) $(elf-objpfx) \
66 $(rtld-installed-name)