[prev in list] [next in list] [prev in thread] [next in thread] 

List:       macports-dev
Subject:    Re: Patch ./configure, or use autogen.sh instead?
From:       Ryan Schmidt <ryandesign () macports ! org>
Date:       2022-02-21 23:21:03
Message-ID: E08FF1A8-1FD7-4A6A-AA9C-153C5E0E89C4 () macports ! org
[Download RAW message or body]



On Feb 21, 2022, at 16:32, Jim DeLaHunt wrote:

> But I also thought, why not also patch the m4 macros which generate the configure \
> script? It keeps the codebase on the user's machine consistent. It keeps the \
> patches in the MacPorts repository. What harm could it do? 
> I'm glad you asked that!  It turns out that this codebase's Makefile includes rules \
> to rerun aclocal, autoconf, and automake if any of the m4 macro files are newer \
> than aclocal.m4, or configure, or config.status, or a few other files.  When the \
> Portfile patches these m4 scripts, it updates their modification times to the \
> present, which is newer than aclocal.m4.  Thus at build time, the Makefile attempts \
> to perform the configuration phase all over again. port -t (trace mode) exposes \
> that this adds dependencies on those autotools.
> 
> I worked around this by adding a post-patch clause which used the
> "touch -r" macro to reset the modification times of the files I patched to be the \
> same an an unpatched macro file. This keeps the Makefile happy. 
> It might turn out to be smarter to remove the patches and the touches of those \
> macro files. It makes for a simpler Portfile. I have not decided.

It's not just this codebase that does that; it's a feature of autotools. That's one \
of the reasons why I said to decide whether to patch the generated files or the files \
they're generated from, not both.=


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic