* Makefile.am: Use ln rather than $(LN_S) for hardlinks.
* configure.ac: Accept --enable-single-binary=hardlinks.
* man/local.mk: In hardlink mode, explicitly add the
hardlink creation rule to mandeps. Given the automake
generated dependency chain, this ensures that the hardlinks
are created _after_ the multicall binary, with `make all`
or `make check` etc.
* src/local.mk: Define the new src/coreutils_hardlinks rule,
and only depend on src/coreutils_{symlinks,shebangs} if
in those modes, so that hardlinks are created _after_
the multicall binary, and other link types before.
* NEWS: Mention the new feature.
Addresses https://github.com/coreutils/coreutils/issues/129
test $$p = x && continue; \
ptrans=$$(printf '%s' "$$p" | sed -e "$(transform)"); \
rm -f $(DESTDIR)$(bindir)/$$ptrans$(EXEEXT) || exit $$?; \
- if test "x$(single_binary_install_type)" = xshebangs; then \
+ if test "$(single_binary_install_type)" = shebangs; then \
printf '#!%s --coreutils-prog-shebang=%s\n' \
$(bindir)/$$ctrans$(EXEEXT) $$p \
>$(DESTDIR)$(bindir)/$$ptrans$(EXEEXT) || exit $$?; \
chmod a+x,a-w $(DESTDIR)$(bindir)/$$ptrans$(EXEEXT) || exit $$?;\
+ elif test "$(single_binary_install_type)" = hardlinks; then \
+ ln $(DESTDIR)$(bindir)/$$ctrans$(EXEEXT) \
+ $(DESTDIR)$(bindir)/$$ptrans$(EXEEXT) || exit $$?; \
else \
$(LN_S) -s $$ctrans$(EXEEXT) \
$(DESTDIR)$(bindir)/$$ptrans$(EXEEXT) || exit $$?; \
** New Features
+ configure accepts a new --enable-single-binary=hardlinks mode to build the
+ selected programs as hard links to a multi-call binary called "coreutils".
+ This augments the existing "symlinks" and "shebangs" modes already
+ supported by the --enable-single-binary option.
+
'tail' now accepts the --debug option, which is currently used to
detail the --follow implementation being used.
)
AC_ARG_ENABLE([single-binary],
- [AS_HELP_STRING([--enable-single-binary=[shebangs|symlinks]],
+ [AS_HELP_STRING([--enable-single-binary=[shebangs|symlinks|hardlinks]],
[Compile all the tools in a single binary, reducing the overall size.
- When compiled this way, shebangs (default when enabled) or symlinks are
- installed for each tool that points to the single binary.])],
+ When compiled this way, shebangs (default when enabled), symlinks, or
+ hardlinks are installed for each tool, which point to a single binary])],
[gl_single_binary=no ;
case $enableval in
yes) gl_single_binary=shebangs ;;
- no|shebangs|symlinks) gl_single_binary=$enableval ;;
+ no|shebangs|symlinks|hardlinks) gl_single_binary=$enableval ;;
*) AC_MSG_ERROR([bad value $enableval for single-binary option.
- Options are: symlinks, shebangs, no.]) ;;
+ Options are: hardlinks, symlinks, shebangs, no.]) ;;
esac],
[gl_single_binary=no]
)
[gl_single_binary_exceptions=$enableval],
[gl_single_binary_exceptions=]
)
-if test "$gl_single_binary" = 'symlinks'; then
+if test "$gl_single_binary" = 'symlinks' ||
+ test "$gl_single_binary" = 'hardlinks'; then
if ! test "`echo ls | sed \"$program_transform_name\"`" = 'ls'; then
AC_MSG_ERROR([program name transformations are not currently supported
- with --enable-single-binary=symlinks.])
+ with --enable-single-binary=$gl_single_binary.])
fi
fi
AM_CONDITIONAL([SINGLE_BINARY], [test "$gl_single_binary" != no])
+AM_CONDITIONAL([SINGLE_BINARY_HARD], [test "$gl_single_binary" == hardlinks])
AC_ARG_ENABLE([bold-man-page-references],
[AS_HELP_STRING([--disable-bold-man-page-references],
$(ALL_MANS): $(mandeps)
if SINGLE_BINARY
+if SINGLE_BINARY_HARD
+mandeps += src/coreutils_hardlinks
+else
mandeps += src/coreutils$(EXEEXT)
+endif
else
# Most prog.1 man pages depend on src/prog. List the exceptions:
man/install.1: src/ginstall$(EXEEXT)
include $(top_srcdir)/src/single-binary.mk
-# Creates symlinks or shebangs to the installed programs when building
-# coreutils single binary.
+# Creates symlinks, or shebangs to the installed programs
+# _before_ building coreutils single binary.
+if !SINGLE_BINARY_HARD
EXTRA_src_coreutils_DEPENDENCIES += src/coreutils_$(single_binary_install_type)
+endif
endif SINGLE_BINARY
+# Creates hardlinks _after_ building the coreutils single binary.
+CLEANFILES += src/coreutils_hardlinks
+src/coreutils_hardlinks: src/coreutils$(EXEEXT)
+ $(AM_V_GEN)touch $@
+ $(AM_V_at)for i in x $(single_binary_progs); do \
+ test $$i = x && continue; \
+ rm -f src/$$i$(EXEEXT) || exit $$?; \
+ ln src/coreutils$(EXEEXT) src/$$i$(EXEEXT) || exit $$?; \
+ done
+
CLEANFILES += src/coreutils_symlinks
src/coreutils_symlinks: Makefile
$(AM_V_GEN)touch $@