build: Fix make dist with newer Automake.
* qt/Makefile.am: Make sure .moc files are only built if needed. * tqt/Makefile.am: Likewise.
With Automake 1.16 and newer, source files listed in BUILT_SOURCES
are unconditionally built upon calling make dist, even if those
files are also listed in a nodist_*_SOURCES variable.
This causes an issue with the Qt pinentry: if pinentry-qt has not
been configured (either because Qt was not found or because the user
explicitly disabled it), make dist will nonetheless attempt to
build the .moc files, which will fail due to the MOC variable
being undefined in the generated Makefile. Likewise for the TQt
pinentry.
As a result, make dist will fail on any machine where Qt and TQt
are absent.
The workaround is to declare the .moc files in the BUILT_SOURCES
variable only if we are actually building the corresponding Qt or
TQt pinentry.
- Signed-off-by: Damien Goutte-Gattat <dgouttegattat@incenp.org>