make check depends programs that have been configured with --with-= being set up so that a executable exists in the compat/ directory that causes quilt to invoke the desired binary. Makefile.in | 24 +++++++++++++++++++++++- 1 files changed, 23 insertions(+), 1 deletion(-) Index: quilt/Makefile.in =================================================================== --- quilt.orig/Makefile.in 2006-01-15 12:30:17.307805000 +1100 +++ quilt/Makefile.in 2006-01-15 14:35:10.880228228 +1100 @@ -117,7 +117,10 @@ #----------------------------------------------------------------------- -all : scripts compat-programs $(if $(MSGFMT),$(LINGUAS:%=po/%.mo)) +all : scripts \ + compat-programs \ + $(COMPAT_SYMLINKS:%=compat/%) \ + $(if $(MSGFMT),$(LINGUAS:%=po/%.mo)) $(LIB:%=lib/%) : $(LIB_SRC:%.c=lib/%.o) $(CC) -o $@ $(LDFLAGS) $^ $(LIBS) @@ -287,6 +290,28 @@ endif endif +# VIRTUAL_SYMLINKS creates a shell script that operates similar to +# a symbolic link. It is used to workaround the way make treats +# symlinks as targets. +# Usage: $(call VIRTUAL_SYMLINK, source, target) +define VIRTUAL_SYMLINK + @echo "Generating $(strip $(1)) wrapper" >&2 + @printf "#!%s\n%s "'"$$$$@"'"\n" $(BASH) $(strip $(1)) > $(2) +endef + +# Generate rules to create compat/ for each binary in $(COMPAT_SYMLINKS) +define COMPAT_SYMLINK_local_install +compat/$(strip $(1)) : Makefile + $(call VIRTUAL_SYMLINK, \ + '$($(shell echo $(1) | $(AWK) '{print toupper($$1)}'))', \ + compat/$(strip $(1))) + @chmod +x compat/$(strip $(1)) + +endef + +$(eval $(foreach symlink,$(COMPAT_SYMLINKS),$(call COMPAT_SYMLINK_local_install, $(symlink)))) + +# Generate rules to install symlinks for each binary in $(COMPAT_SYMLINKS) define COMPAT_SYMLINK_install install-compat-symlink-$(strip $(1)): install-compat ln -sf $($(shell echo $(1) | $(AWK) '{print toupper($$1)}')) \