Commit graph

140 commits

Author SHA1 Message Date
jlam
5792714269 For packages that use GNU configure scripts, pass the real command
paths for the tools that the package uses through the shell environment.
We do this since these paths may be hardcoded into package scripts,
and if they're not pre-specified, then they'll be searched for in the
PATH, which would find the ones in ${TOOLS_DIR}.

The variable names that GNU configure scripts expect are named in
_TOOLS_VARNAME_GNU.* for the various tools.
2005-05-21 23:09:36 +00:00
jlam
3b3b871622 Grammar 101 -- sentences should end in a period. 2005-05-21 04:53:17 +00:00
jlam
6cb4436e71 Add TNF copyright to the new tools framework makefiles. 2005-05-21 04:46:52 +00:00
jlam
28e2995cd1 We can only use the subst.mk framework if the files are relative to
${WRKSRC}.  Just directly create the msgfmt wrapper in the proper
target.  Also, note that the msgfmt handling should eventually migrate
to the tools framework so that build dependencies and binary paths are
correct.
2005-05-19 20:08:44 +00:00
jlam
10b0f8d012 Merge most of imake.mk into replace.mk and leave imake.mk to contain
the extra bits required by packages that use imake/xmkmf.  This
consolidates most of the replacement tools handling into replace.mk.
2005-05-19 05:27:25 +00:00
jlam
0e05f46639 Merge most of perl.mk into replace.mk and leave perl.mk to contain
the extra bits required by packages that use perl.  This causes
PKGSRC_USE_TOOLS+=perl to work properly.
2005-05-19 03:52:23 +00:00
jlam
2046497558 Properly deal with case where TOOL_DEPENDS.* is a list of values by
iterating over each dependency in the list.
2005-05-19 02:27:38 +00:00
jlam
5a008c838b Use nawk as the default "awk" replacement since it has no dependencies
and is still strong enough for pkgsrc use.
2005-05-18 05:31:55 +00:00
jlam
8c1f92916b Move perl handling into replace.mk. We now can specify USE_TOOLS+=perl
to note that we need the perl binary and the associated PERL5 and
TOOLS_PERL5 variable definitions.
2005-05-17 18:34:45 +00:00
jlam
a77257ee11 USE_GNU_TOOLS+=m4 should translate to USE_TOOLS+=gm4 to get the same
meaning.
2005-05-16 18:35:30 +00:00
jlam
3966d98d38 Treat USE_GNU_TOOLS+=yacc the same as USE_TOOLS+=bison, since there is
the implication that the system yacc(1) is not good enough anyway.
2005-05-16 16:28:54 +00:00
jlam
2338cbae27 Change the EXTRACT_USING_PAX defined/undefined option into a EXTRACT_USING
which can take multiple values -- "pax" or "gtar".  The default value
of EXTRACT_USING is "pax", which more closely matches reality since
before, we were using bootstrap "tar" for ${GTAR} and it was actually
pax-as-tar.  Also, stop pretending pax-as-tar from the bootstrap kit
or on NetBSD is GNU tar.  Lastly, in bsd.pkg.extract.mk, note whether
we need "pax" or "gtar" depending on what we need to extract the
distfiles.
2005-05-16 03:04:44 +00:00
jlam
0582157fdb Asking the tools framework for "bison" now provides two distinct tools:
"bison" and "bison-yacc".  bison is just a symlink to the real bison,
but "bison-yacc" provides a "yacc" in ${TOOLS_DIR} that does "bison
-y".  This allows the tools framework to provide everything that a
package might look for when asking for "bison" and avoids relying on
the bison being available in the PATH.
2005-05-15 23:20:38 +00:00
jlam
2e18822098 gzip-base installs "zcat" not "gzcat". 2005-05-15 22:34:43 +00:00
jlam
f680604f3c We want to check if we're in gzip-base to avoid circular dependencies on
gzip.
2005-05-15 22:33:08 +00:00
jlam
2adc6c7d19 Old versions of pax-as-tar don't do the right thing when invoked as
"gtar".  Force the gtar in the tools directory to be a wrapper script
so that we invoke the (possibly) pax-as-tar as "tar".
2005-05-15 03:27:20 +00:00
jlam
e78c6207f3 BUILDLINK_DEPENDS.* can be lists, so iterate over the lists when creating
a proper BUILD_DEPENDS or DEPENDS list.
2005-05-14 21:38:18 +00:00
jlam
8dba6226e7 Consider ${TAR} differently from ${GTAR}. Currently, mark pkgsrc down
as needing both (no impact since they're both satisfied by the tar
binary installed by the bootstrap kit).  There's some funniness in
the extraction code where we check for pax or GNU tar that needs to
be resolved.  Remove the TAR=${GTAR} hack since it's no longer needed
after these changes.

