Commit graph

1651 commits

Author SHA1 Message Date
jlam
45e08b1210 Separate out the variables and targets for the "patch" phase into a
separate file pkgsrc/mk/bsd.pkg.patch.mk.  Also, include this file
ahead of the inclusion of bsd.tools.mk so that tools required to
patch are created by the tools framework.
2005-05-14 19:37:53 +00:00
jlam
335f53d761 If we use the new tools framework, the _USE_GMAKE is unnecessary as we
simply check for whether "gmake" is in USE_TOOLS.
2005-05-14 07:15:29 +00:00
jlam
2cc6e59e11 compiler.mk uses the following tools to compute the values of variables
at the time that they're defined: ${AWK}, ${GREP}, ${SED}, ${TRUE}.
Move the inclusion of compiler.mk below the inclusion of bsd.tools.mk
so that these variables are properly defined by the time they are
used.  This should fix problems where pkgsrc gcc was not being properly
detected when using the new tools framework.

This change has the side effect of changing the relative order of the
compiler directories and the tool directory in the PATH, but this has
no impact on existing packages, and actually makes more sense anyway.
2005-05-14 06:04:44 +00:00
jlam
676abf4b91 Simplify the check for whether we need a patch tool or not -- we simply
check for whether ${PATCHDIR} exists or not, or whether PATCHFILES is
defined or not.  This avoids the use of != in a variable definition
just to find out if we need patch or not.
2005-05-14 04:26:15 +00:00
rillig
eef497fdb0 Found another two uses of .ifndef and .ifdef.
Converted them to .if [!]defined().
2005-05-14 02:03:00 +00:00
rillig
b82fa5067b Replaced .ifdef with .if defined() and .ifndef with .if !defined(). This
will allow better error checking in Makefiles.
2005-05-14 01:50:38 +00:00
rillig
ca548bf623 Moved checking if ${SHLOCK} exists into the shell code fragment that
acquires the lock. This had to be done for the new tools framework and
because of the weird order of things in bsd.pkg.mk. Approved by jlam.
2005-05-13 22:22:44 +00:00
jlam
1fdc85c394 Don't check for ${SHLOCK}, which isn't defined yet that early in
bsd.pkg.mk under the new tools framework.  Instead, just note that if
we set PKGSRC_LOCKTYPE, that pkgsrc will require shlock.  Remove
"shlock" from the large PKGSRC_USE_TOOLS list since we don't need it
all of the time.  This fixes PKGSRC_LOCKTYPE != none when using the
new tools framework.
2005-05-13 21:13:01 +00:00
jlam
cd4f3767d3 Change references to M4 & YACC into TOOLS_M4 & TOOLS_YACC to simplify
transition to new tools framework.
2005-05-13 16:54:12 +00:00
jlam
436d9bbbd5 Instead of structuring code so that variables defined by the EVAL_PREFIX
loop are only used afterwards, split out the EVAL_PREFIX code into a
separate file find-prefix.mk that can be included at any point to
generate a prefix-computation for the variables specified by FIND_PREFIX
at the inclusion point.
2005-05-12 20:41:10 +00:00
jlam
78bb5672f0 Only cache the variable if it's been defined. 2005-05-12 18:07:30 +00:00
jlam
714ab3325d There's no need to check for EXTRACT_SUFX when figuring out whether we
need to use bzcat for patches.  bsd.pkg.extract.mk can figure out
independently whether bzcat is needed for distfiles.  This fixes
PR pkg/30206.
2005-05-12 01:14:05 +00:00
jlam
f08ed08387 Under the new tools framework, we use TOOLS_AWK to represent the awk
program that the software itself uses.  Duplicate that using the old
framework to ease integration.
2005-05-11 22:19:00 +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
0e589ad8af Separate out the variables and targets for the "extract" phase into a
separate file pkgsrc/mk/bsd.pkg.extract.mk.  Also, include this file
ahead of the inclusion of bsd.tools.mk so that tools required to
extract are created by the tools framework.
2005-05-11 04:01:49 +00:00
jlam
962622ba7d Rename mk/bsd.pkg.install.mk to mk/install/bsd.pkginstall.mk to
consolidate the files for that framework in one directory.
2005-05-11 02:07:37 +00:00
jlam
fb1593ba8b Split out ldconfig handling from the USE_TOOLS processing in replace.mk.
This makes more sense since there is never going to be a pkgsrc
replacement for ldconfig.  We now always create an ldconfig tool in
${TOOLS_DIR} that either calls the system-supplied one if it exists,
or is a no-op.
2005-05-10 20:14:27 +00:00
jlam
137ec423f9 Split out "strip" from the USE_TOOLS processing in replace.mk. Instead,
we create a "strip" tool unconditionally, and make it either a no-op or
the real thing depending on the whether we want unstripped files or not.
2005-05-10 19:52:30 +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
06b6c2b595 In make variables, quotes protect embedded whitespace in words, so we
can replace :C/^ *//:C/ *$// with :M* to get the same effect -- removing
leading and trailing whitespace and extra spaces between words.
2005-05-10 01:34:04 +00:00
jlam
03e9337879 Teach bsd.pkg.mk to create a phase-specific "makevars.mk" file that
caches variable definitions that were computed by make.  These variables
are specified by listing them in MAKE_VARS, e.g.,

	.if !defined(FOO)
	FOO!=	very_time_consuming_command
	.endif
	MAKE_VARS+=	FOO

