diff options
-rw-r--r-- | Mk/bsd.autotools.mk | 440 |
1 files changed, 256 insertions, 184 deletions
diff --git a/Mk/bsd.autotools.mk b/Mk/bsd.autotools.mk index 20daa8684f83..a04fa48c618f 100644 --- a/Mk/bsd.autotools.mk +++ b/Mk/bsd.autotools.mk @@ -5,37 +5,31 @@ # # Please view me with 4 column tabs! # -# Note: before committing to this file, contact portmgr to arrange for an -# experimental ports run. Untested commits may be backed out at portmgr's -# discretion. +# IMPORTANT NOTE: +# Before making any changes to this file, contact portmgr to arrange +# for an experimental ports run. +# Untested commits will almost certainly break the tree, incur the +# wrath of countless folks, and be unceremoniously backed out by +# the maintainer and/or portmgr. Autotools_Include_MAINTAINER= autotools@FreeBSD.org #--------------------------------------------------------------------------- -# Entry point into the autotools system -#--------------------------------------------------------------------------- -# -# USE_AUTOTOOLS= tool:version[:env] ... -# -# 'tool' can currently be one of: -# libtool, libltdl, autoconf, autoheader, automake, aclocal +# USE_AUTOTOOLS= tool[:env] ... # -# There is also a special tool, called 'autotools', which is -# a convenience function to simply bring in dependencies of -# all the autotools. +# 'tool' can currently be one of the following: +# autoconf, autoheader +# autoconf213, autoheader213 (legacy version) +# automake, aclocal +# automake14, aclocal14 (legacy version) +# libtool, libtoolize, libltdl # -# 'version' is tool dependent +# ':env' is used to specify that the environmental variables are needed +# but the relevant tool should NOT be run as part of the +# 'run-autotools' target # -# ':env' is used to pecify that the environment variables are needed, -# but the relevant tool should NOT be run as part of the -# run-autotools target -# -# XXX: there is currently no sanity checking of the supplied variables -# other than to detect actually available versions. This should -# probably be fixed at some point. -# -# In addition, the following variables can be set in the port Makefile -# to be passed to the relevant tools: +# In addition, these variables can be set in the port Makefile to be +# passed to the relevant tools: # # AUTOMAKE_ARGS=... # - Extra arguments passed to automake during configure step @@ -54,192 +48,269 @@ Autotools_Include_MAINTAINER= autotools@FreeBSD.org # # LIBTOOLFILES=<list-of-files> # - A list of files to patch during libtool pre-configuration -# Defaults to "aclocal.m4" if autoconf is in use, otherwise -# ${CONFIGURE_SCRIPT} (usually "configure") # #--------------------------------------------------------------------------- -# XXX: here be dragons :) -# -.for item in ${USE_AUTOTOOLS} -AUTOTOOL_${item:C/^([^:]+).*/\1/}${item:M*\:*\:*:C/^[^:]+:[^:]+:([^:]+)/_\1/}= ${item:C/^[^:]+:([^:]+).*/\1/} -.endfor +#--------------------------------------------------------------------------- +# NO USER-SERVICABLE PARTS BEYOND THIS POINT. REALLY. WE MEAN IT. +#--------------------------------------------------------------------------- + +# Known autotools components +_AUTOTOOLS_ALL= autoconf autoheader autoconf213 autoheader213 \ + automake aclocal automake14 aclocal14 \ + libtool libtoolize libltdl + +# Incompatible autotools mixing +_AUTOTOOLS_IGN_autoconf= autoconf213 autoheader213 +_AUTOTOOLS_IGN_autoheader= autoconf213 autoheader213 +_AUTOTOOLS_IGN_autoconf213= autoconf autoheader +_AUTOTOOLS_IGN_autoheader213= autoconf autoheader +_AUTOTOOLS_IGN_automake= automake14 aclocal14 +_AUTOTOOLS_IGN_aclocal= automake14 aclocal14 +_AUTOTOOLS_IGN_automake14= automake aclocal +_AUTOTOOLS_IGN_aclocal14= automake aclocal #--------------------------------------------------------------------------- -# AUTOTOOLS handling (for build, runtime, and both) +# Primary magic to break out the USE_AUTOTOOLS stanza into something +# more useful, along with substantial error checking to prevent +# foot-shooting #--------------------------------------------------------------------------- -.if defined(AUTOTOOL_autotools) -AUTOTOOLS_DEPENDS= ${LOCALBASE}/share/autotools:${PORTSDIR}/devel/autotools - -. if ${AUTOTOOL_autotools} == "build" -BUILD_DEPENDS+= ${AUTOTOOLS_DEPENDS} -. elif ${AUTOTOOL_autotools} == "run" -RUN_DEPENDS+= ${AUTOTOOLS_DEPENDS} -. elif ${AUTOTOOL_autotools} == "both" -BUILD_DEPENDS+= ${AUTOTOOLS_DEPENDS} -RUN_DEPENDS+= ${AUTOTOOLS_DEPENDS} -. else -IGNORE+= Unknown autotools stanza: ${AUTOTOOL_autotools} + +# Break out the stanza +# +_AUTOTOOLS_IMPL= +.for stanza in ${USE_AUTOTOOLS} +_AUTOTOOLS_IMPL+= ${stanza:C/^([^:]+).*/\1/} +_AUTOTOOL_${stanza:C/^([^:]+).*/\1/}= ${stanza:C/^[^:]+:([^:]+)/\1/} +.endfor + +# Verify each component, normalize +# +_AUTOTOOLS_NOCOMP= +.for component in ${_AUTOTOOLS_IMPL} +. if ${_AUTOTOOLS_ALL:M${component}}=="" +_AUTOTOOLS_NOCOMP+= ${component} +. endif +. if ${_AUTOTOOL_${component}}==${component} +_AUTOTOOL_${component}= yes +. elsif ${_AUTOTOOL_${component}}!="env" && ${_AUTOTOOL_${component}}!="yes" +_AUTOTOOLS_BADCOMP+= ${component}:${_AUTOTOOL_${component}} +. endif +.endfor +.if !empty(_AUTOTOOLS_NOCOMP) +IGNORE+= Unknown autotool: ${_AUTOTOOLS_NOCOMP:O:u} +.endif + +# Check for anything other than 'yes' or 'env' +# +_AUTOTOOLS_BADCOMP= +.for component in ${_AUTOTOOLS_IMPL} +. if ${_AUTOTOOL_${component}}!="env" && ${_AUTOTOOL_${component}}!="yes" +_AUTOTOOLS_BADCOMP+= ${component}:${_AUTOTOOL_${component}} . endif +.endfor +.if !empty(_AUTOTOOLS_BADCOMP) +IGNORE+= Bad autotool stanza: ${_AUTOTOOLS_BADCOMP:O:u} +.endif +# Check for incompatible mixes of components +# +_AUTOTOOLS_IGN= +.for component in ${_AUTOTOOLS_IMPL} +. for ignore in ${_AUTOTOOLS_IGN_${component}} +. if defined(_AUTOTOOL_${ignore}) +_AUTOTOOLS_IGN+= ${component} +. endif +. endfor +.endfor +.if !empty(_AUTOTOOLS_IGN) +IGNORE+= Incompatible autotools: ${_AUTOTOOLS_IGN:O:u} .endif #--------------------------------------------------------------------------- -# AUTOMAKE/ACLOCAL +# automake and aclocal #--------------------------------------------------------------------------- -.if defined(AUTOTOOL_automake) -AUTOTOOL_automake_env= ${AUTOTOOL_automake} -GNU_CONFIGURE?= yes -.endif - -.if defined(AUTOTOOL_aclocal) -AUTOTOOL_automake_env= ${AUTOTOOL_aclocal} -GNU_CONFIGURE?= yes +.if defined(_AUTOTOOL_aclocal) && ${_AUTOTOOL_aclocal} == "yes" +_AUTOTOOL_automake?= env +_AUTOTOOL_rule_aclocal= yes +GNU_CONFIGURE= yes .endif -.if defined(AUTOTOOL_automake_env) -AUTOMAKE_VERSION= ${AUTOTOOL_automake_env} -AUTOMAKE_SUFFIX= ${AUTOMAKE_VERSION:C/([0-9])(.*)/\1.\2/} +.if defined(_AUTOTOOL_automake) +AUTOMAKE_VERSION= 1.11 +AUTOMAKE_APIVER= 1.11.1 +AUTOMAKE_PORT= devel/automake111 -# Make sure we specified a legal version of automake -# -. if !exists(${PORTSDIR}/devel/automake${AUTOMAKE_VERSION}/Makefile) -IGNORE+= cannot install: unknown AUTOMAKE version: ${AUTOMAKE_VERSION} +. if ${_AUTOTOOL_automake} == "yes" +_AUTOTOOL_rule_automake= yes +GNU_CONFIGURE?= yes . endif +.endif -# Set up the automake environment -# -AUTOMAKE= ${LOCALBASE}/bin/automake-${AUTOMAKE_SUFFIX} -AUTOMAKE_DIR= ${LOCALBASE}/share/automake-${AUTOMAKE_SUFFIX} -ACLOCAL= ${LOCALBASE}/bin/aclocal-${AUTOMAKE_SUFFIX} -ACLOCAL_DIR= ${LOCALBASE}/share/aclocal-${AUTOMAKE_SUFFIX} -AUTOMAKE_VARS= ACLOCAL=${ACLOCAL} AUTOMAKE=${AUTOMAKE} AUTOMAKE_VERSION=${AUTOMAKE_VERSION} +.if defined(_AUTOTOOL_aclocal14) && ${_AUTOTOOL_aclocal14} == "yes" +_AUTOTOOL_automake14?= env +_AUTOTOOL_rule_aclocal14= yes +GNU_CONFIGURE?= yes +.endif -AUTOMAKE_DEPENDS= ${AUTOMAKE}:${PORTSDIR}/devel/automake${AUTOMAKE_VERSION} -BUILD_DEPENDS+= ${AUTOMAKE_DEPENDS} +.if defined(_AUTOTOOL_automake14) +AUTOMAKE_VERSION= 1.4 +AUTOMAKE_APIVER= 1.4.6 +AUTOMAKE_PORT= devel/automake14 +AUTOMAKE_ARGS+= -i # backwards compatibility shim -# XXX: backwards compatibility shim -# -. if ${AUTOMAKE_VERSION} == 14 -AUTOMAKE_ARGS+= -i +. if ${_AUTOTOOL_automake14} == "yes" +_AUTOTOOL_rule_automake= yes +GNU_CONFIGURE?= yes . endif +.endif + +.if defined(AUTOMAKE_VERSION) +AUTOMAKE= ${LOCALBASE}/bin/automake-${AUTOMAKE_VERSION} +AUTOMAKE_DIR= ${LOCALBASE}/share/automake-${AUTOMAKE_VERSION} +ACLOCAL= ${LOCALBASE}/bin/aclocal-${AUTOMAKE_VERSION} +ACLOCAL_DIR= ${LOCALBASE}/share/aclocal-${AUTOMAKE_VERSION} -. if defined(AUTOTOOL_aclocal) +. if defined(_AUTOTOOL_aclocal) || defined(_AUTOTOOL_aclocal14) ACLOCAL_ARGS?= --acdir=${ACLOCAL_DIR} . endif +AUTOMAKE_VARS= AUTOMAKE=${AUTOMAKE} \ + AUTOMAKE_DIR=${AUTOMAKE_DIR} \ + AUTOMAKE_VERSION=${AUTOMAKE_VERSION} \ + AUTOMAKE_APIVER=${AUTOMAKE_APIVER} \ + ACLOCAL=${ACLOCAL} \ + ACLOCAL_DIR=${ACLOCAL_DIR} + +AUTOMAKE_DEPENDS= ${AUTOMAKE}:${PORTSDIR}/${AUTOMAKE_PORT} +BUILD_DEPENDS+= ${AUTOMAKE_DEPENDS} .endif #--------------------------------------------------------------------------- -# AUTOCONF/AUTOHEADER +# autoconf and autoheader #--------------------------------------------------------------------------- -.if defined(AUTOTOOL_autoheader) -AUTOTOOL_autoconf= ${AUTOTOOL_autoheader} +.if defined(_AUTOTOOL_autoheader) && ${_AUTOTOOL_autoheader} == "yes" +_AUTOTOOL_autoconf= yes +_AUTOTOOL_rule_autoheader= yes +GNU_CONFIGURE?= yes +.endif + +.if defined(_AUTOTOOL_autoconf) +AUTOCONF_VERSION= 2.68 +AUTOCONF_PORT= devel/autoconf268 + +. if ${_AUTOTOOL_autoconf} == "yes" +_AUTOTOOL_rule_autoconf= yes +GNU_CONFIGURE?= yes +. endif .endif -.if defined(AUTOTOOL_autoconf) -AUTOTOOL_autoconf_env= ${AUTOTOOL_autoconf} -GNU_CONFIGURE?= yes +.if defined(_AUTOTOOL_autoheader213) && ${_AUTOTOOL_autoheader213} == "yes" +_AUTOTOOL_autoconf213= yes +_AUTOTOOL_rule_autoheader= yes +GNU_CONFIGURE?= yes .endif -.if defined(AUTOTOOL_autoconf_env) -AUTOCONF_VERSION= ${AUTOTOOL_autoconf_env} -AUTOCONF_SUFFIX= ${AUTOCONF_VERSION:C/([0-9])(.*)/\1.\2/} +.if defined(_AUTOTOOL_autoconf213) +AUTOCONF_VERSION= 2.13 +AUTOCONF_PORT= devel/autoconf213 +AUTOM4TE= ${FALSE} # doesn't exist here -# Make sure we specified a legal version of autoconf -# -. if !exists(${PORTSDIR}/devel/autoconf${AUTOCONF_VERSION}/Makefile) -IGNORE+= cannot install: unknown AUTOCONF version: ${AUTOCONF_VERSION} +. if ${_AUTOTOOL_autoconf213} == "yes" +_AUTOTOOL_rule_autoconf= yes +GNU_CONFIGURE?= yes . endif +.endif -# Set up the autoconf/autoheader environment -# -AUTOCONF= ${LOCALBASE}/bin/autoconf-${AUTOCONF_SUFFIX} -AUTOCONF_DIR= ${LOCALBASE}/share/autoconf-${AUTOCONF_SUFFIX} -AUTOHEADER= ${LOCALBASE}/bin/autoheader-${AUTOCONF_SUFFIX} -AUTOIFNAMES= ${LOCALBASE}/bin/ifnames-${AUTOCONF_SUFFIX} -AUTOM4TE= ${LOCALBASE}/bin/autom4te-${AUTOCONF_SUFFIX} -AUTORECONF= ${LOCALBASE}/bin/autoreconf-${AUTOCONF_SUFFIX} -AUTOSCAN= ${LOCALBASE}/bin/autoscan-${AUTOCONF_SUFFIX} -AUTOUPDATE= ${LOCALBASE}/bin/autoupdate-${AUTOCONF_SUFFIX} -AUTOCONF_VARS= AUTOCONF=${AUTOCONF} AUTOHEADER=${AUTOHEADER} AUTOIFNAMES=${AUTOIFNAMES} AUTOM4TE=${AUTOM4TE} AUTORECONF=${AUTORECONF} AUTOSCAN=${AUTOSCAN} AUTOUPDATE=${AUTOUPDATE} AUTOCONF_VERSION=${AUTOCONF_VERSION} - -AUTOCONF_DEPENDS= ${AUTOCONF}:${PORTSDIR}/devel/autoconf${AUTOCONF_VERSION} +.if defined(AUTOCONF_VERSION) +AUTOCONF= ${LOCALBASE}/bin/autoconf-${AUTOCONF_VERSION} +AUTOCONF_DIR= ${LOCALBASE}/share/autoconf-${AUTOCONF_VERSION} +AUTOHEADER= ${LOCALBASE}/bin/autoheader-${AUTOCONF_VERSION} +AUTOIFNAMES= ${LOCALBASE}/bin/ifnames-${AUTOCONF_VERSION} +AUTOM4TE?= ${LOCALBASE}/bin/autom4te-${AUTOCONF_VERSION} +AUTORECONF= ${LOCALBASE}/bin/autoreconf-${AUTOCONF_VERSION} +AUTOSCAN= ${LOCALBASE}/bin/autoscan-${AUTOCONF_VERSION} +AUTOUPDATE= ${LOCALBASE}/bin/autoupdate-${AUTOCONF_VERSION} + +AUTOCONF_VARS= AUTOCONF=${AUTOCONF} \ + AUTOCONF_DIR=${AUTOCONF_DIR} \ + AUTOHEADER=${AUTOHEADER} \ + AUTOIFNAMES=${AUTOIFNAMES} \ + AUTOM4TE=${AUTOM4TE} \ + AUTORECONF=${AUTORECONF} \ + AUTOSCAN=${AUTOSCAN} \ + AUTOUPDATE=${AUTOUPDATE} \ + AUTOCONF_VERSION=${AUTOCONF_VERSION} + +AUTOCONF_DEPENDS= ${AUTOCONF}:${PORTSDIR}/${AUTOCONF_PORT} BUILD_DEPENDS+= ${AUTOCONF_DEPENDS} - .endif #--------------------------------------------------------------------------- -# LIBTOOL/LIBLTDL +# libltdl #--------------------------------------------------------------------------- -# Convenience function to save people having to depend directly on -# devel/libltdl22 -# -.if defined(AUTOTOOL_libltdl) -LIB_DEPENDS+= ltdl.7:${PORTSDIR}/devel/libltdl22 -.endif - -.if defined(AUTOTOOL_libtoolize) -AUTOTOOL_libtoolize_env= ${AUTOTOOL_libtoolize} -GNU_CONFIGURE?= yes +.if defined(_AUTOTOOL_libltdl) +LIB_DEPENDS+= ltdl.7:${PORTSDIR}/devel/libltdl22 .endif -.if defined(AUTOTOOL_libtool) -GNU_CONFIGURE?= YES -AUTOTOOL_libtool_env= ${AUTOTOOL_libtool} -.endif +#--------------------------------------------------------------------------- +# libtool/libtoolize +#--------------------------------------------------------------------------- -.if defined(AUTOTOOL_libtool_env) -LIBTOOL_VERSION= ${AUTOTOOL_libtool_env} +.if defined(_AUTOTOOL_libtool) || defined(_AUTOTOOL_libtoolize) +LIBTOOL_VERSION= 2.2.10 +LIBTOOL_PORT= devel/libtool22 -# Make sure we specified a legal version of libtool -# -. if !exists(${PORTSDIR}/devel/libtool${LIBTOOL_VERSION}/Makefile) -IGNORE+= cannot install: unknown LIBTOOL version: ${LIBTOOL_VERSION} +. if defined(_AUTOTOOL_libtool) && ${_AUTOTOOL_libtool} == "yes" +_AUTOTOOL_rule_libtool= yes +GNU_CONFIGURE?= yes +. endif +. if defined(_AUTOTOOL_libtoolize) && ${_AUTOTOOL_libtoolize} == "yes" +_AUTOTOOL_rule_libtoolize= yes +GNU_CONFIGURE?= yes . endif -# Set up the libtool environment -# +.endif + +.if defined(LIBTOOL_VERSION) LIBTOOL= ${LOCALBASE}/bin/libtool LIBTOOLIZE= ${LOCALBASE}/bin/libtoolize LIBTOOL_LIBEXECDIR= ${LOCALBASE}/libexec/libtool LIBTOOL_SHAREDIR= ${LOCALBASE}/share/libtool LIBTOOL_M4= ${LOCALBASE}/share/aclocal/libtool.m4 -LTMAIN= ${LIBTOOL_SHAREDIR}/config/ltmain.sh -LIBTOOL_VARS= LIBTOOL=${LIBTOOL} LIBTOOLIZE=${LIBTOOLIZE} LIBTOOL_M4=${LIBTOOL_M4} +LTMAIN= ${LOCALBASE}/share/libtool/config/ltmain.sh -LIBTOOL_DEPENDS= libtool>=2.2:${PORTSDIR}/devel/libtool${LIBTOOL_VERSION} -BUILD_DEPENDS+= ${LIBTOOL_DEPENDS} +LIBTOOL_VARS= LIBTOOL=${LIBTOOL} \ + LIBTOOLIZE=${LIBTOOLIZE} \ + LIBTOOL_LIBEXECDIR=${LIBTOOL_LIBEXECDIR} \ + LIBTOOL_SHAREDIR=${LIBTOOL_SHAREDIR} \ + LIBTOOL_M4=${LIBTOOL_M4} \ + LTMAIN=${LTMAIN} LIBTOOLFLAGS?= # default to empty -. if defined(AUTOTOOL_autoconf) +. if defined(_AUTOTOOL_rule_autoconf) || defined(_AUTOTOOL_rule_autoconf213) LIBTOOLFILES?= aclocal.m4 -. else +. elif defined(_AUTOTOOL_rule_libtool) LIBTOOLFILES?= ${CONFIGURE_SCRIPT} . endif +LIBTOOL_DEPENDS= libtool>=2.2:${PORTSDIR}/${LIBTOOL_PORT} +BUILD_DEPENDS+= ${LIBTOOL_DEPENDS} .endif #--------------------------------------------------------------------------- -# Environmental handling -# Now that we've got our environments defined for autotools, add them -# in so that the rest of the world can handle them -# -AUTOTOOLS_VARS= ${AUTOMAKE_VARS} ${AUTOCONF_VARS} ${LIBTOOL_VARS} - -.if defined(AUTOTOOLS_VARS) && (${AUTOTOOLS_VARS} != "") -AUTOTOOLS_ENV+= ${AUTOTOOLS_VARS} -CONFIGURE_ENV+= ${AUTOTOOLS_VARS} -MAKE_ENV+= ${AUTOTOOLS_VARS} -SCRIPTS_ENV+= ${AUTOTOOLS_VARS} -. for item in automake aclocal autoconf autoheader libtool libtoolize -. if defined(AUTOTOOL_${item}_env) -${item:U}_ENV+= ${AUTOTOOLS_VARS} -. endif +# Add to the environment +#--------------------------------------------------------------------------- + +AUTOTOOLS_VARS= ${AUTOMAKE_VARS} ${AUTOCONF_VARS} ${LIBTOOL_VARS} + +.if defined(AUTOTOOLS_VARS) && !empty(AUTOTOOLS_VARS) +. for var in AUTOTOOLS CONFIGURE MAKE SCRIPTS +${var:U}_ENV+= ${AUTOTOOLS_VARS} . endfor .endif @@ -247,23 +318,19 @@ ${item:U}_ENV+= ${AUTOTOOLS_VARS} # Make targets #--------------------------------------------------------------------------- -# run-autotools -# -# Part of the configure set - run appropriate programs prior to -# the actual configure target if autotools are in use. -# If needed, this target can be overridden, for example to change -# the order of autotools running. - .if !target(run-autotools) -.ORDER: run-autotools run-autotools-aclocal patch-autotools 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 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) run-autotools-aclocal: -. if defined(AUTOTOOL_aclocal) +. if defined(_AUTOTOOL_rule_aclocal) @(cd ${CONFIGURE_WRKSRC} && ${SETENV} ${AUTOTOOLS_ENV} ${ACLOCAL} \ ${ACLOCAL_ARGS}) . else @@ -271,19 +338,9 @@ run-autotools-aclocal: . endif .endif -.if !target(run-autotools-libtoolize) -run-autotools-libtoolize: -. if defined(AUTOTOOL_libtoolize) - @(cd ${CONFIGURE_WRKSRC} && ${SETENV} ${AUTOTOOLS_ENV} ${LIBTOOLIZE} \ - ${LIBTOOLIZE_ARGS}) -. else - @${DO_NADA} -. endif -.endif - .if !target(run-autotools-automake) run-autotools-automake: -. if defined(AUTOTOOL_automake) +. if defined(_AUTOTOOL_rule_automake) @(cd ${CONFIGURE_WRKSRC} && ${SETENV} ${AUTOTOOLS_ENV} ${AUTOMAKE} \ ${AUTOMAKE_ARGS}) . else @@ -293,7 +350,7 @@ run-autotools-automake: .if !target(run-autotools-autoconf) run-autotools-autoconf: -. if defined(AUTOTOOL_autoconf) +. if defined(_AUTOTOOL_rule_autoconf) @(cd ${CONFIGURE_WRKSRC} && ${SETENV} ${AUTOTOOLS_ENV} ${AUTOCONF} \ ${AUTOCONF_ARGS}) . else @@ -303,7 +360,7 @@ run-autotools-autoconf: .if !target(run-autotools-autoheader) run-autotools-autoheader: -. if defined(AUTOTOOL_autoheader) +. if defined(_AUTOTOOL_rule_autoheader) @(cd ${CONFIGURE_WRKSRC} && ${SETENV} ${AUTOTOOLS_ENV} ${AUTOHEADER} \ ${AUTOHEADER_ARGS}) . else @@ -311,23 +368,38 @@ run-autotools-autoheader: . endif .endif -# patch-autotools -# -# Special target to automatically make libtool using ports use the -# libtool port. See above for default values of LIBTOOLFILES. +.if !target(run-autotools-libtoolize) +run-autotools-libtoolize: +. if defined(_AUTOTOOL_rule_libtoolize) + @(cd ${CONFIGURE_WRKSRC} && ${SETENV} ${AUTOTOOLS_ENV} ${LIBTOOLIZE} \ + ${LIBTOOLIZE_ARGS}) +. else + @${DO_NADA} +. endif +.endif -.if !target(patch-autotools) -patch-autotools:: -. if defined(AUTOTOOL_libtool) - @(cd ${PATCH_WRKSRC}; \ - for file in ${LIBTOOLFILES}; do \ - ${CP} $$file $$file.tmp; \ - ${SED} -e "/^ltmain=/!s^\$$ac_aux_dir/ltmain.sh^${LIBTOOLFLAGS} ${LTMAIN}^g" \ - -e '/^LIBTOOL=/s^\$$(top_builddir)/libtool^${LIBTOOL}^g' \ - $$file.tmp > $$file; \ - ${RM} $$file.tmp; \ - done); +.if !target(patch-autotools-libtool) +patch-autotools-libtool:: +. if defined(_AUTOTOOL_rule_libtool) + @for file in ${LIBTOOLFILES}; do \ + ${REINPLACE_CMD} -e \ + "/^ltmain=/!s|\$$ac_aux_dir/ltmain.sh|${LIBTOOLFLAGS} ${LTMAIN}|g; \ + /^LIBTOOL=/s|\$$(top_builddir)/libtool|${LIBTOOL}|g" \ + ${PATCH_WRKSRC}/$$file; \ + done; . else @${DO_NADA} . endif .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 + +.if !target(patch-autotools) +patch-autotools:: + @${DO_NADA} +.endif |