XXX Later, a sweep needs to be made to see where we actually need GTAR
XXX and where we only need TAR, probably triggered by whether we call it
XXX with the "z" option or not.  Packages that need GTAR should explicitly
XXX add USE_TOOLS+=gtar to the package Makefile.
2005-05-14 21:15:07 +00:00
jlam
214611316d Compute the installation prefix for every tool specified so that the
"TOOL" variables defined by replace.mk, e.g. AWK, GREP, SED, TRUE,
etc., can be used immediately after bsd.tools.mk is included.
2005-05-14 05:57:43 +00:00
jlam
ec7c68e97c Teach the new tools framework about lha, unrar, unzip, and unzoo and
modify bsd.pkg.extract.mk to use them.  As a side-effect, we stop
hardcoding ${LOCALBASE} as the install prefix for these tools so this
becomes more pkgviews-friendly.
2005-05-13 22:08:20 +00:00
jlam
b17ddaa794 Don't condtionally set the "TOOL" variables... set them explicitly. Also
fix variable name in the case where we're using the pkgsrc tool, since
we were referencing the wrong variable.
2005-05-13 21:57:13 +00:00
jlam
a136d7cc68 Observe the following:
VAR=	a
	PTR=	VAR
	${PTR}?= b

Given these definitions, ${VAR} == "b" (unintuitively).  We can work
around this by doing:

	VAR=	a
	PTR=	VAR
	.for _v_ in ${PTR}
	${_v_}?= b
	.endfor

In this case, ${VAR} == "a" (as expected).

Use the second form of assignment in this changeset so that the expected
behavior happens for the "TOOL" name variables.  This fixes "recursively
defined" errors for some of the "TOOL" variables when the pkgsrc tool
replaces the system-supplied one.
2005-05-12 03:57:40 +00:00
jlam
0dbd0c0762 Rename MAKE_VARS to MAKEVARS so that it more closely resembles
"MAKEFLAGS".  Both "MAKEVARS" and "MAKEFLAGS" affect the package-level
make process, not the software's own make process.
2005-05-11 22:08:18 +00:00
jlam
bb022af73a Use EVAL_PREFIX to be pkgviews-friendly. 2005-05-11 19:42:17 +00:00
jlam
a03def662e Define the "TOOL" names for the tools to be the same as the "TOOLS_TOOL"
names if the former are undefined.  This allows the "TOOL" names, e.g.
GMAKE, YACC, etc., to be used by package Makefiles for simplicity.
2005-05-11 05:05:03 +00:00
jlam
dfb5ed0037 Make a distinction between the tools that pkgsrc needs and the tools
that a package needs.  Tools that pkgsrc needs are listed in
PKGSRC_USE_TOOLS, and tools that a package needs on top of that are
listed in USE_TOOLS.

Define "TOOL" variables, e.g. SED, AWK, MKDIR, etc.  for each of the
tools that pkgsrc needs, and "TOOLS_TOOL" variables, e.g.  TOOLS_SED,
TOOLS_AWK, TOOLS_MKDIR, etc. for each of the tools that a package
needs.  These variables contain the full command line to the real
command and arguments needed to invoke the tool.
2005-05-10 19:06:58 +00:00
jlam
525b3f42ce Replace TOOLS_WRAP and TOOLS_SYMLINK with TOOLS_CREATE, and let the tools
framework figure out by itself whether a wrapper or a symlink should be
created based on the real command and any arguments that may need to be
invoked.
2005-05-09 01:11:58 +00:00
jlam
61da5414f3 Rename TOOLS_ARGS.* to TOOLS_REAL_ARGS.* to follow naming convention for
other TOOLS_* variables relating to the real command executed.
2005-05-09 00:13:03 +00:00
jlam
110ac816ee Create a wrapper instead of a symlink if TOOLS_REAL_CMD.<tool> isn't an
absolute path.
2005-05-04 04:46:48 +00:00
jlam
3f770348b7 Teach the new tools framework about INSTALL and set the appropriate
default value for each platform.  Currently, the replacement tools
comes from sysutils/coreutils, but where there is no native BSD install
program, bootstrap-pkgsrc should probably be made to provide an install
shell script as an alternative, and mk/tools/bootstrap.mk should be
amended accordingly.

