pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/mk/tools Initial commit of the new tools framework. T...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/f9edb6779ed8
branches:  trunk
changeset: 492519:f9edb6779ed8
user:      jlam <jlam%pkgsrc.org@localhost>
date:      Fri Apr 15 00:00:21 2005 +0000

description:
Initial commit of the new tools framework.  This is currently designed
to be a drop-in replacement for mk/tools.mk, but isn't yet enabled
pending further testing.  To use, edit bsd.pkg.mk to include bsd.tools.mk
instead of tools.mk.

The major changes from the old tools framework are:

(1) The new interface to using the tools framework is through setting
    USE_TOOLS in the package Makefile, e.g.,

        USE_TOOLS+=     autoconf gmake yacc

(2) Bison/yacc handling is improved.  Instead of adding checks for
    /usr/bin/yacc to the package Makefile and explicitly setting YACC,
    e.g., security/mit-krb5/Makefile, simply add "yacc" to USE_TOOLS.
    If bison is explicitly required, then add "bison" to USE_TOOLS
    instead.

(3) GNU auto* tools are handled differently.  "autoconf", "aclocal",
    "automake", etc. will be tools in ${TOOLS_DIR} that point to the
    correct versions of the auto* tools.  Instead of patching Makefiles
    or scripts to use ${AUTOCONF}, ${ACLOCAL}, etc., the correct
    versions of the tools will be called if they are invoked simply
    by their bare names.  This is selected by adding either "autoconf"
    or "autoconf213", or "automake" or "automake14" to USE_TOOLS.

The new tools framework will deprecate the following variables:

        ACLOCAL         AUTORECONF
        AUTOCONF        BUILD_USES_GETTEXT_M4
        AUTOHEADER      USE_GNU_TOOLS
        AUTOMAKE        USE_TBL

The new tools framework will deprecate the following *.mk files:

        mk/autoconf.mk
        mk/automake.mk
        mk/tools.mk

Additional documentation on how to use bsd.tools.mk to create new tools
under ${TOOLS_DIR} may be found in the header comments in bsd.tools.mk.

diffstat:

 mk/tools/autoconf.mk  |  184 ++++++++++++++++++++++++++++++
 mk/tools/automake.mk  |  138 ++++++++++++++++++++++
 mk/tools/bsd.tools.mk |  182 +++++++++++++++++++++++++++++
 mk/tools/make.mk      |   11 +
 mk/tools/replace.mk   |  306 ++++++++++++++++++++++++++++++++++++++++++++++++++
 mk/tools/rpcgen.mk    |   36 +++++
 mk/tools/texinfo.mk   |   22 +++
 7 files changed, 879 insertions(+), 0 deletions(-)

diffs (truncated from 907 to 300 lines):

