Marc Espie:

> All in all, it looks like the patch is in good shape.
> 
> There's another important thing to do, which is to
> actually document it.
> 
> I'd like a patch to bsd.port.mk(5)

I have attached an updated version of the infrastructure/mk diff,
incorporating the feedback, as well as a man page diff.

-- 
Christian "naddy" Weisgerber                          [email protected]
Index: infrastructure/mk/bsd.port.mk
===================================================================
RCS file: /cvs/ports/infrastructure/mk/bsd.port.mk,v
retrieving revision 1.1465
diff -u -p -r1.1465 bsd.port.mk
--- infrastructure/mk/bsd.port.mk	12 May 2019 07:46:35 -0000	1.1465
+++ infrastructure/mk/bsd.port.mk	12 May 2019 14:54:13 -0000
@@ -280,7 +280,7 @@ _ARCH_DEFINES_INCLUDED = Done
 .  include "${PORTSDIR}/infrastructure/mk/arch-defines.mk"
 .endif
 
-.if ${CONFIGURE_STYLE:L:Mautoconf}
+.if ${CONFIGURE_STYLE:L:Mautoconf} || ${CONFIGURE_STYLE:L:Mautoreconf}
 .  if !${CONFIGURE_STYLE:L:Mgnu}
 CONFIGURE_STYLE += gnu
 .  endif
Index: infrastructure/mk/gnu.port.mk
===================================================================
RCS file: /cvs/ports/infrastructure/mk/gnu.port.mk,v
retrieving revision 1.60
diff -u -p -r1.60 gnu.port.mk
--- infrastructure/mk/gnu.port.mk	4 Apr 2019 02:28:06 -0000	1.60
+++ infrastructure/mk/gnu.port.mk	12 May 2019 22:10:38 -0000
@@ -15,7 +15,19 @@ AUTOCONF_VERSION ?= 2.13
 AUTOCONF_ENV = PATH=${PORTPATH} AUTOCONF_VERSION=${AUTOCONF_VERSION} AUTOMAKE_VERSION=${AUTOMAKE_VERSION}
 MAKE_ENV += AUTOMAKE_VERSION=${AUTOMAKE_VERSION} AUTOCONF_VERSION=${AUTOCONF_VERSION}
 
-.if ${CONFIGURE_STYLE:L:Mautoconf}
+.if ${CONFIGURE_STYLE:L:Mautoreconf} && ${CONFIGURE_STYLE:L:Mautoconf}
+ERRORS += "Fatal: Choose either 'autoreconf' or 'autoconf'."
+.endif
+
+.if ${CONFIGURE_STYLE:L:Mautoreconf}
+BUILD_DEPENDS += ${MODGNU_AUTOCONF_DEPENDS}
+BUILD_DEPENDS += ${MODGNU_AUTOMAKE_DEPENDS}
+BUILD_DEPENDS += devel/libtool
+AUTORECONF ?= autoreconf --force --install
+AUTOCONF_DIR ?= ${WRKSRC}
+# in case autoreconf is replaced by autogen.sh
+AUTOCONF_ENV += NOCONFIGURE=1
+.elif ${CONFIGURE_STYLE:L:Mautoconf}
 BUILD_DEPENDS += ${MODGNU_AUTOCONF_DEPENDS}
 AUTOCONF ?= autoconf
 AUTOHEADER ?= autoheader
@@ -108,7 +120,10 @@ _MODGNU_loop =
 
 PATCH_CHECK_ONLY ?= No
 .if ${PATCH_CHECK_ONLY:L} != "yes"
-.  if ${CONFIGURE_STYLE:L:Mautoconf}
+.  if ${CONFIGURE_STYLE:L:Mautoreconf}
+_MODGNU_loop += echo "Running autoreconf-${AUTOCONF_VERSION} in $$d";
+_MODGNU_loop += ${SETENV} ${AUTOCONF_ENV} ${AUTORECONF};
+.  elif ${CONFIGURE_STYLE:L:Mautoconf}
 _MODGNU_loop += if test -f $$d/configure; then \
 	grep -iq 'Generated by.*autoconf.*${AUTOCONF_VERSION}' $$d/configure || { \
 	echo ">>> Can't find autoconf ${AUTOCONF_VERSION} signature in $$d/configure:"; \
Index: share/man/man5/bsd.port.mk.5
===================================================================
RCS file: /cvs/src/share/man/man5/bsd.port.mk.5,v
retrieving revision 1.508
diff -u -p -r1.508 bsd.port.mk.5
--- share/man/man5/bsd.port.mk.5	4 Apr 2019 02:28:23 -0000	1.508
+++ share/man/man5/bsd.port.mk.5	13 May 2019 02:12:49 -0000
@@ -377,7 +377,7 @@ requirements.
 .It Cm gen
 Generate configure script when needed, either after patching
 input files, or from scratch for some ports,
-generally using automake, autoconf, autogen and similar gnu tools.
+generally using automake, autoconf, autoreconf and similar GNU tools.
 This target only has modules
 .Po Ev MODxxx_gen Pc
 and a
@@ -914,14 +914,18 @@ Current machine architecture.
 Read-only.
 .It Ev AUTOCONF
 Location of the autoconf binary if needed.
-Defaults to autoconf (though autoreconf might be more appropriate).
+Defaults to autoconf.
 .It Ev AUTOCONF_DIR
-Where to invoke autoconf if ${CONFIGURE_STYLE} includes autoconf.
+Where to invoke autoconf or autoreconf if ${CONFIGURE_STYLE} includes
+.Sq autoconf
+or
+.Sq autoreconf ,
+respectively.
 Defaults to ${WRKSRC}.
 .\" AUTOCONF_DIR should probably be a list, and be renamed to AUTOCONF_DIRS ?
 .It Ev AUTOCONF_ENV
-Environment values that should be passed to all runs of autoconf, automake
-and related tools.
+Environment values that should be passed to all runs of autoconf, automake,
+autoreconf and related tools.
 Specifically, version numbers and PATH.
 Automatically set as soon as
 .Ev CONFIGURE_STYLE
@@ -951,6 +955,12 @@ Several versions of automake may coexist
 .Ev AUTOMAKE_VERSION
 must be set before trying to run automake.
 Defaults to 1.4.
+.It Ev AUTORECONF
+Location of the autoreconf binary and the arguments it is invoked with.
+Can be set to
+.Sq autogen.sh 
+if such a script is available.
+Defaults to autoreconf --force --install.
 .It Ev BASE_PKGPATH
 Full
 .Xr pkgpath 7
@@ -1444,6 +1454,10 @@ if autoconf needs to be rerun first,
 but set
 .Sq no-autoheader
 to prevent autoheader from running.
+Alternatively, add
+.Sq autoreconf
+to rerun autoconf, automake, and related tools to completely regenerate
+the GNU build framework.
 .Pp
 If
 .Sq imake ,

Reply via email to