Patch ./configure, or use autogen.sh instead?
Jim DeLaHunt
list+macports-dev at jdlh.com
Tue Feb 15 08:28:24 UTC 2022
Hi, folks:
[resend, sent to old domain name at first, sorry]
I am working on a port[1], where I want to patch a couple of autoconf
macros[2] and configure.ac . The unpatched macros give
-Wimplicit-function-declaration errors, but they are easy to fix via
patches. However, I discovered that the ./configure script incorporates
the unpatched behaviour of the macros, so `port configure` still causes
the -Wimplicit-function-declaration errors.
The codebase supplies a script, ./autogen.sh . It runs autoconf,
libtool, etc. etc. and regenerates the ./configure script, incorporating
the fixes from the patched macros. It accepts the same options as
./configure, and passes them on when it calls ./configure .
I see two ways to solve this:
a) tell the Portfile to use ./autogen.sh as the configure command. Let
every user rebuild the ./configure script
b) patch the ./configure script with the same fixes as the autoconf macros.
Doing a) means the port will have build dependencies on autoconf,
automake, etc. etc., and will take longer to run. But will it fail?
Doing b) means I have to patch something which I think perhaps I should
not be patching. I don't see guidance about this, but it feels like a
bad approach.
I think that telling the Portfile to use ./autogen.sh is simply a matter
of these directives:
configure.cmd ./autogen.sh
depends_build port:pkgconfig \
port:autoconf \
port:automake \
port:libtool \
port:m4
Comments? Advice?
--Jim DeLaHunt
[1] Major rewrite of freeciv port, https://trac.macports.org/ticket/62984
[2] https://trac.macports.org/ticket/64551#comment:3
--
. --Jim DeLaHunt, Vancouver, Canada
More information about the macports-dev
mailing list