Commit graph

38 commits

Author SHA1 Message Date
rillig
3911155e2f Moved the portability checks from the configure/ directory to checks/,
since according to the comment in check/bsd.check.mk, they belong there.

Added a new check for all C and C++ header files to make sure they don't
contain strings like ${prefix} or ${exec_prefix}, which is currently a
problem with sysutils/dbus and has been noticed in PR 35019. This check
is disabled by default since I don't know anything about possible false
positives, but I plan to enable it for PKG_DEVELOPERs after some
testing.

Added two names for hooks that are placed in the configure and in the
build phase. Now the checks look more like becoming something one could
call a framework, sharing a common structure and a documented interface.
2006-11-09 02:53:15 +00:00
rillig
3053f12ee8 Normalized the way test(1) is used. Since I have no idea whether ${TEST}
or [] is better, I have used [ to keep the code shorter. Noticed by wiz.
2006-11-05 12:40:01 +00:00
rillig
7104495b24 The config.guess, config.sub and libtool files should also be
overwritten when the package-provided files are (possibly dead)
symlinks. Since on Mac OS X, ls(1) does not return the status I
expected, I investigated a little in the available options of test(1),
and found that the "-h" option should be quite portable. So let's try
that instead.

This fixes PR 34865.
2006-11-05 07:41:06 +00:00
rillig
4c23a4cfdf Added a "see also" entry. 2006-10-29 20:12:49 +00:00
tv
4b29649f1c PKG_DEVELOPER is a defined check; it doesn't need to equal the string "yes". 2006-10-26 14:42:53 +00:00
rillig
9916b8544c Added the CHECK_PORTABILITY_SKIP variable that may be defined by packages
to exclude some files from the portability checks.
2006-10-23 16:07:12 +00:00
rillig
135672e722 If ${WRKSRC} does not yet exist in the configure phase, skip the
portability checks. Needed for the emulators/compat?? packages.
2006-10-21 19:07:18 +00:00
rillig
edbaa66414 Documented a not-so-easily-fixed bug that occurs when stripping comments
off a line.
2006-10-21 10:37:48 +00:00
rillig
f4a3dfca23 Warnings must only be prefixed by a warnings heading, not an error
heading.
2006-10-12 20:36:34 +00:00
rillig
636b8b0e77 Portability checks, version two.
The actual check has moved into a shell file to allow for nice-looking
code. Instead of only the configure scripts, it scans all files whose
first line matches "#!*/bin/sh". Therefore the check is run no matter if
HAS_CONFIGURE is set or not.

Added a warning (not an error) for every use of $RANDOM that is not
combined with $$, the process ID. $RANDOM is only implemented by bash
and some versions of the ksh.
2006-10-12 17:57:05 +00:00
rillig
c6fdabdf40 If a word in a configure script is "#", stop scanning that line for
"test ==".
2006-10-05 10:52:40 +00:00
rillig
5305a8ebc5 Replaced "test -f" with "ls". That way, broken symbolic links are also
replaced with the pkgsrc versions of libtool, config.guess and others.
2006-10-05 02:59:54 +00:00
rillig
ecd4e9d40b It's SKIP_PORTABILITY_CHECK, not SKIP_PORTABILITY_CHECKS. 2006-10-05 02:58:28 +00:00
rillig
48263488c5 Some fixes:
- PKG_DEVELOPER may be undefined, meaning "no".
- Removed unused variables.
- Removed a trailing empty line.
2006-10-02 16:16:14 +00:00
rillig
dba58f8d58 Added a new compile-time check that detects the usage of the "=="
operator in test(1). It is enabled by default when PKG_DEVELOPER is
selected.

In my private bulk build of about 3700 packages, there had been no false
positive.
2006-10-02 15:42:47 +00:00
rillig
262f164d43 Bugfix: In the #! interpreter lines, allow white-space behind the #!.
This fixes the build for audio/madman. Before, only some of the
interpreters had been replaced.
2006-09-19 20:51:34 +00:00
salo
4d7889fa96 Add "itlocaledir" to the list of directory patterns to replace.
From Gilles Dauphin via PR pkg/34103
2006-08-03 16:49:48 +00:00
rillig
be75f6ee56 The intention behind REPLACE_BASH was to make replacing /bin/sh with
${BASH} easy, so the pattern that is replaced is now .*sh instead .*bash.
2006-07-27 14:51:54 +00:00
jlam
6a569e5eb8 After auditing all the packages the ensure that they never invoke the
compiler toolchain until the configure stage, move the "wrapper" stage
back to between "patch" and "configure".

This makes "make extract NO_DEPENDS=" work again for all packages.
2006-07-27 13:47:29 +00:00
jlam
7e75e0ad89 The proper phase to run just before "configure" is "patch", not
"wrapper", after "wrapper" was moved to be between "tools" and "extract".
This should fix PR pkg/34061.
2006-07-23 15:33:16 +00:00
jlam
77b719dae8 Modify the barrier so that we always invoke the recursive make process
when passing through the barrier.  This ensures the PATH (passed via
PKGSRC_MAKE_ENV) is correctly set for all phases after the barrier.

This fixes a bug in "interactive" pkgsrc use, where if you have no
work directory and type "make build && make install", then the "install"
step does not have a PATH set to include all the wrapper and tools
directories.
2006-07-22 16:31:35 +00:00
jlam
4011c5cff2 Rearrange sequence so that "wrapper" occurs between "tools" and
"extract".  This allows all user-definable targets (pre-*, do-*,
post-*) to have access to the wrapper scripts.
2006-07-21 14:21:28 +00:00
jlam
7c21fc1820 Change last instance of _REPLACE.* to REPLACE.*. Remove special
_REPLACE.* handling from replace-interpreter.mk.
2006-07-20 13:54:44 +00:00
jlam
f1759fb181 Handle case where {SH,}LIBTOOL_OVERRIDE is empty for shells that don't
understand empty lists in for loops.  Addresses PR pkg/34042.
2006-07-19 22:07:13 +00:00
jlam
7af716330d Drop support for LTCONFIG_OVERRIDE. For quite a long time, pkgsrc
had actually been ignoring LTCONFIG_OVERRIDE anyway and just using
the default LIBTOOL_OVERRIDE to replace libtool scripts in packages.
This just formalizes the fact that LTCONFIG_OVERRIDE is not used
meaningfully by pkgsrc.
2006-07-19 19:14:37 +00:00
rillig
2221827892 Split the variable BUILD_DEFS into those that are defined by packages
and those that are defined by the infrastructure (_BUILD_DEFS). This
allows the build-defs-message target to be moved to the end of
bsd.pkg.mk. Now it prints the correct result even in unprivileged
builds, which had been wrong due to the order in which the files have
been included. For example, ${UNPRIVILEGED_USER} was displayed as (not
defined) although its value was defined, which could be checked with
"bmake show-var".

Tested with one package that _does_ define BUILD_DEFS and with one that
doesn't. The behavior stays the same.
2006-07-15 23:58:52 +00:00
rillig
69811464e9 Added some common script interpreters (awk, bash, sh) that can be
replaced automatically by defining REPLACE_AWK, REPLACE_BASH or
REPLACE_SH and an appropriate addition to USE_TOOLS.

The replace-interpreter.mk file is included unconditionally because the
number of variables that would trigger the inclusion of this file is
quite large.
2006-07-15 09:52:00 +00:00
jlam
4c4ffd71da Fix reversed test... noted by deiter roelants on tech-pkg. 2006-07-10 16:12:20 +00:00
jlam
356f5e8af5 Rename <phase>_COOKIE variables to _COOKIE.<phase>. These are private
variables so there are no user-visible changes.  This change just makes
it a little easier to write for loops.
2006-07-07 21:24:27 +00:00
jlam
fb353ac0e3 LIBTOOL_OVERRIDE and SHLIBTOOL_OVERRIDE have slightly different
semantics in pkgsrc.  Because libtool-override is run by default
whenever USE_LIBTOOL is specified, LIBTOOL_OVERRIDE never needs to be
defined, and some packages set it to nothing to avoid running
libtool-override.  However, shlibtool-override is only run if
SHLIBTOOL_OVERRIDE is defined and non-empty.

Split the code for libtool-override and shlibtool-override to reflect
these differing semantics.  This should make the PHP packages build
again by not overriding libtool.
2006-07-07 15:25:05 +00:00
jlam
96e7846323 Move the STEP_MSG outside of the .if.endif block so it's always printed. 2006-07-07 14:25:54 +00:00
jlam
1cd6b0743c Add missing "rm" statement that was causing the libtool wrapper to be
overwritten in the case where LTCONFIG_OVERRIDE was defined.

As a side note, after analyzing the way that the original code in
bsd.pkg.mk worked, I think we can nuke LTCONFIG_OVERRIDE completely,
but we'll need a bulk build to verify this.  The original code always
replaced the libtool scripts because LIBTOOL_OVERRIDE is always defined
in bsd.pkg.use.mk, so LTCONFIG_OVERRIDE essentially had no effect.
2006-07-07 14:06:57 +00:00
jlam
bf9607f39e Make configure, install, and package barrier-aware even if NO_CONFIGURE,
NO_INSTALL, or NO_PACKAGE are defined.
2006-07-07 13:39:52 +00:00
jlam
a8fcae3925 The cookie files are indirectly made using *-cookie targets, so verify
that they are never being created more than once by inserting a check
into the *-cookie targets.
2006-07-06 22:29:52 +00:00
jlam
4e65f8cd0f Fix cut-and-paste goof. 2006-07-06 13:25:57 +00:00
jlam
b8d23232b8 Flatten out recursive makes into a single re-invocation of make by
introducing the concept of a "barrier".  We separate the user-invokable
targets into ones that must happen before the barrier, and ones that
must happen after the barrier.  The ones that happen after the barrier
are run in a sub-make process.  In this case, the targets that must
be run after the barrier are from the "wrapper" step and beyond.  We
rewrite the various "flow" targets, e.g. wrapper, configure, build,
etc., so that they of the right form to use the barrier target.

This now completely removes the concept of PKG_PHASE from pkgsrc.  It
is replaced with the concept of "before" and "after" the barrier, and
this state can be checked by testing for the existence of the barrier
cookie file.  Because we've removed most of the recursive makes, there
is now nowhere to hook the PKG_ERROR_HANDLER.* commands, so remove
them for now.

As part of this commit, put back the logic that conditionalized the
sources for the various cookie files.  Because the sources are all
"phony" targets, they were always run, regardless of whether or not
the cookie file already existed.  Now, if a cookie file exists, then
that entire phase associated with that cookie file is skipped.

Lastly, fix a thinko in configure/bsd.configure.mk where setting
NO_CONFIGURE in a package Makefile would manage to skip the "wrapper"
step altogether.  Fix this by correctly noting "wrapper" and not
"patch" as the preceding step to "configure".
2006-07-05 22:21:02 +00:00
jlam
990d0b5377 Make the check-vulnerable target more self-sufficient, by moving some
of the logic from fetch/fetch.mk into flavor/pkg/check.mk, so that
check-vulnerable can be used as a source target.

Make check-vulnerable a source target for every phase of the build
workflow, which ensures that it is always run if the user starts a
new phase from the command line.

Fix the cookie-generation targets so that they don't append, only
overwrite to the cookie file.  This works around potential problems
due to recursive makes.

Move the cookie checks so that they surround the corresponding phase
target.  The presence of the cookie should now inform the make process
to avoid doing any processing of phases that occur before the phase
corresponding to the cookie.
2006-07-05 09:08:35 +00:00
jlam
e31200b87c Refactor configure, build, test and wrapper phases out of bsd.pkg.mk
and into their own directories.  Also do some cleanups with build/_build
and pkginstall -- we get rid of _build and simply run pkginstall as
part of the "build" target.

Introduce a new mechanism to handle varying directory depths under
${WRKSRC} in which we find files to override, e.g. configure, config.*,
libtool, etc.  OVERRIDE_DIRDEPTH is a package-settable variable that
specifies how far under ${WRKSRC} the various targets should look,
and it defaults to "2".  We preserve the
meaning of the various *_OVERRIDE variables, so if they are defined,
then their values supersede the OVERRIDE_DIRDEPTH mechanism.

devel/tla will need to specially set OVERRIDE_DIRDEPTH to 3 (see log
for revision 1.1857 for bsd.pkg.mk -- to be done in a separate commit.
2006-07-05 06:09:15 +00:00