Also remove one use of ${TYPE} in pkgsrc (bsd.pkg.mk) under the new tools
framework.
2005-05-03 20:41:53 +00:00
jlam
5562cbeeef GNU xargs must be invoked with "-r" so that we don't run the command at
all if the stdin is empty.
2005-05-03 17:14:14 +00:00
jlam
8861b6ba02 Teach the new tools framework about MAIL_CMD. We use mail/nail as a
"mail" replacement in case TOOLS_PLATFORM.mail is empty.
2005-05-03 16:30:34 +00:00
jlam
0c14b578db When using the pkgsrc versions of gzip/gunzip, also invoke them with
the same set of arguments that the system-supplied gzip/gunzip would
use.
2005-05-03 15:17:26 +00:00
jlam
b26519d8a4 * Push the imake- and xmkmf-handling into the new tools framework.
* Get rid of an explicit check for ${_IMAKE_MAKE} == ${GMAKE} in
  bsd.pkg.mk to check for whether we need to depend on gmake or not.
  Instead, we now note in Linux.mk that packages that need imake will
  also need to use gmake by setting _IMAKE_TOOLS+=gmake.

* Push the definition of MAKE_PROGRAM from bsd.pkg.mk into make.mk where
  it's closer to related code.
2005-05-02 21:10:02 +00:00
jlam
157b5ae130 If we only define the "TOOL" variable if the real command exists, then
the "TOOL" variables won't be properly defined for the top-leve make
after returning from making the install-depends target if we're using
the pkgsrc-supplied tool.  Define the "TOOL" variable unconditionally
instead.
2005-05-02 06:36:29 +00:00
jlam
96c5deea72 Teach the new tools framework about USE_TOOLS+=bzcat. 2005-05-02 02:50:33 +00:00
jlam
c368f44eea Split replace.mk into two parts, one of which is included by bsd.prefs.mk
to provide "TOOL" definitions for tools used by a top-level make process
(usually because it uses them in a != variable definition).  This allows
USE_TOOLS to be defined before bsd.prefs.mk is included by a package
Makefile, where USE_TOOLS lists the additional (non-default) tools that
are required to build the package.

Also, drop the fallback to existing "TOOL" definitions because we now
have TOOLS_PLATFORM.* for each platform in pkgsr/mk/tools/tools.*.mk.
2005-04-30 04:35:54 +00:00
jlam
c76976cd01 Only set the "TOOL" variable if one has been associated with the tool. 2005-04-28 17:40:52 +00:00
jlam
99661424ef Merge coreutils.mk into replace.mk. Also remove the "coreutils" option
to USE_TOOLS and replace it with the names of the various tools we're
getting from coreutils, e.g. "mv", "mkdir", "rm", etc.
2005-04-28 17:35:48 +00:00
jlam
f3cd319177 Remove unused variable _TOOLS_REPLACE_LIST. 2005-04-28 16:00:58 +00:00
jlam
2df0e6ccee whitespace changes to simplify merging with coreutils.mk. 2005-04-28 15:55:12 +00:00
jlam
26cfc5a79c We only need to loop over the tools that we say we're going to use. 2005-04-28 15:51:10 +00:00
jlam
38b0a624c8 Create _USE_TOOLS, a sanitized versino of USE_TOOLS that removes the
tools that are overridden by superseding ones.  Use it in place of
USE_TOOLS in most places.  This fixes the situation where we can
depend on the tool that overridden, e.g. USE_TOOLS= gawk awk.
2005-04-28 15:47:43 +00:00
jlam
a6262466a1 Correct the PKGPATH for gsed. 2005-04-28 04:00:15 +00:00
jlam
25ba4810c5 Split out the tools from the same package into separate clauses so that
you can specify wanting individual tools from that package.
2005-04-28 03:57:39 +00:00
jlam
efc8bca44c Define TOOLS_DEPENDS.* to be the dependency that will be added, and
filter out dependencies that have already been added.
2005-04-28 03:01:11 +00:00
jlam
9a3f617848 Rename TOOLS_DEPENDS.* to TOOLS_DEPMETHOD.* to roughly match the
buildlink terminology for the same concept.
2005-04-28 02:10:56 +00:00
jlam
6f10b02051 Split out the perl handling to a separate file, since we always use the
pkgsrc perl, and it isn't really like any of the other tools that we
replace based on a system-/pkgsrc-supplied distinction.
2005-04-27 17:29:06 +00:00
jlam
bb78ec6884 Handle cases where pkgsrc bootstrap installs tools, e.g. pax, tar, sed.
Where bootstrap installs these tools, they should be considered system-
supplied since pkgsrc won't be providing replacements for them.

