On Wednesday 2021-04-21 04:17, Duncan Roe wrote: >> >+if test -z "$DOXYGEN"; then >> >> If you use AS_IF above, you could also make use of it here :) > >Happy to do that, but could you spell out the actual line please? My grasp of m4 >is tenuous at best - I only copy stuff that I see working elsewhere. AS_IF([test -z "$DOXYGEN], [what if true], [what if false]) > >In this case I copied Florian Westphal's code from 3622e606. >> >> >+# move it out of the way and symlink the real one while we run doxygen. >> >+ cd ..; [ $$(ls src | wc -l) -gt 8 ] ||\ >> >> This looks like it could break anytime (say, when it happens to get to 9 >> files). Can't it test for a specific filename or set of names? > >OK I can test for existence of Makefile.in. >> >> >+ function main { set -e; cd man/man3; rm -f _*;\ >> >> The syntax for POSIX sh-compatible functions should be >> >> main() { ... > >Rats! I had it that way, but the old fixmanpages.sh had 'function' so I changed >it to minimise the diff. Will change back to POSIX way in v2. The old fixmanpages.sh had #!/bin/bash, which forced bash, but such guarantee does not exist for the Makefile at this point (and the change to POSIX sh is nonintrusive anyway). >> >+function setgroup { mv $$1.3 $$2.3; BASE=$$2; };\ >> >+function add2group { for i in $$@; do ln -sf $$BASE.3 $$i.3; done; };\ >> >> Should be quoted, i.e. "$$@". Might as well do it for the other vars. > >"Should be"? We're dealing with man page names. If unquoted $$@ fails, we've got >other problems. Yeah, make does not lend itself well to filenames with spaces I guess.