From owner-freebsd-ports-bugs@FreeBSD.ORG Thu Oct 30 15:00:03 2008 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 279BB10656DD for ; Thu, 30 Oct 2008 15:00:03 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id E6C878FC2A for ; Thu, 30 Oct 2008 15:00:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id m9UF02pS071860 for ; Thu, 30 Oct 2008 15:00:02 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id m9UF02V5071859; Thu, 30 Oct 2008 15:00:02 GMT (envelope-from gnats) Resent-Date: Thu, 30 Oct 2008 15:00:02 GMT Resent-Message-Id: <200810301500.m9UF02V5071859@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Dmitry Marakasov Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2FBDB106567C; Thu, 30 Oct 2008 14:57:18 +0000 (UTC) (envelope-from amdmi3@amdmi3.ru) Received: from smtp.timeweb.ru (smtp.timeweb.ru [217.170.79.85]) by mx1.freebsd.org (Postfix) with ESMTP id A5FEB8FC27; Thu, 30 Oct 2008 14:57:17 +0000 (UTC) (envelope-from amdmi3@amdmi3.ru) Received: from [213.148.20.85] (helo=hive.panopticon) by smtp.timeweb.ru with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.69) (envelope-from ) id 1KvYxa-0002ep-Df; Thu, 30 Oct 2008 17:57:18 +0300 Received: from hades.panopticon (hades.panopticon [192.168.0.32]) by hive.panopticon (Postfix) with ESMTP id EC1A471B4; Thu, 30 Oct 2008 17:57:16 +0300 (MSK) Received: by hades.panopticon (Postfix, from userid 1000) id 1E68217032; Thu, 30 Oct 2008 17:57:13 +0300 (MSK) Message-Id: <20081030145713.1E68217032@hades.panopticon> Date: Thu, 30 Oct 2008 17:57:13 +0300 (MSK) From: Dmitry Marakasov To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: marcus@FreeBSD.org Subject: ports/128482: [PATCH] ports-mgmt/portlint: add some CONFIGURE_ENV/CFLAGS checks X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Oct 2008 15:00:03 -0000 >Number: 128482 >Category: ports >Synopsis: [PATCH] ports-mgmt/portlint: add some CONFIGURE_ENV/CFLAGS checks >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Thu Oct 30 15:00:02 UTC 2008 >Closed-Date: >Last-Modified: >Originator: Dmitry Marakasov >Release: FreeBSD 7.0-RELEASE-p1 i386 >Organization: >Environment: System: FreeBSD hades.panopticon 7.0-RELEASE-p1 FreeBSD 7.0-RELEASE-p1 #1: Wed Jun 25 15:36:22 MSD 2008 >Description: Add checks to portlint to mainly catch the following thing: CONFIGURE_ENV= CFLAGS=-I${LOCALBASE}/include as here CFLAGS would be clobbered. Also warn about using CFLAGS in CONFIGURE_ENV in general (as they're already added to environment in bsd.port.mk) and suggest to pass include patchs via CPPFLAGS in case of GNU configure. Port maintainer (marcus@FreeBSD.org) is cc'd. Generated with FreeBSD Port Tools 0.77 >How-To-Repeat: >Fix: --- portlint-2.10.1_2.patch begins here --- Index: Makefile =================================================================== RCS file: /home/amdmi3/projects/freebsd/FreeBSD.cvs/ports/ports-mgmt/portlint/Makefile,v retrieving revision 1.127 diff -u -u -r1.127 Makefile --- Makefile 22 Oct 2008 22:04:37 -0000 1.127 +++ Makefile 30 Oct 2008 14:44:41 -0000 @@ -9,7 +9,7 @@ PORTNAME= portlint PORTVERSION= 2.10.1 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= ports-mgmt MASTER_SITES= # none DISTFILES= # none Index: src/portlint.pl =================================================================== RCS file: /home/amdmi3/projects/freebsd/FreeBSD.cvs/ports/ports-mgmt/portlint/src/portlint.pl,v retrieving revision 1.104 diff -u -u -r1.104 portlint.pl --- src/portlint.pl 22 Oct 2008 22:04:38 -0000 1.104 +++ src/portlint.pl 30 Oct 2008 14:53:21 -0000 @@ -187,7 +187,7 @@ INDEXFILE PKGORIGIN CONFLICTS PKG_VERSION PKGINSTALLVER PLIST_FILES OPTIONS INSTALLS_OMF USE_GETTEXT USE_RC_SUBR DIST_SUBDIR ALLFILES IGNOREFILES CHECKSUM_ALGORITHMS INSTALLS_ICONS - GNU_CONFIGURE CONFIGURE_ARGS + GNU_CONFIGURE CONFIGURE_ARGS CONFIGURE_ENV ); my $cmd = join(' -V ', "make $makeenv MASTER_SITE_BACKUP=''", @varlist); @@ -1893,6 +1893,46 @@ } # + # whole file: check correct passing/changing of CFLAGS/CXXFLAGS + # + if ($makevar{CONFIGURE_ENV} =~ /C(XX)?FLAGS/) { + my $cflags; + my $cxxflags; + if ($makevar{CONFIGURE_ENV} =~ /CFLAGS="([^"]+)"/ || + $makevar{CONFIGURE_ENV} =~ /CFLAGS='([^']+)'/ || + $makevar{CONFIGURE_ENV} =~ /CFLAGS=(\S+)/) { + $cflags = $1; + } + if ($makevar{CONFIGURE_ENV} =~ /CXXFLAGS="([^"]+)"/ || + $makevar{CONFIGURE_ENV} =~ /CXXFLAGS='([^']+)'/ || + $makevar{CONFIGURE_ENV} =~ /CXXFLAGS=(\S+)/) { + $cxxflags = $1; + } + + &perror("WARN", $file, -1, "CFLAGS/CXXFLAGS are not needed in ". + "CONFIGURE_ENV as they are already added there in bsd.port.mk."); + + if ($makevar{GNU_CONFIGURE} ne '') { + if ((defined $cflags && $cflags =~ /-I/) || + (defined $cxxflags && $cxxflags =~ /-I/)) { + &perror("WARN", $file, -1, "Consider passing include paths to configure ". + "via CPPFLAGS environment variable (i.e. CPPFLAGS=\"-I...\" in ". + "CONFIGURE_ENV)"); + } + } + + if (defined $cflags && $cflags !~ /\$\{CFLAGS/) { + &perror("FATAL", $file, -1, "CFLAGS are clobbered in CONFIGURE_ENV. ". + "Alter CFLAGS in the Makefile with CFLAGS+= instead"); + } + + if (defined $cxxflags && $cxxflags !~ /\$\{CXXFLAGS/) { + &perror("FATAL", $file, -1, "CXXFLAGS are clobbered in CONFIGURE_ENV. ". + "Alter CXXFLAGS in the Makefile with CXXFLAGS+= instead"); + } + } + + # # slave port check # my $masterdir = $makevar{MASTERDIR}; --- portlint-2.10.1_2.patch ends here --- >Release-Note: >Audit-Trail: >Unformatted: