As the final (for now) cleanup of autotools, in order to reduce tree
churn on new versions, a new target has been introduced to allow PLIST_SUB-style patching of files. For example, rather than patching "foo/bar/baz" to tweak some random occurance of an autoconf version number to the latest, the patch should now replace it with %%AUTOCONF_VERSION%% A new Makefile variable, AUTOTOOLSFILES has been introduced, which when populated will automatically go through and patch %%AUTOCONF_VERSION%% to the contents of ${AUTOCONF_VERSION} (and likewise for all other known autotools variables -- "make -V AUTOTOOLS_VARS" to see the list for a specific port. Tested by: pav (-exp run, since it touches bsd.port.mk also)
This commit is contained in:
parent
c54db325a5
commit
55d09a7758
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=266736
1 changed files with 26 additions and 13 deletions
|
@ -49,6 +49,10 @@ Autotools_Include_MAINTAINER= autotools@FreeBSD.org
|
|||
# LIBTOOLFILES=<list-of-files>
|
||||
# - A list of files to patch during libtool pre-configuration
|
||||
#
|
||||
# AUTOTOOLSFILES=<list-of-files>
|
||||
# - A list of files to further patch with derived information
|
||||
# post-patching to reduce churn during component updates
|
||||
#
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
|
@ -319,13 +323,15 @@ ${var:U}_ENV+= ${AUTOTOOLS_VARS}
|
|||
#---------------------------------------------------------------------------
|
||||
|
||||
.if !target(run-autotools)
|
||||
.ORDER: run-autotools run-autotools-aclocal patch-autotools-libtool \
|
||||
run-autotools-autoheader run-autotools-libtoolize \
|
||||
run-autotools-autoconf run-autotools-automake
|
||||
.ORDER: run-autotools run-autotools-aclocal \
|
||||
patch-autotools-libtool run-autotools-autoheader \
|
||||
run-autotools-libtoolize run-autotools-autoconf \
|
||||
run-autotools-automake
|
||||
|
||||
run-autotools:: run-autotools-aclocal patch-autotools-libtool \
|
||||
run-autotools-autoheader run-autotools-libtoolize \
|
||||
run-autotools-autoconf run-autotools-automake
|
||||
run-autotools:: run-autotools-aclocal \
|
||||
patch-autotools-libtool run-autotools-autoheader \
|
||||
run-autotools-libtoolize run-autotools-autoconf \
|
||||
run-autotools-automake
|
||||
.endif
|
||||
|
||||
.if !target(run-autotools-aclocal)
|
||||
|
@ -393,13 +399,20 @@ patch-autotools-libtool::
|
|||
.endif
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# XXX: Placeholder - to be implemented
|
||||
# substitution of, eg: %%AUTOCONF%% with ${AUTOCONF}
|
||||
# to reduce patch churn (patches in files/ will be doing
|
||||
# replacement of specific versions to %%AUTOCONF%% then this
|
||||
# target will handle the rest
|
||||
# Reduce patch churn by auto-substituting data from AUTOTOOLS_VARS
|
||||
# into the correct places. Code shamelessly stolen from PLIST_SUB.
|
||||
|
||||
.if !target(patch-autotools)
|
||||
patch-autotools::
|
||||
AUTOTOOLSFILES?= # default to empty
|
||||
AUTOTOOLS_VARS?= # empty if not already set
|
||||
|
||||
.if !target(configure-autotools)
|
||||
configure-autotools::
|
||||
. if ${AUTOTOOLS_VARS}!="" && ${AUTOTOOLSFILES} != ""
|
||||
@for file in ${AUTOTOOLSFILES}; do \
|
||||
${REINPLACE_CMD} ${AUTOTOOLS_VARS:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \
|
||||
${WRKSRC}/$${file} ; \
|
||||
done
|
||||
. else
|
||||
@${DO_NADA}
|
||||
. endif
|
||||
.endif
|
||||
|
|
Loading…
Reference in a new issue