Building doc when `--disable-asciidoc' is broken on NetBSD. From 398012 in linus/makefile-var-exp:
* doc/Makefile.am: Change $(VAR:MOD) to ${VAR:MOD} -- make(1) onNetBSD substitutes '$(:x)' to 'x' rather than the empty string. Thisbites us in doc/ when configured with `--disable-asciidoc'. Curlybraces should work in all implementations of make(1) but this patchchanges only the places where we use the VAR:MOD expansion.
Looks great, except it's missing a changes file. E.g. a changes/build-on-netbsd which says
o Minor bugfixes:
- Resume building on NetBSD when --disable-asciidoc is chosen during ./configure.
Looks good to me too. The commit message is wonky, though: in Git, the first line of a commit message is supposed to be a short summary of the commit log, so that tools like "git shortlog" will work. Cleaned that up, added a 'changes' file, and merged.
Trac: Resolution: N/Ato fixed Status: needs_review to closed
Replacing parentheses with curly braces didn't really cut it.
What it takes is to change ':=' to '::='.
GNU Make seems happy enough with this but Automake gets annoyed by it and omits a warning for every occurrence in Makefile.am:
asciidoc_files:: non-POSIX variable name
which is a bit misleading since it's not the variable name it's upset about but rather the '::='.
Appending a patch. Let me know if we want this or if we rather should try to find some other way of doing this.
Trac: Status: closed to reopened Resolution: fixed toN/A
It has nothing to do with GNU Make. One could argue that Automake is wrong here but I haven't looked into it. They seem to warn like this when you do non-portable things if I understand things correctly, which might be a hint that this is not a good idea. I have tested with GNU make and BSD make (netbsd) but only with a recent version of each.
Another option, as discussed with Sebastian on #tor-dev the other day, would be to set the makefile variables using this expansion thing within the 'if USE_ASCIIDOC' clause. A bit cludgy, admittedly.
I've pushed the s/:=/::=/ change to my makefile-var-exp in case you'd like to merge. I hope that branch is in proper shape, please tell if it's not. We don't need another changes file, do we?
Hm. With OSX 10.5 [GNU Make 3.81] and this patch, I get the following warnings:
Makefile:556: warning: overriding commands for target `tor'Makefile:546: warning: ignoring old commands for target `tor'Makefile:556: warning: overriding commands for target `tor-gencert'Makefile:546: warning: ignoring old commands for target `tor-gencert'Makefile:556: warning: overriding commands for target `tor-resolve'Makefile:546: warning: ignoring old commands for target `tor-resolve'Makefile:556: warning: overriding commands for target `torify'Makefile:546: warning: ignoring old commands for target `torify'Makefile:566: warning: overriding commands for target `tor'Makefile:556: warning: ignoring old commands for target `tor'Makefile:566: warning: overriding commands for target `tor-gencert'Makefile:556: warning: ignoring old commands for target `tor-gencert'Makefile:566: warning: overriding commands for target `tor-resolve'Makefile:556: warning: ignoring old commands for target `tor-resolve'Makefile:566: warning: overriding commands for target `torify'Makefile:556: warning: ignoring old commands for target `torify'Makefile:565: target `tor' given more than once in the same rule.Makefile:565: target `tor-gencert' given more than once in the same rule.Makefile:565: target `tor-resolve' given more than once in the same rule.Makefile:565: target `torify' given more than once in the same rule.
Yup. When I do autogen.sh, I get
{{{[48]% sh autogen.sh
doc/Makefile.am:22: asciidoc_files:: non-POSIX variable name
doc/Makefile.am:24: asciidoc_files:: non-POSIX variable name
doc/Makefile.am:26: asciidoc_files:: non-POSIX variable name
doc/Makefile.am:31: asciidoc_files:: non-POSIX variable name
doc/Makefile.am:35: asciidoc_files:: non-POSIX variable name
}}}
then I configure, then "cd doc && make" gets me the warnings listed above.
Branch build-wo-asciidoc-on-bsd in my repo reverts the curly braces changes (since they didn't help anyway) and fixes the issue in a less elegant (but more working) way.
Ah, one more use case you need to think about. We want it to be the case that if the distributor has asciidoc they can "make dist", and then the user who gets the tarball can make and install the manpages and documentation without actually having asciidoc themselves. If I'm reading this right, we lose that ability here. True?
Or I could be wrong. Maybe USE_ASCIIDOC is only false when the user has explicitly disabled asciidoc and the scenario I mentioned will still work. Hrmnmnm.