Subject: Re: custom CFLAGS not getting set
To: Jeremy C. Reed <>
From: Simon Gerraty <>
List: tech-pkg
Date: 12/02/2002 10:25:18
On Mon, 2 Dec 2002 10:01:31 -0800 (PST), "Jeremy C. Reed" writes:
>> Now I see that the Linux system's
>> /home/jeremy/netbsd/usr/pkg/share/mk/ has:
>> CFLAGS=         ${DBG}
>> I believe that is from mk-files.
>> but other mk/ have:
>> CFLAGS?=        ${DBG}
>Why does the assign the value to the variables only if they
>are not already defined, while the other operating system files
>override the settings?

My bad.  Most of the $'s reflect the state of
at the time they were created.  It has been pointed out that this use
of DBG is at best a poor choice of variable name.  I'm sort of waiting
to see what fix Jason comes up with, and will update all these to use
the same solution.

I've also been tempted to do a or perhaps
I think the bootstrap-pkgsrc thing uses some files so there's
probably some benefit in doing this.

>My Linux system's other files use the ?= syntax, but the version
>of I use for building packages is from mk-files and it
>overwrites my custom settings set in individual Makefiles. When I changed

Huh? is read before anything else, so Makefile settings should
not be impacted.  settings on the command line override anything, so
only CFLAGS set in the environment should be impacted?  Or is
something reading directly?

>my /home/jeremy/netbsd/usr/pkg/share/mk/'s
>CFLAGS=        ${DBG}
> to
>CFLAGS?=        ${DBG}
> then all was well for that.
>Why isn't it like that in the first place?

Ancient history I expect.