summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2007-11-16 11:03:03 +0100
committerJim Meyering <meyering@redhat.com>2007-11-16 11:03:03 +0100
commit1379ed974f1fa39b12e2ffab18b3f7a607082202 (patch)
treebe28e87d7d142430b8bdc1f079946674a1e6f832 /src
parentf77576a775f483c61adda2732ded9a76be9c0230 (diff)
downloadcoreutils-1379ed974f1fa39b12e2ffab18b3f7a607082202.tar.xz
Port to Solaris 'make' and use a Posixish shell on Solaris.
* bootstrap.conf (gnulib_modules): Add gnu-make, posix-shell. * build-aux/check.mk (SHELL): Set to $(PREFERABLY_POSIX_SHELL), so that commands can assume Posix syntax. (ENABLE_HARD_ERRORS, TEST_LOGS): Don't use GNU Make's "?=" syntax. (SH_E_WORKAROUND): New macro. (am__check_pre, $(TEST_SUITE_LOG)): Use it. (am__check_pre): Fail if "mkdir" fails. Use $(SHELL) rather than relying on the "#!/bin/sh" in the file, so that tests can use Posix syntax. (am__check_pre, am__tty_colors): Use $$src rather than $$<, to support the Posix-make $(TEST_LOGS) rule. (%.log: %.test, %.log: %$(EXEEXT)): Remove unused inference rules that rely on a GNU Make extension and cause Solaris 'make' to fail. (SUFFIXES): New macro, so that we can use Posix style inference rules. (%.log: %): Use this rule only if GNU_MAKE. Set $$src so that macros can use $$src rather than $$<. (CHECK-FORCE, DEPENDENCY, $(TEST_LOGS)): New macros and rules, which rely only on Posix 'make' semantics, and are used only with non-GNU 'make' implementations. $(TEST_LOGS) invokes 'make' recursively (and a bit inefficiently) to simulate the GNU 'make' rules. (.log.html): Renamed from "%.html: %.log", so that it relies only on Posix 'make' semantics. (check-clean, .PHONY): Do not depend on check-clean-local, since Solaris 'make' complains about nonexistent rules like that. * src/Makefile.am (SUFFIXES): Remove; no longer needed. (groups): Use a specific rule rather than an inference rule that is only instantiated once. The inference-rule approach does not work with Solaris 'make', which gets confused by the "groups: Makefile" line. It's not clear from the Posix spec that Solaris 'make' is buggy here, so instead of worrying about it, rewrite the makefile so that it clearly conforms to Posix. * tests/check.mk (TESTS_ENVIRONMENT): Export PACKAGE_BUGREPORT. GNU 'make' does this automatically for us, but Solaris 'make' doesn't. 2007-11-15 Paul Eggert <eggert@cs.ucla.edu>
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.am11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index bc67ff2b8..49979fd08 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -137,25 +137,22 @@ stat_LDADD = $(LDADD) $(LIB_SELINUX)
$(PROGRAMS): ../lib/libcoreutils.a
-SUFFIXES = .sh
-
# Get the release year from ../lib/version-etc.c.
RELEASE_YEAR = \
`sed -n '/.*COPYRIGHT_YEAR = \([0-9][0-9][0-9][0-9]\) };/s//\1/p' \
$(top_srcdir)/lib/version-etc.c`
-# Ensure that version changes (reflected in Makefile's VERSION definition)
+# This depends on 'Makefile', so that version changes
+#(reflected in Makefile's VERSION definition)
# are reflected into groups --version also between releases.
-groups: Makefile
-
-.sh:
+groups: groups.sh Makefile
rm -f $@ $@-t
sed \
-e 's!@''bindir''@!$(bindir)!' \
-e 's/@''RELEASE_YEAR'@/$(RELEASE_YEAR)/ \
-e 's/@''PACKAGE_NAME''@/$(PACKAGE_NAME)/' \
-e 's/@''PACKAGE_BUGREPORT''@/$(PACKAGE_BUGREPORT)/' \
- -e 's/@''VERSION''@/$(VERSION)/' $< > $@-t
+ -e 's/@''VERSION''@/$(VERSION)/' $(srcdir)/groups.sh > $@-t
chmod +x $@-t
mv $@-t $@