Source-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/mk/tools mk/tools/perl.mk: allow to silence the USE_TO...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/d6496efc1040
branches:  trunk
changeset: 431191:d6496efc1040
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Sun May 10 06:05:35 2020 +0000

description:
mk/tools/perl.mk: allow to silence the USE_TOOLS+=perl warning

Packages that don't declare USE_TOOLS+=perl and whose configure script
invokes perl produce a warning.

Usually warnings are ignored, but they can also be configured as errors,
for example during a strict bulk build.  In this situation it is
necessary to override the default behavior of the perl tool to fail
silently.  Up to now, defining both TOOLS_BROKEN+=perl and
TOOLS_FAIL+=perl produced a duplicate make target.

To handle this situation, let TOOLS_BROKEN+=perl take precedence over
TOOLS_FAIL+=perl.  This is much easier than finding out in each case how
to disable the perl check in the configure script, which is most often
done by adding any of the following to CONFIGURE_ENV: PERL=#none,
ac_cv_prog_PERL=#none, ac_cv_path_PERL=#none.

diffstat:

 mk/tools/perl.mk |  15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)

diffs (38 lines):

diff -r 3520fd4824f4 -r d6496efc1040 mk/tools/perl.mk
--- a/mk/tools/perl.mk  Sun May 10 05:49:24 2020 +0000
+++ b/mk/tools/perl.mk  Sun May 10 06:05:35 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: perl.mk,v 1.25 2018/08/22 20:48:37 maya Exp $
+# $NetBSD: perl.mk,v 1.26 2020/05/10 06:05:35 rillig Exp $
 #
 # Copyright (c) 2005 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -28,10 +28,17 @@
 # POSSIBILITY OF SUCH DAMAGE.
 #
 
+# Packages that need perl as a tool should:
 #
-# This Makefile fragment defines additional variables that are used by
-# packages that use the perl tool.
+#      USE_TOOLS+=     perl    # (or perl:run)
 #
+# Otherwise they get a warning whenever the perl tool is used, usually in
+# the configure phase.  To suppress this warning in case perl is not
+# actually needed:
+#
+#      TOOLS_BROKEN+=  perl
+#
+# Keywords: perl USE_TOOLS
 
 .if defined(_USE_TOOLS) && !empty(_USE_TOOLS:Mperl)
 #
@@ -40,7 +47,7 @@
 # and existing on the filesystem.
 #
 .  include "../../lang/perl5/vars.mk"
-.else
+.elif !${TOOLS_BROKEN:U:Mperl}
 #
 # If a package doesn't explicitly say it uses perl, then create a "broken"
 # perl in the tools directory.



Home | Main Index | Thread Index | Old Index