about summary refs log tree commit diff
path: root/grp/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'grp/Makefile')
-rw-r--r--grp/Makefile23
1 files changed, 22 insertions, 1 deletions
diff --git a/grp/Makefile b/grp/Makefile
index 5ca4953177..c4274ed531 100644
--- a/grp/Makefile
+++ b/grp/Makefile
@@ -22,11 +22,20 @@
 subdir	:= grp
 headers := grp.h
 
+distribute := tst_fgetgrent.c tst_fgetgrent.sh
+
 routines := fgetgrent initgroups setgroups \
 	    getgrent getgrgid getgrnam putgrent \
 	    getgrent_r getgrgid_r getgrnam_r fgetgrent_r
 
-tests := testgrp tst_fgetgrent
+include ../Makeconfig
+
+tests := testgrp
+
+ifeq (yes,$(build-shared))
+test-srcs :=  tst_fgetgrent
+endif
+
 
 include ../Rules
 
@@ -42,3 +51,15 @@ CFLAGS-getgrgid_r.c = -DUSE_NSCD=1
 CFLAGS-getgrnam_r.c = -DUSE_NSCD=1
 
 endif
+
+ifeq (no,$(cross-compiling))
+# tst_fgetgrent currently only works with shared libraries
+ifeq (yes,$(build-shared))
+.PHONY: do-tst-fgetgrent
+tests: do-tst-fgetgrent
+do-tst-fgetgrent: $(objpfx)tst_fgetgrent
+	$(SHELL) -e tst_fgetgrent.sh $(common-objpfx) $(elf-objpfx) \
+		 $(rtld-installed-name)
+
+endif
+endif