bootstrap.mk encapulates the information from the bootstrap script.  It
should eventually go away after the bootstrap script has been taught to
write out the correct TOOLS_PLATFORM.* entries to the example mk.conf
file.
2005-04-27 17:15:13 +00:00
jlam
1f5fbfd47d Rename PLATFORM_TOOLS.* to TOOLS_PLATFORM.* to bring the variable names
under the same namespace as the other parts of the new tools framework.
2005-04-27 16:52:28 +00:00
jlam
c8a17ff550 Remove conflict between bison and yacc... now "bison" simply overrides
"yacc" when both are specified.  Also add comments to note other
instances where we override other tools: gsed & sed, gawk & awk, gm4 & m4.
2005-04-27 16:41:11 +00:00
jlam
7c19bbbfb7 cmp should be a symlink, not a wrapper. 2005-04-27 16:29:45 +00:00
jlam
05bb461206 Teach replace.mk about awk, m4, and sed when the GNU versions aren't
required.
2005-04-27 16:28:19 +00:00
jlam
7b2de543a7 Get rid of the _TOOLS_USE_PLATFORM.* table as the information has now
been placed in the various tools.${OPSYS}.mk files using PLATFORM_TOOL.*
definitions.
2005-04-27 16:02:08 +00:00
jlam
ad38b77969 Initial stab at creating lists of system-supplied tools for each platform.
These were culled from pkgsrc/mk/${OPSYS}.mk.  These files should only be
listing utilities that aren't installed by pkgsrc.
2005-04-27 15:28:16 +00:00
jlam
94c112be85 We can't add dependencies on packages that are never registered.
archivers/pax and pkgtools/mtree fall in this category since they are
usually installed by pkgsrc bootstrap.
2005-04-27 15:21:50 +00:00
jlam
7618926f30 Teach replace about mtree/MTREE. 2005-04-27 06:15:53 +00:00
jlam
a127769fb0 Fix typo. 2005-04-27 05:07:57 +00:00
jlam
d9de65c7ac Teach replace.mk about replacements for SH (shells/pdksh) and SHLOCK
(pkgtools/shlock).
2005-04-27 04:47:41 +00:00
jlam
4551017b68 Teach replace.mk about GTAR and PAX (replace with archivers/pax if
necessary).
2005-04-27 03:41:17 +00:00
jlam
43916c013f Teach replace.mk about cmp/CMP. 2005-04-26 23:20:35 +00:00
jlam
94265ac3ca To avoid errors, check that there is a TOOL variable associated with
the tool before we set it.
2005-04-26 22:51:00 +00:00
jlam
7940a4a8c3 Packages that want GNU m4 will probably still invoke it as "m4". 2005-04-26 22:31:34 +00:00
jlam
f9ae355e00 Merge findutils.mk into replace.mk. We now just use USE_TOOLS+=find
or USE_TOOLS+=xargs, and cause FIND and XARGS to point to the correct
commands.
2005-04-26 22:28:03 +00:00
jlam
6467dde017 If we're using one of the package's utilities, we're going to be using
them all, so make sure _TOOLS_USE_PKGSRC.* is set to "yes".
2005-04-26 22:20:42 +00:00
jlam
e8487f79c7 Continue the work in previous commit by making the code more
cut-n-paste-friendly for packages with large numbers of utilities.
2005-04-26 22:18:14 +00:00
jlam
ad6de2baf8 Make some code more cut-n-paste-friendly for packages that replace lots
of tools.
2005-04-26 22:10:53 +00:00
jlam
0958a8bb86 The gzip utilities aren't ever prefixed with ${GNU_PROGRAM_PREFIX}...
they're just "gzip", "gunzip" and "gzcat".
2005-04-26 21:57:44 +00:00
jlam
ec47def062 Fix conditions on grep and gzip so that if any of the TOOLS_IGNORE.* are
defined for their respective utilities, then we skip the processing to
avoid dependency loops.
2005-04-26 21:56:13 +00:00
jlam
e20d622f80 Sort the tool-specific sections for easier browsing. 2005-04-26 19:15:38 +00:00
jlam
5929e7de0c The gawk and gsed tools are called "awk" and "sed" under ${TOOLS_DIR}
since that's how most applications expect to invoke awk and sed.
2005-04-26 19:14:42 +00:00
jlam
99b5f1546f Rename the "sed" option for USE_TOOLS to "gsed" to note that we want
GNU sed.
2005-04-26 19:11:25 +00:00
jlam
82a12c033d Fix typo. 2005-04-26 19:01:30 +00:00
jlam
384c3b3c0c Only set the "TOOL" variable if it was associated with the corresponding
<tool>.
2005-04-26 18:59:48 +00:00
jlam
6860de7f8a PLATFORM_TOOL.<tool> is meant to be set like the "TOOL" variable, so
also create either a wrapper or a symlink depending on whether it has
any arguments or not.  While we're here, correct the comment block to
include a description of PLATFORM_TOOL.*.
2005-04-26 16:19:37 +00:00
jlam
191dd8648a As of bsd.tool.mk:1.6, TOOLS_CMD.<tool> defaults to
${TOOLS_DIR}/bin/<tool>, so remove redundant settings.
2005-04-26 15:32:05 +00:00
jlam
9ff151f408 If PLATFORM_TOOL.<tool> is defined for a particular tool, then use it
instead of the pkgsrc version of the tool.  This is an alternative to
adding the appropriate platform to the _TOOLS_USE_PLATFORM.* tables.
2005-04-25 06:16:38 +00:00
jlam
6c70da15ee Alphabetize the platform tools lists. 2005-04-24 23:32:09 +00:00
jlam
ef65ba9109 Platforms that have GNU grep also have egrep and fgrep. 2005-04-24 23:28:20 +00:00
jlam
18a34b1575 Rename "m4" to "gm4" to more explicitly note that we want GNU m4. The
tool name under ${TOOLS_DIR} is still "m4".
2005-04-24 22:42:00 +00:00
jlam
b585711b14 Rename "awk" to "gawk" to make it more explicit that we want GNU awk
(probably for gensub() ).
2005-04-24 22:34:35 +00:00
jlam
f11ddc9186 Teach replace.mk about gzip, gunzip, and gzcat. 2005-04-24 03:59:44 +00:00
jlam
b9ba5fb74b If "TOOL" is already defined, then we don't need to redefine it. 2005-04-24 03:41:10 +00:00
jlam
52777660e0 Rewrite code for using system-supplied tools so that we can replace
tools that are defined as a command plus arguments, e.g. for gunzip,

	GUNZIP=	/usr/bin/gzip -d

