On Sat, May 11, 2019 at 01:08:29AM +0200, Christian Weisgerber wrote:
> Here's a draft for CONFIGURE_STYLE=autoreconf.  No man page parts
> yet.
> 
> Basically it works like "autoconf" but calls autoreconf instead.
> There are also example changes to two simple ports in the diff below.
> 
> ajacoutot@ has been approaching this from a slightly different angle:
> He wants to call autogen.sh, so basically AUTORECONF=autogen.sh.
> I'm not sure which name to pick and which tool to default to.

Oh for sure we want to default to 'autoreconf -fi'.
But we need to be able to also set it to autogen.sh if needed. Because sometimes
autoreconf will not work before some other autoshit are run first (or stuff
like gettextize etc.) which autogen.sh takes care of.

> He has also raised two questions:
> * Which autotools dependencies do we want to enable by default?
>   I put autoconf and automake there, but libtoolize (from libtool)
>   is often needed, too.  Sometimes autopoint (from gettext-tools)
>   is required.

As far as I am concerned I don't mind enforcing these build dependencies.

> * Should we set NOCONFIGURE=1 in the environment by default, as
>   many autogen.sh scripts use this in order not to run configure?

I am in favor of this. Otherwise we end up running configure twice...

> Index: infrastructure/mk/bsd.port.mk
> ===================================================================
> RCS file: /cvs/ports/infrastructure/mk/bsd.port.mk,v
> retrieving revision 1.1462
> diff -u -p -r1.1462 bsd.port.mk
> --- infrastructure/mk/bsd.port.mk     4 Apr 2019 02:28:06 -0000       1.1462
> +++ infrastructure/mk/bsd.port.mk     10 May 2019 18:51:46 -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     10 May 2019 22:22:55 -0000
> @@ -15,7 +15,15 @@ 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: Use either 'autoreconf' or 'autoconf'."
> +.endif
> +
> +.if ${CONFIGURE_STYLE:L:Mautoreconf}
> +BUILD_DEPENDS += ${MODGNU_AUTOCONF_DEPENDS} ${MODGNU_AUTOMAKE_DEPENDS}
> +AUTORECONF ?= autoreconf --force --install
> +AUTOCONF_DIR ?= ${WRKSRC}
> +.elif ${CONFIGURE_STYLE:L:Mautoconf}
>  BUILD_DEPENDS += ${MODGNU_AUTOCONF_DEPENDS}
>  AUTOCONF ?= autoconf
>  AUTOHEADER ?= autoheader
> @@ -108,7 +116,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: audio/mp3blaster/Makefile
> ===================================================================
> RCS file: /cvs/ports/audio/mp3blaster/Makefile,v
> retrieving revision 1.27
> diff -u -p -r1.27 Makefile
> --- audio/mp3blaster/Makefile 2 Apr 2019 06:49:47 -0000       1.27
> +++ audio/mp3blaster/Makefile 10 May 2019 19:04:32 -0000
> @@ -25,7 +25,7 @@ LIB_DEPENDS=        audio/libsidplay \
>  
>  AUTOCONF_VERSION=2.61
>  AUTOMAKE_VERSION=1.9
> -CONFIGURE_STYLE=gnu
> +CONFIGURE_STYLE=autoreconf
>  CONFIGURE_ARGS=      --without-esd \
>               --without-oss \
>               --without-sdl \
> @@ -35,8 +35,5 @@ CONFIGURE_ENV+=     ac_cv_lib_ossaudio_main=
>  post-extract:
>       @cp ${FILESDIR}/sndioplayer.cc ${WRKSRC}/mpegsound
>       @cp ${FILESDIR}/sndiomixer.cc ${WRKSRC}/nmixer
> -
> -do-gen:
> -     cd ${WRKSRC}; ${AUTOCONF_ENV} autoreconf -fi
>  
>  .include <bsd.port.mk>
> Index: games/zangband/Makefile
> ===================================================================
> RCS file: /cvs/ports/games/zangband/Makefile,v
> retrieving revision 1.25
> diff -u -p -r1.25 Makefile
> --- games/zangband/Makefile   2 Apr 2019 09:01:55 -0000       1.25
> +++ games/zangband/Makefile   10 May 2019 22:24:03 -0000
> @@ -23,7 +23,8 @@ MAKE_ENV=           CC="${CC}" CFLAGS="${CFLAGS}"
>  
>  AUTOCONF_VERSION=    2.54
>  AUTOMAKE_VERSION=    1.4
> -CONFIGURE_STYLE=     gnu
> +AUTORECONF=          autoreconf -i
> +CONFIGURE_STYLE=     autoreconf
>  CONFIGURE_ENV=               TRUEPREFIX="${TRUEPREFIX}"
>  
>  WRKDIST=             ${WRKDIR}/zangband
> @@ -37,9 +38,6 @@ WANTLIB+=           ICE SM X11 Xaw Xmu Xt xcb
>  .else
>  CONFIGURE_ARGS+=     --without-x
>  .endif
> -
> -do-gen:
> -     @cd ${WRKSRC}; ${AUTOCONF_ENV} autoreconf -i
>  
>  do-install:
>       ${INSTALL_DATA_DIR} ${PREFIX}/share/zangband
> -- 
> Christian "naddy" Weisgerber                          na...@mips.inka.de
> 

-- 
Antoine

Reply via email to