bsd.pkg.mk will include only the one generated during the most recent
phase.  A particular phase's makevars.mk file consists of variable
definitions that are a superset of all of the ones produced in previous
phases of the build.

The caching is useful because bsd.pkg.mk invokes make recursively,
which in the example above has the potential to run the very time-consuming
command each time unless we cause FOO to be defined for the sub-make
processes.  We don't cache via MAKE_FLAGS because MAKE_FLAGS isn't
consistently applied to every invocation of make, and also because
MAKE_FLAGS can overflow the maximum length of a make variable very
quickly if we add many values to it.

One important and desirable property of variables cached via MAKE_VARS
is that they only apply to the current package, and not to any
dependencies whose builds may have been triggered by the current
package.

The makevars.mk files are generated by new targets fetch-vars,
extract-vars, patch-vars, etc., and these targets are built during
the corresponding real-* target to ensure that they are being invoked
with PKG_PHASE set to the proper value.

Also, remove the variables cache file that bsd.wrapper.mk was generating
since the new makevars.mk files provide the same functionality at a
higher level.  Change all WRAPPER_VARS definitions that were used by
the old wrapper-phase cache file into MAKE_VARS definitions.
2005-05-09 05:06:55 +00:00
dillo
a05c767c7c Add a dummy describe-options target for package not using the
options framework.
2005-05-08 13:52:25 +00:00
wiz
af43f6cfdc Refer doc/pkgsrc.txt instead of Packages.txt. 2005-05-07 22:16:38 +00:00
reed
4c676c29a2 Add PKGBASE to MESSAGE_SUBST for substituting variables in MESSAGEs.
Noticed it was used in multimedia/xine-ui/MESSAGE.NetBSD.

Maybe this is redundant, and in that case, could have just hard-coded
"xine-ui" instead.
2005-05-07 19:32:56 +00:00
jlam
91092c5789 Teach the new tools framework about ${STRIP}, which is used in some
packages to strip installed executables.  If INSTALL_UNSTRIPPED ==
"yes", then we create a "strip" wrapper in ${TOOLS_DIR} that just
calls ${TRUE} by considering ${TRUE} the system-supplied strip command.
2005-05-04 06:42:43 +00:00
jlam
b8d377ce5f In make, && has a higher precedence than ||. Add parentheses to fix the
logic of the conditional.
2005-05-04 04:23:34 +00:00
kristerw
065f886910 Repair CHECK_FILES by adding \( \) around the -or expression in find. 2005-05-03 21:30:42 +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
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
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
93657f4c61 We need ldconfig (this should probably be restricted only to packages that
install shared libraries).
2005-05-02 05:45:15 +00:00
jlam
4ba6c74f93 Re-order nested .if statements for brevity. 2005-05-02 03:09:04 +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
drochner
8a1ed6d421 whitespace fix -- does nobody use emacs here? 2005-04-25 16:47:18 +00:00
jlam
e95a9612bd Prepend USE_NEW_TOOLS with an underscore to make it private. Developers
should set _USE_NEW_TOOLS=yes in /etc/mk.conf in order to test the new
tools framework.
2005-04-22 02:20:22 +00:00
tv
ccf0e6df92 Work around brain damaged autoconf by stripping leading and trailing
whitespace from *FLAGS and LIBS before doing :Q quoting.

