tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: patching Makefile.am: autoreconf or more patches?



On Fri, Oct 11, 2019 at 05:01:06PM +0100, Jonathan Perkin wrote:
 > > While working on collectd (pkgsrc-ing more plugins) I noticed that 
 > > Makefile.common contains a pre-configure target running autoreconf, 
 > > presumably because there's a patch to Makefile.ac.
 > > 
 > > Since running autoreconf is rather expensive, wouldn't it be prefrerrable 
 > > to include patches for the generated files (whatever they are) instead?
 > > Or is this deemed to error-prone in case the patch to Makefile.ac is 
 > > altered?
 > 
 > It depends on the complexity of the patch.  Patching the generated
 > files is preferable and should be used for the majority of cases, but
 > occasionally a large number of changes are required to multiple files,
 > and in those cases it's simpler to patch a few lines of m4 and
 > regenerate, especially when it comes to updating the package.

Also it depends on what the patch is trying to do. Sometimes patching
the autoconf or automake output lets you work around issues that would
require fire and brimstone to deal with in the input files; and
sometimes it is by far simpler to add a couple things to the input
files and let autoconf spew 5000 extra lines into the output.

Sometimes also people patch both files in the hopes that if one of the
above scenarios develops in future less additional work will be
needed, or in the hopes of upstreaming the changes.

In any event it's important to document what's going on in the patch
headers so that the next person touching the package doesn't blunder.

-- 
David A. Holland
dholland%netbsd.org@localhost


Home | Main Index | Thread Index | Old Index