[Bug 288365] bmake: ports/Mk/bsd.port.mk:2039: warning: Invalid character " " in variable name "pkgconf --cflags libinotify"
Date: Tue, 22 Jul 2025 17:10:05 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=288365
Simon J. Gerraty <sjg@FreeBSD.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|Open |In Progress
--- Comment #3 from Simon J. Gerraty <sjg@FreeBSD.org> ---
Ok, let me refine my question, what is INOTIFY_CFLAGS used for?
ie. what are we trying to achieve?
Knowing that I might be able to suggest a tweak.
The line
INOTIFY_CFLAGS= $$(${PKG_CONFIG} --cflags libinotify)
does not cause a problem, nor does ${INOTIFY_CFLAGS}
but applying := does - because make defaults to .MAKE.SAVE_DOLLARS=no
which affects how $$ is treated by :=
.MAKE.SAVE_DOLLARS=no is the "traditional" bmake behavior such that $$ in :=
becomes $ (I have *lots* of complicated makefiles that depend on that behavior)
and that means your $$() is now being treated like a variable reference.
cat tb288365
PKG_CONFIG= pkgconf
INOTIFY_CFLAGS:= $$(${PKG_CONFIG} --cflags libinotify)
all:
@echo $@ ${INOTIFY_CFLAGS}
% make -f tb288365
make: warning: Invalid character " " in variable name "pkgconf --cflags
libinotify"
while evaluating variable "INOTIFY_CFLAGS" with value "$(pkgconf
--cflags libinotify)"
in command "@echo $@ ${INOTIFY_CFLAGS}"
in target "all"
all
%
% make -f tb288365 .MAKE.SAVE_DOLLARS=yes
all -I/usr/local/include
%
One simple solution is to use backticks rather than $() which is rather fraught
with make:
INOTIFY_CFLAGS= `${PKG_CONFIG} --cflags libinotify`
you only need $() when trying to nest.
--
You are receiving this mail because:
You are the assignee for the bug.