Should fix PR pkg/29945.
2005-04-21 15:53:53 +00:00
agc
30ebfbe282 Add _DISTFILES and _PATCHFILES definitions to the list of definitions
which get recorded in the build information (accessible with pkg_info -B).
2005-04-18 10:06:47 +00:00
agc
82419dde61 Don't fail if there are multiple digest values for the same file with the
same algorithm in the distinfo file - pointed out by Robert Elz in PR 29973.

Additional testing by wiz - thanks!
2005-04-16 09:26:22 +00:00
agc
9318dc5a01 Occasionally we do not want the "--host=${MACHINE_GNU_PLATFORM}" argument
added if GNU_CONFIGURE is specified - the arla and forthcoming openafs
packages are ones that need to be able to let the GNU configure script
guess for itself, rather than hardcoding the value.

Add a switch called USE_GNU_CONFIGURE_HOST to determine whether the
--host argument is provided to the GNU configure script.  This is
switched on (it has a "yes" value) by default, so the previous
behaviour applies, but allows us to specify this value on a
package-by-package basis.

Documentation changes for this are also forthcoming.
2005-04-16 09:20:18 +00:00
jlam
91563cafa5 Add a new yes/no variable USE_NEW_TOOLS to ease testing the new tools
framework.  USE_NEW_TOOLS defaults to "no".
2005-04-15 02:04:57 +00:00
rillig
40631ad1b3 Print out the exitcode of pkg_create if nonzero, as it sometimes exists
without an error message. (Example: editors/abiword on NetBSD-1.6.2/i386.)
Approved by jlam.
2005-04-13 16:15:59 +00:00
jlam
4539e78461 Fix error introduced in rev. 1.1606: "$${PKGVULNDIR}" should be
"${PKGVULNDIR}" (one $, not two).  This was causing the vulnerabilities
file to be looked for in the wrong place.  This fix makes the
check-vulnerable target actually parse the vulnerabilities file and
look for vulnerable installed packages again.
2005-04-13 14:07:30 +00:00
tv
f8bc76558e Always include wrapper/bl3, period, even if NO_BUILD. 2005-04-05 14:00:33 +00:00
minskim
aa94bc412a Prevent MAKEFLAGS from being passed through shell environment. It was
redundant because we explicitly pass MAKEFLAGS to a sub-process
through command line arguments.

This fixes the problem reported in PR pkg/29874 that PKGNAME_REQD is
not overridden in recursive MAKE calls.
2005-04-05 03:18:00 +00:00
agc
974f1af6e8 Fix for PR 28230 (bsd.pkg.mk ignores /etc/audit-packages.conf) by
sourcing any config file, if it's defined.  With thanks to Julio M.
Merino Vidal for the first pass at a fix, and for keeping me honest
and up-to-date with variable checks in portable shell constructs.
2005-03-31 21:02:28 +00:00
garbled
9a6f8c33a1 Fixes for shlib handling on AIX 2005-03-29 08:17:42 +00:00
tv
fe3c1321bf USE_BUILDLINK3 is no longer optional (and cannot be turned off). Per mail
to tech-pkg:

=====

* USE_BUILDLINK3=YES will be unconditional.  (In fact, USE_BUILDLINK3 will
  be ignored altogether by mk/; but see below.)

* NO_BUILDLINK and NO_WRAPPER will be ignored by mk/.  If a build happens,
  these phases will happen.

* The existing NO_BUILD will imply the previous NO_BUILDLINK and NO_WRAPPER.
  If no build happens, those phases are not needed.

* NO_TOOLS will be ignored by mk/.  The tools phase, which provides much
  more than just the C compiler, will always happen regardless of package.
  This will make metapackage builds only slightly slower, in trade for far
  less user error.
2005-03-24 17:46:00 +00:00
xtraeme
896629329a In the distclean target, if PKG_RESUME_TRANSFERS is set, clean
the temp files too.
2005-03-22 22:49:15 +00:00
xtraeme
8ca224b2cb Some changes for PKG_RESUME_TRANSFERS:
o If origfile is already downloaded (size ok) and there's
  a temp file with incomplete size, don't try to resume the
  transfer on the temp file, remove it.
o Clean the code a bit.
2005-03-22 22:20:21 +00:00