diff -r f20cf853fc48 -r f9edb6779ed8 mk/tools/autoconf.mk
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/mk/tools/autoconf.mk      Fri Apr 15 00:00:21 2005 +0000
@@ -0,0 +1,184 @@
+# $NetBSD: autoconf.mk,v 1.1 2005/04/15 00:00:21 jlam Exp $
+#
+# This Makefile fragment handles packages that use GNU autoconf.
+#
+# By default, all of the autoconf-related scripts are marked as
+# "missing" by running the GNU missing script in place of the utility.
+# This hides the autoconf-related scripts from makefiles that aggressively
+# call them when some of the inputs are modified in ways the makefiles
+# don't expect.
+#
+# If a package needs to use GNU autoconf, then the package Makefile
+# should contain one of the following lines:
+#
+#      USE_TOOLS+=     autoconf        # use recent GNU autoconf (>=2.50)
+#      USE_TOOLS+=     autoconf213     # use GNU autoconf ~2.13
+#
+# This will allow the package to invoke "autoconf", "autoreconf", etc.
+# by their usual, bare names.
+#
+# If a particular minimum version of autoconf is required, then the
+# package Makefile can additionally set AUTOCONF_REQD to the desired
+# version, e.g.:
+#
+#      AUTOCONF_REQD=  2.54    # use at least autoconf>=2.54
+#
+# To globally prevent any GNU autoconf handling, set the following
+# in the package Makefile:
+#
+#      AUTOMAKE_OVERRIDE=      no
+#
+
+# Only allow one of "autoconf" and "autoconf213" in USE_TOOLS.
+.if !empty(USE_TOOLS:Mautoconf) && !empty(USE_TOOLS:Mautoconf213)
+PKG_FAIL_REASON+=      "\`\`autoconf'' and \`\`autoconf213'' conflict in USE_TOOLS."
+.endif
+
+# This is an exhaustive list of all of the scripts supplied by GNU
+# autoconf.
+#
+_TOOLS_AUTOCONF=               autoconf autoheader autom4te autoreconf \
+                               autoscan autoupdate ifnames
+
+_TOOLS_AUTOCONF.autoconf=      autoconf        autoconf-2.13
+_TOOLS_AUTOCONF.autoheader=    autoheader      autoheader-2.13 
+_TOOLS_AUTOCONF.autom4te=      autom4te
+_TOOLS_AUTOCONF.autoreconf=    autoreconf      autoreconf-2.13
+_TOOLS_AUTOCONF.autoscan=      autoscan        autoscan-2.13
+_TOOLS_AUTOCONF.autoupdate=    autoupdate      autoupdate-2.13
+_TOOLS_AUTOCONF.ifnames=       ifnames         ifnames-2.13
+
+_TOOLS_AUTOCONF_LINKS= # empty
+
+.if !empty(USE_TOOLS:Mautoconf)
+AUTOCONF_REQD?=                2.50
+BUILD_DEPENDS+=                autoconf>=${AUTOCONF_REQD}:../../devel/autoconf
+
+_TOOLS_AUTOCONF_LINKS+=                autoconf
+TOOLS_CMD.autoconf=            ${TOOLS_DIR}/bin/autoconf
+TOOLS_REAL_CMD.autoconf=       ${LOCALBASE}/bin/autoconf
+
+_TOOLS_AUTOCONF_LINKS+=                autoheader
+TOOLS_CMD.autoheader=          ${TOOLS_DIR}/bin/autoheader
+TOOLS_REAL_CMD.autoheader=     ${LOCALBASE}/bin/autoheader
+
+_TOOLS_AUTOCONF_LINKS+=                autom4te
+TOOLS_CMD.autom4te=            ${TOOLS_DIR}/bin/autom4te
+TOOLS_REAL_CMD.autom4te=       ${LOCALBASE}/bin/autom4te
+
+_TOOLS_AUTOCONF_LINKS+=                autoreconf
+TOOLS_CMD.autoreconf=          ${TOOLS_DIR}/bin/autoreconf
+TOOLS_REAL_CMD.autoreconf=     ${LOCALBASE}/bin/autoreconf
+
+_TOOLS_AUTOCONF_LINKS+=                autoscan
+TOOLS_CMD.autoscan=            ${TOOLS_DIR}/bin/autoscan
+TOOLS_REAL_CMD.autoscan=       ${LOCALBASE}/bin/autoscan
+
+_TOOLS_AUTOCONF_LINKS+=                autoupdate
+TOOLS_CMD.autoupdate=          ${TOOLS_DIR}/bin/autoupdate
+TOOLS_REAL_CMD.autoupdate=     ${LOCALBASE}/bin/autoupdate
+
+_TOOLS_AUTOCONF_LINKS+=                ifnames
+TOOLS_CMD.ifnames=             ${TOOLS_DIR}/bin/ifnames
+TOOLS_REAL_CMD.ifnames=                ${LOCALBASE}/bin/ifnames
+
+# Continue to define the following variables until packages have been
+# taught to just use "autoconf", "autoheader", and "autoreconf" instead.
+#
+AUTOCONF=      ${TOOLS_CMD.autoconf}
+AUTOHEADER=    ${TOOLS_CMD.autoheader}
+AUTORECONF=    ${TOOLS_CMD.autoreconf}
+.endif
+
+.if !empty(USE_TOOLS:Mautoconf213)
+AUTOCONF_REQD?=                2.13
+BUILD_DEPENDS+=                autoconf213>=${AUTOCONF_REQD}:../../devel/autoconf213
+
+_TOOLS_AUTOCONF_LINKS+=                autoconf
+TOOLS_CMD.autoconf=            ${TOOLS_DIR}/bin/autoconf
+TOOLS_REAL_CMD.autoconf=       ${LOCALBASE}/bin/autoconf-2.13
+
+_TOOLS_AUTOCONF_LINKS+=                autoheader
+TOOLS_CMD.autoheader=          ${TOOLS_DIR}/bin/autoheader
+TOOLS_REAL_CMD.autoheader=     ${LOCALBASE}/bin/autoheader-2.13
+
+_TOOLS_AUTOCONF_LINKS+=                autoreconf
+TOOLS_CMD.autoreconf=          ${TOOLS_DIR}/bin/autoreconf
+TOOLS_REAL_CMD.autoreconf=     ${LOCALBASE}/bin/autoreconf-2.13
+
+_TOOLS_AUTOCONF_LINKS+=                autoscan
+TOOLS_CMD.autoscan=            ${TOOLS_DIR}/bin/autoscan
+TOOLS_REAL_CMD.autoscan=       ${LOCALBASE}/bin/autoscan-2.13
+
+_TOOLS_AUTOCONF_LINKS+=                autoupdate
+TOOLS_CMD.autoupdate=          ${TOOLS_DIR}/bin/autoupdate
+TOOLS_REAL_CMD.autoupdate=     ${LOCALBASE}/bin/autoupdate-2.13
+
+_TOOLS_AUTOCONF_LINKS+=                ifnames
+TOOLS_CMD.ifnames=             ${TOOLS_DIR}/bin/ifnames
+TOOLS_REAL_CMD.ifnames=                ${LOCALBASE}/bin/ifnames-2.13
+
+# Continue to define the following variables until packages have been
+# taught to just use "autoconf", "autoheader", and "autoreconf" instead.
+#
+AUTOCONF=      ${TOOLS_CMD.autoconf}
+AUTOHEADER=    ${TOOLS_CMD.autoheader}
+AUTORECONF=    ${TOOLS_CMD.autoreconf}
+
+.  if defined(USE_LIBTOOL)
+pre-configure: tools-libtool-m4-override
+.  endif
+.endif
+
+# For every script that hasn't already been symlinked, we mark it as
+# "GNU missing".
+#
+AUTOMAKE_OVERRIDE?=    yes
+.if !empty(AUTOMAKE_OVERRIDE:M[yY][eE][sS])
+TOOLS_SYMLINK+=                ${_TOOLS_AUTOCONF_LINKS}
+.  for _t_ in ${_TOOLS_AUTOCONF_LINKS}
+.    for _s_ in ${_TOOLS_AUTOCONF.${_t_}}
+.      if empty(TOOLS_REAL_CMD.${_t_}:M*/${_s_})
+TOOLS_GNU_MISSING+=    ${_s_}
+.      endif
+.    endfor
+.  endfor
+.  for _t_ in ${_TOOLS_AUTOCONF}
+.    if empty(_TOOLS_AUTOCONF_LINKS:M${_t_})
+.      for _s_ in ${_TOOLS_AUTOCONF.${_t_}}
+TOOLS_GNU_MISSING+=    ${_s_}
+.      endfor
+.    endif
+.  endfor
+.  undef _s_
+.  undef _t_
+.endif
+
+# LIBTOOL_M4_OVERRIDE lists the locations where the libtool.m4 symlink
+# will be created.  The libtool.m4 symlink is only created if a GNU
+# configure script exists at that location.
+#
+LIBTOOL_M4_OVERRIDE?=  libtool.m4 */libtool.m4 */*/libtool.m4
+
+# Symlink the libtool-1.4.m4 file into any directory in which there's
+# a configure script under ${WRKSRC}.  The symlink is called "libtool.m4",
+# which is the name expected by the autoconf tools.  The symlinking
+# is only done if we need autoconf-2.13 and libtool.  This allows
+# autoconf-2.13, autoreconf-2.13 and aclocal-2.13 to use the older
+# libtool.m4 file when regenerating files.  This is okay, because we
+# later override the generated libtool file anyway.
+#
+.PHONY: tools-libtool-m4-override
+tools-libtool-m4-override:
+.for _pattern_ in ${LIBTOOL_M4_OVERRIDE}
+       ${_PKG_SILENT}${_PKG_DEBUG}                                     \
+       cd ${WRKSRC};                                                   \
+       for cfile in ${_pattern_:S/libtool.m4$/configure/}; do          \
+               if ${TEST} -f "$$cfile"; then                           \
+                       libtool_m4=`${DIRNAME} $$cfile`/libtool.m4;     \
+                       ${LN} -sf ${PKGSRCDIR}/mk/gnu-config/libtool-1.4.m4 \
+                               $$libtool_m4;                           \
+               fi;                                                     \
+       done
+.endfor
+.undef _pattern_
diff -r f20cf853fc48 -r f9edb6779ed8 mk/tools/automake.mk
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/mk/tools/automake.mk      Fri Apr 15 00:00:21 2005 +0000
@@ -0,0 +1,138 @@
+# $NetBSD: automake.mk,v 1.1 2005/04/15 00:00:21 jlam Exp $
+#
+# This Makefile fragment handles packages that use GNU automake.
+#
+# By default, all of the automake-related scripts are marked as
+# "missing" by running the GNU missing script in place of the utility.
+# This hides the automake-related scripts from makefiles that aggressively
+# call them when some of the inputs are modified in ways the makefiles
+# don't expect.
+#
+# If a package needs to use GNU automake, then the package Makefile
+# should contain one of the following lines:
+#
+#      USE_TOOLS+=     automake        # use recent GNU automake (>=1.9)
+#      USE_TOOLS+=     automake14      # use GNU automake ~1.4
+#
+# This will allow the package to invoke "aclocal" and "automake" by
+# their usual, bare names.
+#
+# If a particular minimum version of automake is required, then the
+# package Makefile can additionally set AUTOMAKE_REQD to the desired
+# version, e.g.:
+#
+#      AUTOMAKE_REQD=  1.8     # use at least automake>=1.8
+#
+# If a package additionally needs to regenerate configure scripts and
+# Makefiles that use gettext, then the package Makefile should contain
+# the following line:
+#
+#      USE_TOOLS+=     gettext-m4      # need gettext.m4 to re-gen files
+#
+# To globally prevent any GNU automake handling, set the following
+# in the package Makefile:
+#
+#      AUTOMAKE_OVERRIDE=    no
+#
+
+# This variable is obsoleted, but continue to allow it until packages
+# have been taught to use the new syntax.
+#
+.if defined(BUILD_USES_GETTEXT_M4)
+USE_TOOLS+=    gettext-m4
+.endif
+
+# Only allow one of "automake" and "automake14" in USE_TOOLS.
+.if !empty(USE_TOOLS:Mautomake) && !empty(USE_TOOLS:Mautomake14)
+PKG_FAIL_REASON+=      "\`\`automake'' and \`\`automake14'' conflict in USE_TOOLS."
+.endif
+
+# This is an exhaustive list of all of the scripts supplied by GNU
+# automake.
+#
+_TOOLS_AUTOMAKE=               aclocal automake
+
+_TOOLS_AUTOMAKE.aclocal=       aclocal         aclocal-1.4             \
+                                               aclocal-1.5             \
+                                               aclocal-1.6             \
+                                               aclocal-1.7             \
+                                               aclocal-1.8             \
+                                               aclocal-1.9
+_TOOLS_AUTOMAKE.automake=      automake        automake-1.4            \
+                                               automake-1.5            \
+                                               automake-1.6            \
+                                               automake-1.7            \
+                                               automake-1.8            \
+                                               automake-1.9
+
+_TOOLS_AUTOMAKE_LINKS= # empty
+
+.if !empty(USE_TOOLS:Mautomake)
+AUTOMAKE_REQD?=                1.9
+BUILD_DEPENDS+=                automake>=${AUTOMAKE_REQD}:../../devel/automake
+USE_TOOLS+=            autoconf
+AUTOCONF_REQD?=                2.58
+
+_TOOLS_AUTOMAKE_LINKS+=                aclocal
+TOOLS_CMD.aclocal=             ${TOOLS_DIR}/bin/aclocal
+TOOLS_REAL_CMD.aclocal=                ${LOCALBASE}/bin/aclocal
+
+_TOOLS_AUTOMAKE_LINKS+=                automake
+TOOLS_CMD.automake=            ${TOOLS_DIR}/bin/automake
+TOOLS_REAL_CMD.automake=       ${LOCALBASE}/bin/automake
+
+# Continue to define the following variables until packages have been
+# taught to just use "aclocal" and "automake" instead.
+#
+ACLOCAL=       ${TOOLS_CMD.aclocal}
+AUTOMAKE=      ${TOOLS_CMD.automake}
+.endif
+
+.if !empty(USE_TOOLS:Mautomake14)
+AUTOMAKE_REQD?=                1.4
+BUILD_DEPENDS+=                automake14>=${AUTOMAKE_REQD}:../../devel/automake14
+USE_TOOLS+=            autoconf213
+AUTOCONF_REQD?=                2.13
+
+_TOOLS_AUTOMAKE_LINKS+=                aclocal
+TOOLS_CMD.aclocal=             ${TOOLS_DIR}/bin/aclocal
+TOOLS_REAL_CMD.aclocal=                ${LOCALBASE}/bin/aclocal-1.4
+
+_TOOLS_AUTOMAKE_LINKS+=                automake
+TOOLS_CMD.automake=            ${TOOLS_DIR}/bin/automake
+TOOLS_REAL_CMD.automake=       ${LOCALBASE}/bin/automake-1.4
+
+# Continue to define the following variables until packages have been
+# taught to just use "aclocal" and "automake" instead.
+#
+ACLOCAL=       ${TOOLS_CMD.aclocal}



Home | Main Index | Thread Index | Old Index