tech-pkg archive

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

Re: devel/imake and clang

On Tue, Dec 30, 2014 at 01:18:40PM +0100, Joerg Sonnenberger wrote:
> On Tue, Dec 30, 2014 at 11:25:21AM +0100, Edgar Fu? wrote:
> > On my machine (OS X 10.6.8 with clang 1.7) configuring devel/imake fails,
> > because this Makefile fragment:
> > 	CPPFLAGS+=		-DRAWCPP=\"${PREFIX}/bin/tradcpp\"
> > leads to an implicit
> > 	#define RAWCPP \"/usr/pkg/bin/tradcpp\"
> > with clang.
> > It helps to change that Makefile line to:
> > 	CPPFLAGS+=		-DRAWCPP='"${PREFIX}/bin/tradcpp"'
> > but I'm not sure whether that's the right thing to do for all compilers and 
> > all Versions of auto*.
> That makes no sense, they should result in exactly the same variable
> content.

In a normal makefile, with a normal 'make', none of \ ' or " should have any
special meaning (the only escape in make is $$).
So the CPPFLAGS variable starts \" or '" and is subtituted that way.
So the ${CC} line passed to the shell contains \" or '".
And then RAWCPP will contain leading and trailing " in both cases.
(if PREFIX has embedded spaces then you need to have used ')

Of course, if the command line us passed through to another shell
all bets are off.
I've a vague memory of avoiding trying to set quoted strings on cc
command lines and getting cpp to quote the substitution instead.
Can't remember which compilation env was broken.


David Laight:

Home | Main Index | Thread Index | Old Index