Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: PATCHv2: Allow parallel make



Jun T wrote on Sun, 04 Oct 2026 18:12 +00:00:
> The following seems to work (patch over PATCHv2, without 55190).
> What is the simplest way to add this dependency only if building on
> Cygwin?

Add to Src/Makefile.in the line «@EXTRA_DEPENDENCIES_OF_modules@»
next to one of the existing «modules: …» lines, and have configure.ac
set ${EXTRA_DEPENDENCIES_OF_modules} either to the empty string or to
«modules: $(LIBZSH)» and AC_SUBST() it?

Alternatively, it looks like AC_CONFIG_FILES() has an optional second
argument for running additional code; proof of concept:

[[[
--- configure.ac
+++ configure.ac
@@ -3068,7 +3068,9 @@ AC_SUBST_FILE(DEFS_MK)dnl
 AC_SUBST_FILE(VERSION_MK)dnl

 AC_CONFIG_FILES(Config/defs.mk Makefile Doc/Makefile Etc/Makefile \
-Src/Makefile Test/Makefile)
+Test/Makefile)
+AC_CONFIG_FILES(Src/Makefile, [if uname -so | grep -qi linux; then echo '# yes'; else echo '# no'; fi >> Src/Makefile])
+
 AC_CONFIG_COMMANDS([config.modules], [. ./config.modules.sh])
 AC_CONFIG_COMMANDS([stamp-h], [echo >stamp-h])
]]]

I haven't checked whether this would require us to bump our autoconf
version requirement.

In any case, should the condition be literally "if building on Cygwin",
or is there some behaviour or limitation of the Cygwin compiler/linker/etc
that can be tested for?  (e.g., by trying to compile/link a test program)

Cheers,

Daniel

>
> diff --git a/Src/Makefile.in b/Src/Makefile.in
> index 7fc0b364d..755a911a0 100644
> --- a/Src/Makefile.in
> +++ b/Src/Makefile.in
> @@ -88,6 +88,8 @@ $(LIBZSH): $(LIBOBJS) $(NSTMP)
>  	rm -f $@
>  	$(DLLINK) $(LIBOBJS) $(NLIST) $(LIBS)
> 
> +modules: $(LIBZSH)
> +
>  zsh.res.o: $(sdir)/zsh.rc $(sdir)/zsh.ico
>  	windres -O coff --include-dir $(sdir) -i $(sdir)/zsh.rc -o zsh.res.o




Messages sorted by: Reverse Date, Date, Thread, Author