In this case, we generate a wrapper script that invokes the real
command plus arguments.  If there are no arguments, then just symlink
the command for simplicity.

Also, restructure the tool-specific blocks so that we always define
TOOLS_CMD.<tool> to the correct name (important for yacc/bison), and
check that the real command actually exists before assigning it to
the "TOOL" name.
2005-04-24 03:07:36 +00:00
jlam
935fb20230 Avoid using a for loop (optimization) which also broke when using the
bootstrap bmake.
2005-04-22 02:29:28 +00:00
jlam
e5be01e361 Make sure that USE_TOOLS contains all of "grep egrep fgrep" if it
contains any one of them.  This causes the final loop to correctly
set TOOLS_REAL_CMD.{grep,egrep,fgrep} for all three tools.
2005-04-16 05:16:29 +00:00
jlam
03225a6007 Consolidate the egrep/fgrep/grep cases into a single case as an example
of how to make on pkgsrc package replace multiple related tools.
2005-04-15 17:55:33 +00:00
jlam
6fd70ecd8b Teach replace.mk about egrep, fgrep, and file. 2005-04-15 16:01:23 +00:00
jlam
2dd44d3004 Allow TOOLS_DEPENDS.<tool> to be set to change the nature of the
dependency if we're using the pkgsrc tool, e.g.
TOOL_DEPENDS.yacc=DEPENDS.  By default, we use BUILD_DEPENDS.
2005-04-15 06:52:25 +00:00
jlam
32d9220281 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.
2005-04-15 00:00:21 +00:00