From 418012426a6105e5c12fe68bf908edd5a5de8723 Mon Sep 17 00:00:00 2001 From: rillig Date: Fri, 21 Jul 2006 05:02:52 +0000 Subject: Warn if GNU_CONFIGURE is set but USE_LANGUAGES does not contain "c", since that one is needed in almost all cases. --- pkgtools/pkglint/files/pkglint.pl | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'pkgtools/pkglint/files/pkglint.pl') diff --git a/pkgtools/pkglint/files/pkglint.pl b/pkgtools/pkglint/files/pkglint.pl index 2e07e10e577..d9ce98830ea 100644 --- a/pkgtools/pkglint/files/pkglint.pl +++ b/pkgtools/pkglint/files/pkglint.pl @@ -1,5 +1,5 @@ #! @PERL@ -# $NetBSD: pkglint.pl,v 1.657 2006/07/18 21:13:22 rillig Exp $ +# $NetBSD: pkglint.pl,v 1.658 2006/07/21 05:02:52 rillig Exp $ # # pkglint - static analyzer and checker for pkgsrc packages @@ -6275,6 +6275,19 @@ sub checkfile_package_Makefile($$$) { $pkgctx_vardef->{"RESTRICTED"}->log_error("Restricted packages must have a LICENSE."); } + if (exists($pkgctx_vardef->{"GNU_CONFIGURE"}) && exists($pkgctx_vardef->{"USE_LANGUAGES"})) { + my $languages_line = $pkgctx_vardef->{"USE_LANGUAGES"}; + + if ($languages_line->text =~ regex_varassign) { + my (undef, $op, $value, undef) = ($1, $2, $3, $4); + + if ($value !~ qr"\bc\b") { + $pkgctx_vardef->{"GNU_CONFIGURE"}->log_warning("GNU_CONFIGURE almost always needs a C compiler, ..."); + $languages_line->log_warning("... but \"c\" is not added to USE_LANGUAGES."); + } + } + } + my $distname_line = $pkgctx_vardef->{"DISTNAME"}; my $pkgname_line = $pkgctx_vardef->{"PKGNAME"}; -- cgit v1.2.3