NetBSD Problem Report #18248

Received: (qmail 8676 invoked by uid 605); 10 Sep 2002 02:30:51 -0000
Message-Id: <20020910023050.8C22911122@narn.netbsd.org>
Date: Mon,  9 Sep 2002 19:30:50 -0700 (PDT)
From: Andrew.E.White@motorola.com
Sender: gnats-bugs-owner@netbsd.org
Reply-To: Andrew.E.White@motorola.com
To: gnats-bugs@gnats.netbsd.org
Subject: -I (space) (path) syntax not supported by bsd.dep.mk
X-Send-Pr-Version: www-1.0

>Number:         18248
>Category:       toolchain
>Synopsis:       -I (space) (path) syntax not supported by bsd.dep.mk
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    lukem
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Sep 10 02:31:00 +0000 2002
>Closed-Date:    Tue Jan 27 03:33:25 +0000 2004
>Last-Modified:  Tue Jan 27 03:33:25 +0000 2004
>Originator:     Andrew White
>Release:        1.5.3
>Organization:
MARC
>Environment:
NetBSD thor 1.5.3 NetBSD 1.5.3 (GENERIC) #0: Tue Aug 27 17:42:36 EST 2002     awhite@thor:/usr/src/sys/usr/src/sys/arch/i386/compile/GENERIC i386
>Description:
In bsd.sys.mk, the dependency code uses the pattern ${CXXFLAGS:M-[ID]*} to match and extract include paths.  Unfortunately, this works fine for -I/this/path, but breaks when the equally legal (to the compiler) -I /this/path is used.  Instead, you get mkdep -a -I -I -I ...
>How-To-Repeat:
Add include paths to COPTS using -I /this/path syntax, and make depend.
>Fix:
Pattern is obviously too restrictive, but fix is not obvious.  Other alternatives may be available, including a mechanism to abort with a useful error message when a -I /this/path is used, allowing the user to edit makefiles.  Of course, this negatively impacts portability.
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->feedback 
State-Changed-By: lukem 
State-Changed-When: Sun Jul 20 16:24:16 UTC 2003 
State-Changed-Why:  

This is a non trivial problem to solve, and also affects other flags 
used in similar ways in other variables, including -U, -D, and -L. 

We'd either have to an another modifier flag to make (or a suffix 
to :S or :C), or add a lot of code to evaluate variables through sed 
(for example) to normalize '-I foo' -> '-Ifoo' before we did :M-I 

or 

We could document that the various make(1) variables that take -I, -D, -U 
and -L in their arguments as not supporting a space between the option 
and argument within the make variable. 

The former is a lot of work, and would slow the build process down even more 
(for all the overhead in "normalising" the arguments, or even an alternate 
way of pulling out all the '-Ifoo' AND '-I foo' arguments, due to the way 
that make(1) works on variables as space-separate strings). 

The latter is easy to implement, and in my humble opinion, doesn't impose 
that much of a restriction on the end user of our .mk infrastructure. 

Thoughts? 



Responsible-Changed-From-To: toolchain-manager->lukem 
Responsible-Changed-By: lukem 
Responsible-Changed-When: Sun Jul 20 16:24:16 UTC 2003 
Responsible-Changed-Why:  

From: Andrew White <Andrew.E.White@motorola.com>
To: gnats-bugs@gnats.netbsd.org
Cc:  
Subject: Re: toolchain/18248
Date: Wed, 20 Aug 2003 16:58:00 +1000

 As long as the tools can handle the 'no space' version I don't see a problem
 with this.
State-Changed-From-To: feedback->closed 
State-Changed-By: lukem 
State-Changed-When: Tue Jan 27 03:32:33 UTC 2004 
State-Changed-Why:  
I've fixed the makefiles to use 
:C/-([IDU])[  ]*/-1/Wg:M-[IDU]* 
instead of just 
:M-[IDU]* 
which fixes this problem. 
(This needs a version of make with :C///W, which appeared in -current 3 months 
ago) 
>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.